Revision 6575ae37 transmissionHandler.h

View differences:

transmissionHandler.h
46 46
#ifndef TRANSMISSIONHANDLER_H
47 47
#define TRANSMISSIONHANDLER_H
48 48
#include <sys/time.h>
49
#ifndef WIN32
49 50
#include <netinet/in.h>
50 51
#include <sys/socket.h>
52
#include <arpa/inet.h>
53
#include <sys/uio.h>
54
#endif
51 55
#include <fcntl.h>
52 56
#include <event2/event.h>
53 57
#include <sys/types.h>
54
#include <netinet/in.h>
55
#include <arpa/inet.h>
56
#include <sys/uio.h>
57 58
#include "util/udpSocket.h"
58 59
#include "util/stun.h"
59 60
#include "ml.h"
60 61

  
62
#ifndef WIN32
61 63
#ifndef boolean
62 64
typedef bool boolean;
63 65
#endif
66
#endif
67

  
64 68
#ifndef TRUE
65 69
#define TRUE ((bool)1)
66 70
#endif
......
68 72
#define FALSE ((bool)0)
69 73
#endif
70 74

  
75
#ifdef RTX
76
/**
77
 * This is the maximum number of gaps RTX can keep track of inside one message
78
 */
79
#define RTX_MAX_GAPS 25
80

  
81
#define ML_NACK_MSG 128
82
#endif
71 83
/**
72 84
 * This is the maximum size of the monitoring module header that can be added to the messaging layer header
73 85
 */
......
87 99
/**
88 100
 * Defined a mtu size - IP size - UDP size
89 101
 */
90
typedef enum {MAX = 1472, DSL = 1464, DSLMEDIUM = 1422, DSLSLIM = 1372, BELOWDSL = 1172, MIN = 472,ERROR = -1} pmtu;
102
typedef enum {MAX = 1472, DSL = 1464, DSLMEDIUM = 1422, DSLSLIM = 1372, BELOWDSL = 1172, MIN = 472, P_ERROR = -1} pmtu;
91 103

  
92 104
/**
93 105
 * Define connection command types
......
119 131
  socketaddrgen external_addr; ///< external or reflexive address
120 132
} socket_ID;
121 133

  
134
#ifdef RTX
135
struct gap {
136
	int offsetFrom;
137
	int offsetTo;
138
};
139
#endif
140

  
122 141
/**
123 142
  * A struct that contains information about data that is being received
124 143
  */
......
138 157
  struct event *timeout_event; ///< a timeout event
139 158
  struct timeval timeout_value; ///< the value for a libevent timeout
140 159
  time_t starttime; ///< the start time
160
#ifdef RTX
161
  struct event* last_pkt_timeout_event;
162
  int txConnectionID;
163
  int expectedOffset;
164
  int gapCounter; //index of the first "free slot"
165
  int firstGap;	//first gap which hasn't been handled yet (for which the NACK hasn't been sent yet)
166
  struct gap gapArray[RTX_MAX_GAPS];
167
#endif
141 168
} recvdata;
142 169

  
143 170
struct receive_connection_cb_list{
......
172 199

  
173 200
#define ML_CON_MSG 127
174 201

  
202

  
175 203
/**
176 204
 * A struct with the messaging layer header for connection handling messages
177 205
 */
......
183 211
	socket_ID sock_id;	/// the socketId of the sender
184 212
} __attribute__((packed));
185 213

  
214
#ifdef RTX
215
/************modifications-START************/
216

  
217
struct nack_msg {
218
	int32_t con_id;		///local connectionID of the transmitter
219
	int32_t msg_seq_num;
220
	uint32_t offsetFrom;
221
	uint32_t offsetTo;
222
} __attribute__((packed));
223

  
224
/************modifications-END**************/
225
#endif
226

  
186 227
struct msg_header {
187 228
	uint32_t offset;
188 229
	uint32_t msg_length;
......
196 237
#define MSG_HEADER_SIZE (sizeof(struct msg_header))
197 238
#pragma pack(pop)   /* restore original alignment from stack */
198 239

  
240
int sendPacket(const int udpSocket, struct iovec *iov, int len, struct sockaddr_in *socketaddr);
241

  
199 242
//
200 243
///**
201 244
// * The init method needs to be called to initialise the transmissionHandler

Also available in: Unified diff