ReactOS 0.4.16-dev-297-gc569aee
tcp_helper.h
Go to the documentation of this file.
1#ifndef LWIP_HDR_TCP_HELPER_H
2#define LWIP_HDR_TCP_HELPER_H
3
4#include "../lwip_check.h"
5#include "lwip/arch.h"
6#include "lwip/tcp.h"
7#include "lwip/netif.h"
8
9/* counters used for test_tcp_counters_* callback functions */
20};
21
27};
28
29extern const ip_addr_t test_local_ip;
30extern const ip_addr_t test_remote_ip;
31extern const ip_addr_t test_netmask;
32#define TEST_REMOTE_PORT 0x100
33#define TEST_LOCAL_PORT 0x101
34
35/* Helper functions */
36void tcp_remove_all(void);
37
38struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip,
39 u16_t src_port, u16_t dst_port, void* data, size_t data_len,
40 u32_t seqno, u32_t ackno, u8_t headerflags);
41struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len,
42 u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags);
43struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len,
44 u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd);
45void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, const ip_addr_t* local_ip,
46 const ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port);
48err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err);
49
51
52void test_tcp_input(struct pbuf *p, struct netif *inp);
53
54void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters,
55 const ip_addr_t *ip_addr, const ip_addr_t *netmask);
56
57
58#endif
static int state
Definition: maze.c:121
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLuint * counters
Definition: glext.h:11114
GLfloat GLfloat p
Definition: glext.h:8902
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
s8_t err_t
Definition: err.h:96
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
#define err(...)
Definition: netif.h:269
Definition: pbuf.h:186
u32_t expected_data_len
Definition: tcp_helper.h:19
char * expected_data
Definition: tcp_helper.h:18
u32_t recved_bytes_after_close
Definition: tcp_helper.h:14
u32_t recv_calls_after_close
Definition: tcp_helper.h:13
struct pbuf * tx_packets
Definition: tcp_helper.h:26
void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, const ip_addr_t *ip_addr, const ip_addr_t *netmask)
Definition: tcp_helper.c:305
void test_tcp_input(struct pbuf *p, struct netif *inp)
Definition: tcp_helper.c:259
void test_tcp_counters_err(void *arg, err_t err)
Definition: tcp_helper.c:188
struct pbuf * tcp_create_rx_segment_wnd(struct tcp_pcb *pcb, void *data, size_t data_len, u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd)
Definition: tcp_helper.c:142
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)
Definition: tcp_helper.c:130
struct tcp_pcb * test_tcp_new_counters_pcb(struct test_tcp_counters *counters)
Definition: tcp_helper.c:244
err_t test_tcp_counters_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
Definition: tcp_helper.c:218
void tcp_set_state(struct tcp_pcb *pcb, enum tcp_state state, const ip_addr_t *local_ip, const ip_addr_t *remote_ip, u16_t local_port, u16_t remote_port)
Definition: tcp_helper.c:151
const ip_addr_t test_netmask
Definition: tcp_helper.c:16
void tcp_remove_all(void)
Definition: tcp_helper.c:38
const ip_addr_t test_local_ip
Definition: tcp_helper.c:14
const ip_addr_t test_remote_ip
Definition: tcp_helper.c:15
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)
Definition: tcp_helper.c:117