STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
Data Structures | Functions
tcp_helper.h File Reference
#include "../lwip_check.h"
#include "lwip/arch.h"
#include "lwip/tcp.h"
#include "lwip/netif.h"

Go to the source code of this file.

Data Structures

struct  test_tcp_counters
 
struct  test_tcp_txcounters
 

Functions

void tcp_remove_all (void)
 
struct pbuftcp_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)
 
struct pbuftcp_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 pbuftcp_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)
 
void tcp_set_state (struct tcp_pcb *pcb, enum tcp_state state, ip_addr_t *local_ip, ip_addr_t *remote_ip, u16_t local_port, u16_t remote_port)
 
void test_tcp_counters_err (void *arg, err_t err)
 
err_t test_tcp_counters_recv (void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
 
struct tcp_pcb * test_tcp_new_counters_pcb (struct test_tcp_counters *counters)
 
void test_tcp_input (struct pbuf *p, struct netif *inp)
 
void test_tcp_init_netif (struct netif *netif, struct test_tcp_txcounters *txcounters, ip_addr_t *ip_addr, ip_addr_t *netmask)
 

Function Documentation

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 
)

Create a TCP segment usable for passing to tcp_input

  • IP-addresses, ports, seqno and ackno are taken from pcb
  • seqno and ackno can be altered with an offset

Definition at line 120 of file tcp_helper.c.

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 
)

Create a TCP segment usable for passing to tcp_input

  • IP-addresses, ports, seqno and ackno are taken from pcb
  • seqno and ackno can be altered with an offset
  • TCP window can be adjusted

Definition at line 132 of file tcp_helper.c.

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 
)

Create a TCP segment usable for passing to tcp_input

Definition at line 107 of file tcp_helper.c.

void tcp_remove_all ( void  )

Remove all pcbs on listen-, active- and time-wait-list (bound- isn't exported).

Definition at line 29 of file tcp_helper.c.

void tcp_set_state ( struct tcp_pcb *  pcb,
enum tcp_state  state,
ip_addr_t local_ip,
ip_addr_t remote_ip,
u16_t  local_port,
u16_t  remote_port 
)

Safely bring a tcp_pcb into the requested state

Definition at line 141 of file tcp_helper.c.

void test_tcp_counters_err ( void *  arg,
err_t  err 
)

Definition at line 169 of file tcp_helper.c.

err_t test_tcp_counters_recv ( void *  arg,
struct tcp_pcb *  pcb,
struct pbuf p,
err_t  err 
)

Definition at line 199 of file tcp_helper.c.

void test_tcp_init_netif ( struct netif netif,
struct test_tcp_txcounters txcounters,
ip_addr_t ip_addr,
ip_addr_t netmask 
)

Definition at line 285 of file tcp_helper.c.

void test_tcp_input ( struct pbuf p,
struct netif inp 
)

Calls tcp_input() after adjusting current_iphdr_dest

Definition at line 240 of file tcp_helper.c.

struct tcp_pcb* test_tcp_new_counters_pcb ( struct test_tcp_counters counters)

Allocate a pcb and set up the test_tcp_counters_* callbacks

Definition at line 225 of file tcp_helper.c.