#include "lwip/sys.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/opt.h"
#include "lwip/ip.h"
#include "lwip/icmp.h"
#include "lwip/err.h"
Include dependency graph for tcp.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | tcp_hdr |
struct | tcp_pcb |
struct | tcp_pcb_listen |
struct | tcp_seg |
Defines | |
#define | tcp_mss(pcb) ((pcb)->mss) |
#define | tcp_sndbuf(pcb) ((pcb)->snd_buf) |
#define | TCP_PRIO_MIN 1 |
#define | TCP_PRIO_NORMAL 64 |
#define | TCP_PRIO_MAX 127 |
#define | TCP_SEQ_LT(a, b) ((s32_t)((a)-(b)) < 0) |
#define | TCP_SEQ_LEQ(a, b) ((s32_t)((a)-(b)) <= 0) |
#define | TCP_SEQ_GT(a, b) ((s32_t)((a)-(b)) > 0) |
#define | TCP_SEQ_GEQ(a, b) ((s32_t)((a)-(b)) >= 0) |
#define | TCP_FIN 0x01 |
#define | TCP_SYN 0x02 |
#define | TCP_RST 0x04 |
#define | TCP_PSH 0x08 |
#define | TCP_ACK 0x10 |
#define | TCP_URG 0x20 |
#define | TCP_FLAGS 0x3f |
#define | TCP_HLEN 20 |
#define | TCP_TMR_INTERVAL 100 |
#define | TCP_FAST_INTERVAL 200 |
#define | TCP_SLOW_INTERVAL 500 |
#define | TCP_FIN_WAIT_TIMEOUT 20000 |
#define | TCP_SYN_RCVD_TIMEOUT 20000 |
#define | TCP_OOSEQ_TIMEOUT 6 |
#define | TCP_MSL 60000 |
#define | TCPH_OFFSET(hdr) (ntohs((hdr)->_offset_flags) >> 8) |
#define | TCPH_FLAGS(hdr) (ntohs((hdr)->_offset_flags) & 0xff) |
#define | TCPH_OFFSET_SET(hdr, offset) (hdr)->_offset_flags = htons(((offset) << 8) | TCPH_FLAGS(hdr)) |
#define | TCPH_FLAGS_SET(hdr, flags) (hdr)->_offset_flags = htons((TCPH_OFFSET(hdr) << 8) | (flags)) |
#define | TCP_TCPLEN(seg) |
#define | TF_ACK_DELAY 0x01U |
#define | TF_ACK_NOW 0x02U |
#define | TF_INFR 0x04U |
#define | TF_RESET 0x08U |
#define | TF_CLOSED 0x10U |
#define | TF_GOT_FIN 0x20U |
#define | TCP_EVENT_ACCEPT(pcb, err, ret) |
#define | TCP_EVENT_SENT(pcb, space, ret) |
#define | TCP_EVENT_RECV(pcb, p, err, ret) |
#define | TCP_EVENT_CONNECTED(pcb, err, ret) |
#define | TCP_EVENT_POLL(pcb, ret) |
#define | TCP_EVENT_ERR(errf, arg, err) |
#define | tcp_ack(pcb) |
#define | tcp_ack_now(pcb) |
#define | tcp_pcbs_sane() 1 |
#define | TCP_REG(pcbs, npcb) |
#define | TCP_RMV(pcbs, npcb) |
Enumerations | |
enum | tcp_state { CLOSED = 0, LISTEN = 1, SYN_SENT = 2, SYN_RCVD = 3, ESTABLISHED = 4, FIN_WAIT_1 = 5, FIN_WAIT_2 = 6, CLOSE_WAIT = 7, CLOSING = 8, LAST_ACK = 9, TIME_WAIT = 10 } |
Functions | |
void | tcp_init (void) |
void | tcp_tmr (void) |
tcp_pcb * | tcp_new (void) |
tcp_pcb * | tcp_alloc (u8_t prio) |
void | tcp_arg (struct tcp_pcb *pcb, void *arg) |
void | tcp_accept (struct tcp_pcb *pcb, err_t(*accept)(void *arg, struct tcp_pcb *newpcb, err_t err)) |
void | tcp_recv (struct tcp_pcb *pcb, err_t(*recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)) |
void | tcp_sent (struct tcp_pcb *pcb, err_t(*sent)(void *arg, struct tcp_pcb *tpcb, u16_t len)) |
void | tcp_poll (struct tcp_pcb *pcb, err_t(*poll)(void *arg, struct tcp_pcb *tpcb), u8_t interval) |
void | tcp_err (struct tcp_pcb *pcb, void(*err)(void *arg, err_t err)) |
void | tcp_recved (struct tcp_pcb *pcb, u16_t len) |
err_t | tcp_bind (struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) |
err_t | tcp_connect (struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port, err_t(*connected)(void *arg, struct tcp_pcb *tpcb, err_t err)) |
tcp_pcb * | tcp_listen (struct tcp_pcb *pcb) |
void | tcp_abort (struct tcp_pcb *pcb) |
err_t | tcp_close (struct tcp_pcb *pcb) |
err_t | tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len, u8_t copy) |
void | tcp_setprio (struct tcp_pcb *pcb, u8_t prio) |
void | tcp_slowtmr (void) |
void | tcp_fasttmr (void) |
void | tcp_input (struct pbuf *p, struct netif *inp) |
err_t | tcp_output (struct tcp_pcb *pcb) |
void | tcp_rexmit (struct tcp_pcb *pcb) |
tcp_pcb * | tcp_pcb_copy (struct tcp_pcb *pcb) |
void | tcp_pcb_purge (struct tcp_pcb *pcb) |
void | tcp_pcb_remove (struct tcp_pcb **pcblist, struct tcp_pcb *pcb) |
u8_t | tcp_segs_free (struct tcp_seg *seg) |
u8_t | tcp_seg_free (struct tcp_seg *seg) |
tcp_seg * | tcp_seg_copy (struct tcp_seg *seg) |
err_t | tcp_send_ctrl (struct tcp_pcb *pcb, u8_t flags) |
err_t | tcp_enqueue (struct tcp_pcb *pcb, void *dataptr, u16_t len, u8_t flags, u8_t copy, u8_t *optdata, u8_t optlen) |
void | tcp_rexmit_seg (struct tcp_pcb *pcb, struct tcp_seg *seg) |
void | tcp_rst (u32_t seqno, u32_t ackno, struct ip_addr *local_ip, struct ip_addr *remote_ip, u16_t local_port, u16_t remote_port) |
u32_t | tcp_next_iss (void) |
void | tcp_timer_needed (void) |
Variables | |
PACK_STRUCT_BEGIN struct tcp_hdr | PACK_STRUCT_STRUCT |
tcp_pcb * | tcp_input_pcb |
u32_t | tcp_ticks |
tcp_pcb_listen * | tcp_listen_pcbs |
tcp_pcb * | tcp_active_pcbs |
tcp_pcb * | tcp_tw_pcbs |
tcp_pcb * | tcp_tmp_pcb |
|
Value: if((pcb)->flags & TF_ACK_DELAY) { \ (pcb)->flags &= ~TF_ACK_DELAY; \ (pcb)->flags |= TF_ACK_NOW; \ tcp_output(pcb); \ } else { \ (pcb)->flags |= TF_ACK_DELAY; \ } |
|
|
|
Value: (pcb)->flags |= TF_ACK_NOW; \ tcp_output(pcb) |
|
Value: if((pcb)->accept != NULL) \ (ret = (pcb)->accept((pcb)->callback_arg,(pcb),(err))) |
|
Value: if((pcb)->connected != NULL) \ (ret = (pcb)->connected((pcb)->callback_arg,(pcb),(err))) |
|
Value: if((errf) != NULL) \ (errf)((arg),(err)) |
|
Value: if((pcb)->poll != NULL) \ (ret = (pcb)->poll((pcb)->callback_arg,(pcb))) |
|
Value: |
|
Value: if((pcb)->sent != NULL) \ (ret = (pcb)->sent((pcb)->callback_arg,(pcb),(space))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: do { \ npcb->next = *pcbs; \ *(pcbs) = npcb; \ tcp_timer_needed(); \ } while(0) |
|
Value: do { \ if(*(pcbs) == npcb) { \ (*(pcbs)) = (*pcbs)->next; \ } else for(tcp_tmp_pcb = *pcbs; tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \ if(tcp_tmp_pcb->next != NULL && tcp_tmp_pcb->next == npcb) { \ tcp_tmp_pcb->next = npcb->next; \ break; \ } \ } \ npcb->next = NULL; \ } while(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 78 of file tcp.h. Referenced by do_write(), netconn_write(), and send_data(). |
|
|
|
|
|
Value: ((seg)->len + ((TCPH_FLAGS((seg)->tcphdr) & TCP_FIN || \ TCPH_FLAGS((seg)->tcphdr) & TCP_SYN)? 1: 0)) |
|
Definition at line 131 of file tcp.h. Referenced by tcpip_thread(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 180 of file tcp.h.
00180 { 00181 CLOSED = 0, 00182 LISTEN = 1, 00183 SYN_SENT = 2, 00184 SYN_RCVD = 3, 00185 ESTABLISHED = 4, 00186 FIN_WAIT_1 = 5, 00187 FIN_WAIT_2 = 6, 00188 CLOSE_WAIT = 7, 00189 CLOSING = 8, 00190 LAST_ACK = 9, 00191 TIME_WAIT = 10 00192 }; |
|
Referenced by do_delconn(). |
|
Referenced by do_delconn(), do_listen(), and httpd_init(). |
|
|
|
Referenced by close_conn(), do_delconn(), do_listen(), and http_accept(). |
|
Referenced by do_bind(), and httpd_init(). |
|
Referenced by close_conn(), do_close(), do_delconn(), and http_poll(). |
|
Referenced by do_connect(). |
|
|
|
Referenced by do_delconn(), and http_accept(). |
|
|
|
Referenced by tcpip_thread(). |
|
Referenced by ip_input(). |
|
Referenced by do_listen(), and httpd_init(). |
|
Referenced by do_bind(), do_connect(), and httpd_init(). |
|
|
|
Referenced by do_write(). |
|
|
|
|
|
|
|
Referenced by do_delconn(), and http_accept(). |
|
Referenced by close_conn(), do_delconn(), and http_accept(). |
|
Referenced by do_recv(), and http_recv(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by close_conn(), do_delconn(), and http_recv(). |
|
|
|
|
|
|
|
|
|
Referenced by do_write(), and send_data(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|