00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __AWHANDLER_MCRX__
00022 #define __AWHANDLER_MCRX__
00023
00024 #include "monitor.h"
00025
00026 #include "wire.h"
00027
00028 #include "bitvector.h"
00029
00079
00080
00081
00082
00083
00084
00085
00086 #include "monitor.h"
00087 #include "wire.h"
00088
00089 #include "mctxrx.h"
00090
00094 typedef struct {
00095
00096 aw_event_sig_t
00097 received,
00098 error;
00099
00100 } aw_mcrxhandler_events_t;
00101
00105 typedef enum {
00106
00107 AW_MCRXHANDLER_IDLE,
00108 AW_MCRXHANDLER_READING,
00109 AW_MCRXHANDLER_WAIT_RETX,
00110
00111 } aw_mcrxhandler_state_cd_t;
00112
00116 typedef struct {
00117
00118 aw_mcrxhandler_state_cd_t
00119 state_cd;
00120
00121
00122 in_addr_t
00123 xtnip;
00124
00125
00126 u_int32_t
00127 xtnid;
00128
00129
00130 aw_address_t
00131 timeout_event_id;
00132
00133 int32_t
00134 file_fd,
00135 mc_fd,
00136 retx_fd;
00137
00138
00139 byte_t
00140 tmp_filename[AW_MCTXRX_MAX_PATHLEN+3];
00141
00142
00143 byte_t
00144 message[0xffff];
00145 u_int32_t
00146 message_size;
00147
00148
00149 aw_bitvector_t
00150 *unread_blocks;
00151
00152 u_int32_t
00153 nblocks_read,
00154 nblocks_missed;
00155
00156 int32_t
00157 last_blockid;
00158
00159 aw_timestamp_t
00160 initial_blocktstamp,
00161 last_blocktstamp;
00162
00163
00164 aw_mctxrx_info_t
00165 info;
00166
00167 } aw_mcrxhandler_state_t;
00168
00169
00173 typedef struct {
00174
00175 aw_handler_t
00176 handler_header;
00177
00178 aw_mcrxhandler_state_t
00179 state;
00180
00181 aw_mcrxhandler_events_t
00182 events;
00183
00184
00185 struct in_addr
00186 mcast_if_addr;
00187
00188
00189 struct sockaddr_in
00190 mcast_grp_addr;
00191
00192
00193 aw_timestamp_t
00194 timeout;
00195
00196
00197 aw_alarm_sched_t
00198 timeout_sched;
00199
00200 } aw_mcrxhandler_t ;
00201
00202
00213 aw_mcrxhandler_t *aw_create_mcrxhandler(const byte_t *mcaddress,
00214 u_int32_t mcport,
00215 const byte_t *mcinterface,
00216 aw_timestamp_t timeout,
00217 const aw_mcrxhandler_events_t *events,
00218 aw_logger_t *logger
00219 );
00220
00221
00222 #endif