9#pragma warning(disable: 4307)
12#if !LWIP_STATS || !TCP_STATS || !MEMP_STATS
13#error "This tests needs TCP- and MEMP-statistics enabled"
19#define SEQNO1 (0xFFFFFF00 - TCP_MSS)
47static struct tcp_pcb_listen *
51 struct tcp_pcb_listen *lpcb=
NULL;
65 lpcb = (
struct tcp_pcb_listen *)tcp_listen(pcb);
78 struct tcp_pcb dummy_pcb;
82 tcp_ticks = 0 - (tcp_next_iss(&dummy_pcb) - 6510);
83 tcp_next_iss(&dummy_pcb);
182 pcb_list[
i] = tcp_new();
194 tcp_abort(pcb_list[
i]);
223 EXPECT(pcb->state == SYN_SENT);
235 EXPECT(seqno == pcb->lastack);
255 struct tcp_pcb *pcb, *pcbl;
269 pcbl = tcp_listen(pcb);
323 for (
i = 0;
i < 2 * TCP_MSL / TCP_TMR_INTERVAL + 1;
i++) {
366 for (
i = 0;
i < 2 * TCP_MSL / TCP_TMR_INTERVAL + 1;
i++) {
397 struct tcp_pcb_listen *lpcb;
443 EXPECT(pcb->state == TIME_WAIT);
465 pcb->local_port,
NULL, 0, 12345, pcb->snd_nxt-10,
TCP_RST);
472 pcb->local_port,
NULL, 0, 12345, pcb->snd_nxt,
TCP_RST);
487 pcb->local_port,
NULL, 0, pcb->rcv_nxt-10, 54321,
TCP_RST);
494 pcb->local_port,
NULL, 0, pcb->rcv_nxt, 54321,
TCP_RST);
548 pcb->local_port,
NULL, 0, 12345, pcb->lastack,
TCP_ACK);
561 struct tcp_pcb_listen *lpcb;
580 ack_seqno = tcp_active_pcbs[0].lastack;
585 lpcb->local_port,
NULL, 0, 1001, ack_seqno+1111,
TCP_ACK);
603 struct tcp_pcb_listen *lpcb;
651 TESTFUNC(test_tcp_new_max_num_remove_TIME_WAIT),
652 TESTFUNC(test_tcp_connect_active_open),
654 TESTFUNC(test_tcp_imultaneous_close),
655 TESTFUNC(test_tcp_gen_rst_in_CLOSED),
656 TESTFUNC(test_tcp_gen_rst_in_LISTEN),
657 TESTFUNC(test_tcp_gen_rst_in_TIME_WAIT),
658 TESTFUNC(test_tcp_process_rst_seqno),
659 TESTFUNC(test_tcp_gen_rst_in_SYN_SENT_ackseq),
660 TESTFUNC(test_tcp_gen_rst_in_SYN_SENT_non_syn_ack),
661 TESTFUNC(test_tcp_gen_rst_in_SYN_RCVD),
662 TESTFUNC(test_tcp_receive_rst_SYN_RCVD_to_LISTEN),
RD_BOOL tcp_connect(char *server)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLuint * counters
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define LWIP_UNUSED_ARG(x)
u8_t pbuf_free(struct pbuf *p)
u16_t pbuf_copy_partial(const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
Suite * create_suite(const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
#define EXPECT_RETX(x, y)
void lwip_check_ensure_no_alloc(unsigned int skip)
static struct test_info tests[]
static void test_port(IHTMLLocation *loc, const struct location_test *test)
struct netif * netif_list
struct netif * netif_default
#define MEMP_STATS_GET(x, i)
void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, const ip_addr_t *ip_addr, const ip_addr_t *netmask)
void test_tcp_input(struct pbuf *p, struct netif *inp)
struct pbuf * tcp_create_rx_segment(struct tcp_pcb *pcb, void *data, size_t data_len, u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags)
struct tcp_pcb * test_tcp_new_counters_pcb(struct test_tcp_counters *counters)
void tcp_remove_all(void)
const ip_addr_t test_local_ip
const ip_addr_t test_remote_ip
struct pbuf * tcp_create_segment(ip_addr_t *src_ip, ip_addr_t *dst_ip, u16_t src_port, u16_t dst_port, void *data, size_t data_len, u32_t seqno, u32_t ackno, u8_t headerflags)
void tcp_close(struct sock *sk, long timeout)
static __inline void tcp_set_state(struct sock *sk, int state)
static ip4_addr_t test_netmask
static void tcp_state_teardown(void)
static void tcp_state_setup(void)
static struct netif test_netif
static u8_t get_tcp_flags_from_packet(struct pbuf *p, u16_t tcp_hdr_offset)
static struct netif * old_netif_list
END_TEST Suite * tcp_state_suite(void)
static struct netif * old_netif_default
static void test_tcp_tmr(void)
static struct tcp_pcb_listen * create_listening_pcb(u16_t local_port, struct test_tcp_counters *counters)
static u8_t test_tcp_timer
static struct test_tcp_txcounters test_txcounters
static void test_rst_generation_with_incoming_packet(struct pbuf *p, struct netif *netif, struct test_tcp_txcounters *tx_counters)