ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

test_tcp_oos.c
Go to the documentation of this file.
00001 #include "test_tcp_oos.h"
00002 
00003 #include "lwip/tcp_impl.h"
00004 #include "lwip/stats.h"
00005 #include "tcp_helper.h"
00006 
00007 #if !LWIP_STATS || !TCP_STATS || !MEMP_STATS
00008 #error "This tests needs TCP- and MEMP-statistics enabled"
00009 #endif
00010 #if !TCP_QUEUE_OOSEQ
00011 #error "This tests needs TCP_QUEUE_OOSEQ enabled"
00012 #endif
00013 
00017 #define CHECK_SEGMENTS_ON_OOSEQ 1
00018 
00019 #if CHECK_SEGMENTS_ON_OOSEQ
00020 #define EXPECT_OOSEQ(x) EXPECT(x)
00021 #else
00022 #define EXPECT_OOSEQ(x)
00023 #endif
00024 
00025 /* helper functions */
00026 
00028 static int tcp_oos_count(struct tcp_pcb* pcb)
00029 {
00030   int num = 0;
00031   struct tcp_seg* seg = pcb->ooseq;
00032   while(seg != NULL) {
00033     num++;
00034     seg = seg->next;
00035   }
00036   return num;
00037 }
00038 
00045 static u32_t
00046 tcp_oos_seg_seqno(struct tcp_pcb* pcb, int seg_index)
00047 {
00048   int num = 0;
00049   struct tcp_seg* seg = pcb->ooseq;
00050 
00051   /* then check the actual segment */
00052   while(seg != NULL) {
00053     if(num == seg_index) {
00054       return seg->tcphdr->seqno;
00055     }
00056     num++;
00057     seg = seg->next;
00058   }
00059   fail();
00060   return 0;
00061 }
00062 
00069 static int
00070 tcp_oos_seg_tcplen(struct tcp_pcb* pcb, int seg_index)
00071 {
00072   int num = 0;
00073   struct tcp_seg* seg = pcb->ooseq;
00074 
00075   /* then check the actual segment */
00076   while(seg != NULL) {
00077     if(num == seg_index) {
00078       return TCP_TCPLEN(seg);
00079     }
00080     num++;
00081     seg = seg->next;
00082   }
00083   fail();
00084   return -1;
00085 }
00086 
00092 static int
00093 tcp_oos_tcplen(struct tcp_pcb* pcb)
00094 {
00095   int len = 0;
00096   struct tcp_seg* seg = pcb->ooseq;
00097 
00098   /* then check the actual segment */
00099   while(seg != NULL) {
00100     len += TCP_TCPLEN(seg);
00101     seg = seg->next;
00102   }
00103   return len;
00104 }
00105 
00106 /* Setup/teardown functions */
00107 
00108 static void
00109 tcp_oos_setup(void)
00110 {
00111   tcp_remove_all();
00112 }
00113 
00114 static void
00115 tcp_oos_teardown(void)
00116 {
00117   tcp_remove_all();
00118 }
00119 
00120 
00121 
00122 /* Test functions */
00123 
00127 START_TEST(test_tcp_recv_ooseq_FIN_OOSEQ)
00128 {
00129   struct test_tcp_counters counters;
00130   struct tcp_pcb* pcb;
00131   struct pbuf *p_8_9, *p_4_8, *p_4_10, *p_2_14, *p_fin, *pinseq;
00132   char data[] = {
00133      1,  2,  3,  4,
00134      5,  6,  7,  8,
00135      9, 10, 11, 12,
00136     13, 14, 15, 16};
00137   ip_addr_t remote_ip, local_ip;
00138   u16_t data_len;
00139   u16_t remote_port = 0x100, local_port = 0x101;
00140   struct netif netif;
00141   LWIP_UNUSED_ARG(_i);
00142 
00143   /* initialize local vars */
00144   memset(&netif, 0, sizeof(netif));
00145   IP4_ADDR(&local_ip, 192, 168, 1, 1);
00146   IP4_ADDR(&remote_ip, 192, 168, 1, 2);
00147   data_len = sizeof(data);
00148   /* initialize counter struct */
00149   memset(&counters, 0, sizeof(counters));
00150   counters.expected_data_len = data_len;
00151   counters.expected_data = data;
00152 
00153   /* create and initialize the pcb */
00154   pcb = test_tcp_new_counters_pcb(&counters);
00155   EXPECT_RET(pcb != NULL);
00156   tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port);
00157 
00158   /* create segments */
00159   /* pinseq is sent as last segment! */
00160   pinseq = tcp_create_rx_segment(pcb, &data[0],  4, 0, 0, TCP_ACK);
00161   /* p1: 8 bytes before FIN */
00162   /*     seqno: 8..16 */
00163   p_8_9  = tcp_create_rx_segment(pcb, &data[8],  8, 8, 0, TCP_ACK|TCP_FIN);
00164   /* p2: 4 bytes before p1, including the first 4 bytes of p1 (partly duplicate) */
00165   /*     seqno: 4..11 */
00166   p_4_8  = tcp_create_rx_segment(pcb, &data[4],  8, 4, 0, TCP_ACK);
00167   /* p3: same as p2 but 2 bytes longer */
00168   /*     seqno: 4..13 */
00169   p_4_10 = tcp_create_rx_segment(pcb, &data[4], 10, 4, 0, TCP_ACK);
00170   /* p4: 14 bytes before FIN, includes data from p1 and p2, plus partly from pinseq */
00171   /*     seqno: 2..15 */
00172   p_2_14 = tcp_create_rx_segment(pcb, &data[2], 14, 2, 0, TCP_ACK);
00173   /* FIN, seqno 16 */
00174   p_fin  = tcp_create_rx_segment(pcb,     NULL,  0,16, 0, TCP_ACK|TCP_FIN);
00175   EXPECT(pinseq != NULL);
00176   EXPECT(p_8_9 != NULL);
00177   EXPECT(p_4_8 != NULL);
00178   EXPECT(p_4_10 != NULL);
00179   EXPECT(p_2_14 != NULL);
00180   EXPECT(p_fin != NULL);
00181   if ((pinseq != NULL) && (p_8_9 != NULL) && (p_4_8 != NULL) && (p_4_10 != NULL) && (p_2_14 != NULL) && (p_fin != NULL)) {
00182     /* pass the segment to tcp_input */
00183     test_tcp_input(p_8_9, &netif);
00184     /* check if counters are as expected */
00185     EXPECT(counters.close_calls == 0);
00186     EXPECT(counters.recv_calls == 0);
00187     EXPECT(counters.recved_bytes == 0);
00188     EXPECT(counters.err_calls == 0);
00189     /* check ooseq queue */
00190     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00191     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 8);
00192     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 9); /* includes FIN */
00193 
00194     /* pass the segment to tcp_input */
00195     test_tcp_input(p_4_8, &netif);
00196     /* check if counters are as expected */
00197     EXPECT(counters.close_calls == 0);
00198     EXPECT(counters.recv_calls == 0);
00199     EXPECT(counters.recved_bytes == 0);
00200     EXPECT(counters.err_calls == 0);
00201     /* check ooseq queue */
00202     EXPECT_OOSEQ(tcp_oos_count(pcb) == 2);
00203     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 4);
00204     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 4);
00205     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 8);
00206     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 9); /* includes FIN */
00207 
00208     /* pass the segment to tcp_input */
00209     test_tcp_input(p_4_10, &netif);
00210     /* check if counters are as expected */
00211     EXPECT(counters.close_calls == 0);
00212     EXPECT(counters.recv_calls == 0);
00213     EXPECT(counters.recved_bytes == 0);
00214     EXPECT(counters.err_calls == 0);
00215     /* ooseq queue: unchanged */
00216     EXPECT_OOSEQ(tcp_oos_count(pcb) == 2);
00217     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 4);
00218     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 4);
00219     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 8);
00220     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 9); /* includes FIN */
00221 
00222     /* pass the segment to tcp_input */
00223     test_tcp_input(p_2_14, &netif);
00224     /* check if counters are as expected */
00225     EXPECT(counters.close_calls == 0);
00226     EXPECT(counters.recv_calls == 0);
00227     EXPECT(counters.recved_bytes == 0);
00228     EXPECT(counters.err_calls == 0);
00229     /* check ooseq queue */
00230     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00231     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 2);
00232     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 15); /* includes FIN */
00233 
00234     /* pass the segment to tcp_input */
00235     test_tcp_input(p_fin, &netif);
00236     /* check if counters are as expected */
00237     EXPECT(counters.close_calls == 0);
00238     EXPECT(counters.recv_calls == 0);
00239     EXPECT(counters.recved_bytes == 0);
00240     EXPECT(counters.err_calls == 0);
00241     /* ooseq queue: unchanged */
00242     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00243     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 2);
00244     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 15); /* includes FIN */
00245 
00246     /* pass the segment to tcp_input */
00247     test_tcp_input(pinseq, &netif);
00248     /* check if counters are as expected */
00249     EXPECT(counters.close_calls == 1);
00250     EXPECT(counters.recv_calls == 1);
00251     EXPECT(counters.recved_bytes == data_len);
00252     EXPECT(counters.err_calls == 0);
00253     EXPECT(pcb->ooseq == NULL);
00254   }
00255 
00256   /* make sure the pcb is freed */
00257   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 1);
00258   tcp_abort(pcb);
00259   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 0);
00260 }
00261 END_TEST
00262 
00263 
00267 START_TEST(test_tcp_recv_ooseq_FIN_INSEQ)
00268 {
00269   struct test_tcp_counters counters;
00270   struct tcp_pcb* pcb;
00271   struct pbuf *p_1_2, *p_4_8, *p_3_11, *p_2_12, *p_15_1, *p_15_1a, *pinseq, *pinseqFIN;
00272   char data[] = {
00273      1,  2,  3,  4,
00274      5,  6,  7,  8,
00275      9, 10, 11, 12,
00276     13, 14, 15, 16};
00277   ip_addr_t remote_ip, local_ip;
00278   u16_t data_len;
00279   u16_t remote_port = 0x100, local_port = 0x101;
00280   struct netif netif;
00281   LWIP_UNUSED_ARG(_i);
00282 
00283   /* initialize local vars */
00284   memset(&netif, 0, sizeof(netif));
00285   IP4_ADDR(&local_ip, 192, 168, 1, 1);
00286   IP4_ADDR(&remote_ip, 192, 168, 1, 2);
00287   data_len = sizeof(data);
00288   /* initialize counter struct */
00289   memset(&counters, 0, sizeof(counters));
00290   counters.expected_data_len = data_len;
00291   counters.expected_data = data;
00292 
00293   /* create and initialize the pcb */
00294   pcb = test_tcp_new_counters_pcb(&counters);
00295   EXPECT_RET(pcb != NULL);
00296   tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port);
00297 
00298   /* create segments */
00299   /* p1: 7 bytes - 2 before FIN */
00300   /*     seqno: 1..2 */
00301   p_1_2  = tcp_create_rx_segment(pcb, &data[1],  2, 1, 0, TCP_ACK);
00302   /* p2: 4 bytes before p1, including the first 4 bytes of p1 (partly duplicate) */
00303   /*     seqno: 4..11 */
00304   p_4_8  = tcp_create_rx_segment(pcb, &data[4],  8, 4, 0, TCP_ACK);
00305   /* p3: same as p2 but 2 bytes longer and one byte more at the front */
00306   /*     seqno: 3..13 */
00307   p_3_11 = tcp_create_rx_segment(pcb, &data[3], 11, 3, 0, TCP_ACK);
00308   /* p4: 13 bytes - 2 before FIN - should be ignored as contained in p1 and p3 */
00309   /*     seqno: 2..13 */
00310   p_2_12 = tcp_create_rx_segment(pcb, &data[2], 12, 2, 0, TCP_ACK);
00311   /* pinseq is the first segment that is held back to create ooseq! */
00312   /*     seqno: 0..3 */
00313   pinseq = tcp_create_rx_segment(pcb, &data[0],  4, 0, 0, TCP_ACK);
00314   /* p5: last byte before FIN */
00315   /*     seqno: 15 */
00316   p_15_1 = tcp_create_rx_segment(pcb, &data[15], 1, 15, 0, TCP_ACK);
00317   /* p6: same as p5, should be ignored */
00318   p_15_1a= tcp_create_rx_segment(pcb, &data[15], 1, 15, 0, TCP_ACK);
00319   /* pinseqFIN: last 2 bytes plus FIN */
00320   /*     only segment containing seqno 14 and FIN */
00321   pinseqFIN = tcp_create_rx_segment(pcb,  &data[14], 2, 14, 0, TCP_ACK|TCP_FIN);
00322   EXPECT(pinseq != NULL);
00323   EXPECT(p_1_2 != NULL);
00324   EXPECT(p_4_8 != NULL);
00325   EXPECT(p_3_11 != NULL);
00326   EXPECT(p_2_12 != NULL);
00327   EXPECT(p_15_1 != NULL);
00328   EXPECT(p_15_1a != NULL);
00329   EXPECT(pinseqFIN != NULL);
00330   if ((pinseq != NULL) && (p_1_2 != NULL) && (p_4_8 != NULL) && (p_3_11 != NULL) && (p_2_12 != NULL)
00331     && (p_15_1 != NULL) && (p_15_1a != NULL) && (pinseqFIN != NULL)) {
00332     /* pass the segment to tcp_input */
00333     test_tcp_input(p_1_2, &netif);
00334     /* check if counters are as expected */
00335     EXPECT(counters.close_calls == 0);
00336     EXPECT(counters.recv_calls == 0);
00337     EXPECT(counters.recved_bytes == 0);
00338     EXPECT(counters.err_calls == 0);
00339     /* check ooseq queue */
00340     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00341     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1);
00342     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2);
00343 
00344     /* pass the segment to tcp_input */
00345     test_tcp_input(p_4_8, &netif);
00346     /* check if counters are as expected */
00347     EXPECT(counters.close_calls == 0);
00348     EXPECT(counters.recv_calls == 0);
00349     EXPECT(counters.recved_bytes == 0);
00350     EXPECT(counters.err_calls == 0);
00351     /* check ooseq queue */
00352     EXPECT_OOSEQ(tcp_oos_count(pcb) == 2);
00353     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1);
00354     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2);
00355     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 4);
00356     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 8);
00357 
00358     /* pass the segment to tcp_input */
00359     test_tcp_input(p_3_11, &netif);
00360     /* check if counters are as expected */
00361     EXPECT(counters.close_calls == 0);
00362     EXPECT(counters.recv_calls == 0);
00363     EXPECT(counters.recved_bytes == 0);
00364     EXPECT(counters.err_calls == 0);
00365     /* check ooseq queue */
00366     EXPECT_OOSEQ(tcp_oos_count(pcb) == 2);
00367     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1);
00368     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2);
00369     /* p_3_11 has removed p_4_8 from ooseq */
00370     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 3);
00371     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 11);
00372 
00373     /* pass the segment to tcp_input */
00374     test_tcp_input(p_2_12, &netif);
00375     /* check if counters are as expected */
00376     EXPECT(counters.close_calls == 0);
00377     EXPECT(counters.recv_calls == 0);
00378     EXPECT(counters.recved_bytes == 0);
00379     EXPECT(counters.err_calls == 0);
00380     /* check ooseq queue */
00381     EXPECT_OOSEQ(tcp_oos_count(pcb) == 2);
00382     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1);
00383     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1);
00384     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 2);
00385     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 12);
00386 
00387     /* pass the segment to tcp_input */
00388     test_tcp_input(pinseq, &netif);
00389     /* check if counters are as expected */
00390     EXPECT(counters.close_calls == 0);
00391     EXPECT(counters.recv_calls == 1);
00392     EXPECT(counters.recved_bytes == 14);
00393     EXPECT(counters.err_calls == 0);
00394     EXPECT(pcb->ooseq == NULL);
00395 
00396     /* pass the segment to tcp_input */
00397     test_tcp_input(p_15_1, &netif);
00398     /* check if counters are as expected */
00399     EXPECT(counters.close_calls == 0);
00400     EXPECT(counters.recv_calls == 1);
00401     EXPECT(counters.recved_bytes == 14);
00402     EXPECT(counters.err_calls == 0);
00403     /* check ooseq queue */
00404     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00405     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 15);
00406     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1);
00407 
00408     /* pass the segment to tcp_input */
00409     test_tcp_input(p_15_1a, &netif);
00410     /* check if counters are as expected */
00411     EXPECT(counters.close_calls == 0);
00412     EXPECT(counters.recv_calls == 1);
00413     EXPECT(counters.recved_bytes == 14);
00414     EXPECT(counters.err_calls == 0);
00415     /* check ooseq queue: unchanged */
00416     EXPECT_OOSEQ(tcp_oos_count(pcb) == 1);
00417     EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 15);
00418     EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1);
00419 
00420     /* pass the segment to tcp_input */
00421     test_tcp_input(pinseqFIN, &netif);
00422     /* check if counters are as expected */
00423     EXPECT(counters.close_calls == 1);
00424     EXPECT(counters.recv_calls == 2);
00425     EXPECT(counters.recved_bytes == data_len);
00426     EXPECT(counters.err_calls == 0);
00427     EXPECT(pcb->ooseq == NULL);
00428   }
00429 
00430   /* make sure the pcb is freed */
00431   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 1);
00432   tcp_abort(pcb);
00433   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 0);
00434 }
00435 END_TEST
00436 
00437 static char data_full_wnd[TCP_WND];
00438 
00441 START_TEST(test_tcp_recv_ooseq_overrun_rxwin)
00442 {
00443   int i, k;
00444   struct test_tcp_counters counters;
00445   struct tcp_pcb* pcb;
00446   struct pbuf *pinseq, *p_ovr;
00447   ip_addr_t remote_ip, local_ip;
00448   u16_t remote_port = 0x100, local_port = 0x101;
00449   struct netif netif;
00450   int datalen = 0;
00451   int datalen2;
00452   LWIP_UNUSED_ARG(_i);
00453 
00454   for(i = 0; i < sizeof(data_full_wnd); i++) {
00455     data_full_wnd[i] = (char)i;
00456   }
00457 
00458   /* initialize local vars */
00459   memset(&netif, 0, sizeof(netif));
00460   IP4_ADDR(&local_ip, 192, 168, 1, 1);
00461   IP4_ADDR(&remote_ip, 192, 168, 1, 2);
00462   /* initialize counter struct */
00463   memset(&counters, 0, sizeof(counters));
00464   counters.expected_data_len = TCP_WND;
00465   counters.expected_data = data_full_wnd;
00466 
00467   /* create and initialize the pcb */
00468   pcb = test_tcp_new_counters_pcb(&counters);
00469   EXPECT_RET(pcb != NULL);
00470   tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port);
00471   pcb->rcv_nxt = 0x8000;
00472 
00473   /* create segments */
00474   /* pinseq is sent as last segment! */
00475   pinseq = tcp_create_rx_segment(pcb, &data_full_wnd[0],  TCP_MSS, 0, 0, TCP_ACK);
00476 
00477   for(i = TCP_MSS, k = 0; i < TCP_WND; i += TCP_MSS, k++) {
00478     int count, expected_datalen;
00479     struct pbuf *p = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)],
00480                                            TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK);
00481     EXPECT(p != NULL);
00482     /* pass the segment to tcp_input */
00483     test_tcp_input(p, &netif);
00484     /* check if counters are as expected */
00485     EXPECT(counters.close_calls == 0);
00486     EXPECT(counters.recv_calls == 0);
00487     EXPECT(counters.recved_bytes == 0);
00488     EXPECT(counters.err_calls == 0);
00489     /* check ooseq queue */
00490     count = tcp_oos_count(pcb);
00491     EXPECT_OOSEQ(count == k+1);
00492     datalen = tcp_oos_tcplen(pcb);
00493     if (i + TCP_MSS < TCP_WND) {
00494       expected_datalen = (k+1)*TCP_MSS;
00495     } else {
00496       expected_datalen = TCP_WND - TCP_MSS;
00497     }
00498     if (datalen != expected_datalen) {
00499       EXPECT_OOSEQ(datalen == expected_datalen);
00500     }
00501   }
00502 
00503   /* pass in one more segment, cleary overrunning the rxwin */
00504   p_ovr = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)], TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK);
00505   EXPECT(p_ovr != NULL);
00506   /* pass the segment to tcp_input */
00507   test_tcp_input(p_ovr, &netif);
00508   /* check if counters are as expected */
00509   EXPECT(counters.close_calls == 0);
00510   EXPECT(counters.recv_calls == 0);
00511   EXPECT(counters.recved_bytes == 0);
00512   EXPECT(counters.err_calls == 0);
00513   /* check ooseq queue */
00514   EXPECT_OOSEQ(tcp_oos_count(pcb) == k);
00515   datalen2 = tcp_oos_tcplen(pcb);
00516   EXPECT_OOSEQ(datalen == datalen2);
00517 
00518   /* now pass inseq */
00519   test_tcp_input(pinseq, &netif);
00520   EXPECT(pcb->ooseq == NULL);
00521 
00522   /* make sure the pcb is freed */
00523   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 1);
00524   tcp_abort(pcb);
00525   EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 0);
00526 }
00527 END_TEST
00528 
00529 
00531 Suite *
00532 tcp_oos_suite(void)
00533 {
00534   TFun tests[] = {
00535     test_tcp_recv_ooseq_FIN_OOSEQ,
00536     test_tcp_recv_ooseq_FIN_INSEQ,
00537     test_tcp_recv_ooseq_overrun_rxwin,
00538   };
00539   return create_suite("TCP_OOS", tests, sizeof(tests)/sizeof(TFun), tcp_oos_setup, tcp_oos_teardown);
00540 }

Generated on Sat May 26 2012 04:35:02 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.