26 |
|
|
27 |
#include "p3/header.h" |
#include "p3/header.h" |
28 |
#include "p3/p3.h" |
#include "p3/p3.h" |
29 |
|
#include "p3/ack.h" |
30 |
#include "p3/misc.h" |
#include "p3/misc.h" |
31 |
#include "p3/check.h" |
#include "p3/check.h" |
32 |
|
|
70 |
{ |
{ |
71 |
debug(1,"P3 - Bad packet received:\n"); |
debug(1,"P3 - Bad packet received:\n"); |
72 |
debug(1,"\tnot 0x0d terminated\n"); |
debug(1,"\tnot 0x0d terminated\n"); |
73 |
|
p3_send_nack (header); |
74 |
return 0; |
return 0; |
75 |
} |
} |
76 |
|
|
79 |
{ |
{ |
80 |
debug(1,"P3 - Bad packet received:\n"); |
debug(1,"P3 - Bad packet received:\n"); |
81 |
debug(1,"\tthis is a client packet!\n"); |
debug(1,"\tthis is a client packet!\n"); |
82 |
|
p3_send_nack (header); |
83 |
return 0; |
return 0; |
84 |
} |
} |
85 |
|
|
89 |
{ |
{ |
90 |
debug(1,"P3 - Bad packet received:\n"); |
debug(1,"P3 - Bad packet received:\n"); |
91 |
debug(1,"\tbad CRC checksum\n"); |
debug(1,"\tbad CRC checksum\n"); |
92 |
|
p3_send_nack (header); |
93 |
return 0; |
return 0; |
94 |
} |
} |
95 |
|
|
108 |
debug (1, "\tseq received: %d\n", header->seq); |
debug (1, "\tseq received: %d\n", header->seq); |
109 |
debug (1, "\tseq expected: %d\n", p3_next_seq (srv.lastseq)); |
debug (1, "\tseq expected: %d\n", p3_next_seq (srv.lastseq)); |
110 |
/* packet is data and the seq isn't what we expect */ |
/* packet is data and the seq isn't what we expect */ |
111 |
|
p3_send_nack (header); |
112 |
return 0; |
return 0; |
113 |
} |
} |
114 |
if ((header->type == TYPE_PING || header->type == TYPE_NACK) && |
if ((header->type == TYPE_PING || header->type == TYPE_NACK) && |
118 |
debug (1, "\tseq received: %d\n", header->seq); |
debug (1, "\tseq received: %d\n", header->seq); |
119 |
debug (1, "\tseq expected: %d\n", srv.lastseq); |
debug (1, "\tseq expected: %d\n", srv.lastseq); |
120 |
/* packet is data and the seq isn't what we expect */ |
/* packet is data and the seq isn't what we expect */ |
121 |
|
p3_send_nack (header); |
122 |
return 0; |
return 0; |
123 |
} |
} |
124 |
|
|