Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 375 → Rev 376

/shark/trunk/tracer/newtrace/udp.c
50,6 → 50,8
#define UDP_MAXSIZE 1000
#define TRACER_PORT 20000
 
#define DELAY_LOOP 100000
 
BYTE pkt[UDP_MAXSIZE];
int total_pkt_size = 0;
 
122,6 → 124,8
struct tracer_udp_header head = {"TRACER-V1.0",0,0,0};
struct tracer_udp_header *phead = (struct tracer_udp_header *)(pkt);
 
int i;
 
if (total_pkt_size + size < UDP_MAXSIZE) {
 
if (total_pkt_size == 0) {
157,8 → 161,10
cprintf("Packet Sent - Nr %d Size %d\n",packet_number,total_pkt_size);
#endif
 
if (TracerUDPInit == 1)
if (TracerUDPInit == 1) {
udp_sendto(socket, pkt, total_pkt_size, &target);
for (i=0;i<DELAY_LOOP;i++);
}
 
events_number = 0;
total_pkt_size = 0;
176,11 → 182,14
 
void send_remaining_udp_buffer() {
 
int i;
 
if (TracerUDPInit == 1 && total_pkt_size != 0) {
#ifdef TRACER_UDP_DEBUG
cprintf("Last Packet Sent - Size %d\n",total_pkt_size);
#endif
udp_sendto(socket, pkt, total_pkt_size, &target);
for (i=0;i<DELAY_LOOP;i++);
}
 
}