lwIP
2.1.0
Lightweight IP stack
|
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/tcp.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/debug.h"
#include "lwip/stats.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/nd6.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
Functions | |
void | tcp_init (void) |
void | tcp_free (struct tcp_pcb *pcb) |
void | tcp_tmr (void) |
void | tcp_backlog_delayed (struct tcp_pcb *pcb) |
void | tcp_backlog_accepted (struct tcp_pcb *pcb) |
err_t | tcp_close (struct tcp_pcb *pcb) |
err_t | tcp_shutdown (struct tcp_pcb *pcb, int shut_rx, int shut_tx) |
void | tcp_abandon (struct tcp_pcb *pcb, int reset) |
void | tcp_abort (struct tcp_pcb *pcb) |
err_t | tcp_bind (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) |
void | tcp_bind_netif (struct tcp_pcb *pcb, const struct netif *netif) |
struct tcp_pcb * | tcp_listen_with_backlog (struct tcp_pcb *pcb, u8_t backlog) |
struct tcp_pcb * | tcp_listen_with_backlog_and_err (struct tcp_pcb *pcb, u8_t backlog, err_t *err) |
u32_t | tcp_update_rcv_ann_wnd (struct tcp_pcb *pcb) |
void | tcp_recved (struct tcp_pcb *pcb, u16_t len) |
err_t | tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port, tcp_connected_fn connected) |
void | tcp_slowtmr (void) |
void | tcp_fasttmr (void) |
void | tcp_txnow (void) |
err_t | tcp_process_refused_data (struct tcp_pcb *pcb) |
void | tcp_segs_free (struct tcp_seg *seg) |
void | tcp_seg_free (struct tcp_seg *seg) |
void | tcp_setprio (struct tcp_pcb *pcb, u8_t prio) |
struct tcp_seg * | tcp_seg_copy (struct tcp_seg *seg) |
err_t | tcp_recv_null (void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) |
struct tcp_pcb * | tcp_alloc (u8_t prio) |
struct tcp_pcb * | tcp_new (void) |
struct tcp_pcb * | tcp_new_ip_type (u8_t type) |
void | tcp_arg (struct tcp_pcb *pcb, void *arg) |
void | tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv) |
void | tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent) |
void | tcp_err (struct tcp_pcb *pcb, tcp_err_fn err) |
void | tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept) |
void | tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval) |
void | tcp_pcb_purge (struct tcp_pcb *pcb) |
void | tcp_pcb_remove (struct tcp_pcb **pcblist, struct tcp_pcb *pcb) |
u32_t | tcp_next_iss (struct tcp_pcb *pcb) |
u16_t | tcp_eff_send_mss_netif (u16_t sendmss, struct netif *outif, const ip_addr_t *dest) |
void | tcp_netif_ip_addr_changed (const ip_addr_t *old_addr, const ip_addr_t *new_addr) |
u8_t | tcp_ext_arg_alloc_id (void) |
void | tcp_ext_arg_set_callbacks (struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_arg_callbacks *const callbacks) |
void | tcp_ext_arg_set (struct tcp_pcb *pcb, uint8_t id, void *arg) |
void * | tcp_ext_arg_get (const struct tcp_pcb *pcb, uint8_t id) |
err_t | tcp_ext_arg_invoke_callbacks_passive_open (struct tcp_pcb_listen *lpcb, struct tcp_pcb *cpcb) |
Variables | |
struct tcp_pcb * | tcp_bound_pcbs |
union tcp_listen_pcbs_t | tcp_listen_pcbs |
struct tcp_pcb * | tcp_active_pcbs |
struct tcp_pcb * | tcp_tw_pcbs |
struct tcp_pcb **const | tcp_pcb_lists [] |
Transmission Control Protocol for IP See also TCP
void tcp_abandon | ( | struct tcp_pcb * | pcb, |
int | reset | ||
) |
Abandons a connection and optionally sends a RST to the remote host. Deletes the local protocol control block. This is done when a connection is killed because of shortage of memory.
pcb | the tcp_pcb to abort |
reset | boolean to indicate whether a reset should be sent |
struct tcp_pcb* tcp_alloc | ( | u8_t | prio | ) |
Calculates the effective send mss that can be used for a specific IP address by calculating the minimum of TCP_MSS and the mtu (if set) of the target netif (if not NULL).
err_t tcp_ext_arg_invoke_callbacks_passive_open | ( | struct tcp_pcb_listen * | lpcb, |
struct tcp_pcb * | cpcb | ||
) |
This function calls the "passive_open" callback for all ext_args if a connection is in the process of being accepted. This is called just after the SYN is received and before a SYN/ACK is sent, to allow to modify the very first segment sent even on passive open. Naturally, the "accepted" callback of the pcb has not been called yet!
void tcp_fasttmr | ( | void | ) |
Is called every TCP_FAST_INTERVAL (250 ms) and process data previously "refused" by upper layer (application) and sends delayed ACKs or pending FINs.
Automatically called from tcp_tmr().
void tcp_free | ( | struct tcp_pcb * | pcb | ) |
Free a tcp pcb
void tcp_init | ( | void | ) |
Initialize this module.
This function is called from netif.c when address is changed or netif is removed
old_addr | IP address of the netif before change |
new_addr | IP address of the netif after change or NULL if netif has been removed |
u32_t tcp_next_iss | ( | struct tcp_pcb * | pcb | ) |
Calculates a new initial sequence number for new connections.
void tcp_pcb_purge | ( | struct tcp_pcb * | pcb | ) |
Purges a TCP PCB. Removes any buffered data and frees the buffer memory (pcb->ooseq, pcb->unsent and pcb->unacked are freed).
pcb | tcp_pcb to purge. The pcb itself is not deallocated! |
Purges the PCB and removes it from a PCB list. Any delayed ACKs are sent first.
pcblist | PCB list to purge. |
pcb | tcp_pcb to purge. The pcb itself is NOT deallocated! |
Default receive callback that is called if the user didn't register a recv callback for the pcb.
struct tcp_seg* tcp_seg_copy | ( | struct tcp_seg * | seg | ) |
Returns a copy of the given TCP segment. The pbuf and data are not copied, only the pointers
seg | the old tcp_seg |
void tcp_seg_free | ( | struct tcp_seg * | seg | ) |
Frees a TCP segment (tcp_seg structure).
seg | single tcp_seg to free |
void tcp_segs_free | ( | struct tcp_seg * | seg | ) |
Deallocates a list of TCP segments (tcp_seg structures).
seg | tcp_seg list of TCP segments to free |
void tcp_setprio | ( | struct tcp_pcb * | pcb, |
u8_t | prio | ||
) |
Sets the priority of a connection.
pcb | the tcp_pcb to manipulate |
prio | new priority |
void tcp_slowtmr | ( | void | ) |
Called every 500 ms and implements the retransmission timer and the timer that removes PCBs that have been in TIME-WAIT for enough time. It also increments various timers such as the inactivity timer in each PCB.
Automatically called from tcp_tmr().
void tcp_tmr | ( | void | ) |
Called periodically to dispatch TCP timers.
void tcp_txnow | ( | void | ) |
Call tcp_output for all active pcbs that have TF_NAGLEMEMERR set
u32_t tcp_update_rcv_ann_wnd | ( | struct tcp_pcb * | pcb | ) |
Update the state that tracks the available window space to advertise.
Returns how much extra window would be advertised if we sent an update now.
struct tcp_pcb* tcp_active_pcbs |
List of all TCP PCBs that are in a state in which they accept or send data.
struct tcp_pcb* tcp_bound_pcbs |
List of all TCP PCBs bound but not yet (connected || listening)
union tcp_listen_pcbs_t tcp_listen_pcbs |
List of all TCP PCBs in LISTEN state
struct tcp_pcb** const tcp_pcb_lists[] |
An array with all (non-temporary) PCB lists, mainly used for smaller code size
struct tcp_pcb* tcp_tw_pcbs |
List of all TCP PCBs in TIME-WAIT state