ReactOS 0.4.17-dev-573-g8315b8c
tcp_priv.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 *
32 * This file is part of the lwIP TCP/IP stack.
33 *
34 * Author: Adam Dunkels <adam@sics.se>
35 *
36 */
37#ifndef LWIP_HDR_TCP_PRIV_H
38#define LWIP_HDR_TCP_PRIV_H
39
40#include "lwip/opt.h"
41
42#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
43
44#include "lwip/tcp.h"
45#include "lwip/mem.h"
46#include "lwip/pbuf.h"
47#include "lwip/ip.h"
48#include "lwip/icmp.h"
49#include "lwip/err.h"
50#include "lwip/ip6.h"
51#include "lwip/ip6_addr.h"
52#include "lwip/prot/tcp.h"
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58/* Functions for interfacing with TCP: */
59
60/* Lower layer interface to TCP: */
61void tcp_init (void); /* Initialize this module. */
62void tcp_tmr (void); /* Must be called every
63 TCP_TMR_INTERVAL
64 ms. (Typically 250 ms). */
65/* It is also possible to call these two functions at the right
66 intervals (instead of calling tcp_tmr()). */
67void tcp_slowtmr (void);
68void tcp_fasttmr (void);
69
70/* Call this from a netif driver (watch out for threading issues!) that has
71 returned a memory error on transmit and now has free buffers to send more.
72 This iterates all active pcbs that had an error and tries to call
73 tcp_output, so use this with care as it might slow down the system. */
74void tcp_txnow (void);
75
76/* Only used by IP to pass a TCP segment to TCP: */
77void tcp_input (struct pbuf *p, struct netif *inp);
78/* Used within the TCP code only: */
79struct tcp_pcb * tcp_alloc (u8_t prio);
80void tcp_free (struct tcp_pcb *pcb);
81void tcp_abandon (struct tcp_pcb *pcb, int reset);
82err_t tcp_send_empty_ack(struct tcp_pcb *pcb);
83err_t tcp_rexmit (struct tcp_pcb *pcb);
84err_t tcp_rexmit_rto_prepare(struct tcp_pcb *pcb);
85void tcp_rexmit_rto_commit(struct tcp_pcb *pcb);
86void tcp_rexmit_rto (struct tcp_pcb *pcb);
87void tcp_rexmit_fast (struct tcp_pcb *pcb);
88u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb);
89err_t tcp_process_refused_data(struct tcp_pcb *pcb);
90
100#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
101 ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \
102 (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \
103 ((tpcb)->unsent->len >= (tpcb)->mss))) || \
104 ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \
105 ) ? 1 : 0)
106#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK)
107
108
109#define TCP_SEQ_LT(a,b) (((u32_t)((u32_t)(a) - (u32_t)(b)) & 0x80000000u) != 0)
110#define TCP_SEQ_LEQ(a,b) (!(TCP_SEQ_LT(b,a)))
111#define TCP_SEQ_GT(a,b) TCP_SEQ_LT(b,a)
112#define TCP_SEQ_GEQ(a,b) TCP_SEQ_LEQ(b,a)
113/* is b<=a<=c? */
114#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))
115
116#ifndef TCP_TMR_INTERVAL
117#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */
118#endif /* TCP_TMR_INTERVAL */
119
120#ifndef TCP_FAST_INTERVAL
121#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */
122#endif /* TCP_FAST_INTERVAL */
123
124#ifndef TCP_SLOW_INTERVAL
125#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */
126#endif /* TCP_SLOW_INTERVAL */
127
128#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */
129#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */
130
131#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */
132
133#ifndef TCP_MSL
134#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */
135#endif
136
137/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */
138#ifndef TCP_KEEPIDLE_DEFAULT
139#define TCP_KEEPIDLE_DEFAULT 7200000UL /* Default KEEPALIVE timer in milliseconds */
140#endif
141
142#ifndef TCP_KEEPINTVL_DEFAULT
143#ifdef __REACTOS__
144/* According to https://learn.microsoft.com/en-us/windows/win32/winsock/sio-keepalive-vals, default keep alive interval is 1 second */
145#define TCP_KEEPINTVL_DEFAULT 1000UL /* Default Time between KEEPALIVE probes in milliseconds */
146#else
147#define TCP_KEEPINTVL_DEFAULT 75000UL /* Default Time between KEEPALIVE probes in milliseconds */
148#endif
149#endif
150
151#ifndef TCP_KEEPCNT_DEFAULT
152#ifdef __REACTOS__
153/* According to https://learn.microsoft.com/en-us/windows/win32/winsock/sio-keepalive-vals, default probe count is 10 for vista+ */
154#define TCP_KEEPCNT_DEFAULT 10U /* Default Counter for KEEPALIVE probes */
155#else
156#define TCP_KEEPCNT_DEFAULT 9U /* Default Counter for KEEPALIVE probes */
157#endif
158#endif
159
160#define TCP_MAXIDLE TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */
161
162#define TCP_TCPLEN(seg) ((seg)->len + (((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0) ? 1U : 0U))
163
166#define TF_RESET (u8_t)0x08U /* Connection was reset. */
167#define TF_CLOSED (u8_t)0x10U /* Connection was successfully closed. */
168#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */
169
170
171#if LWIP_EVENT_API
172
173#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) ret = lwip_tcp_event(arg, (pcb),\
174 LWIP_EVENT_ACCEPT, NULL, 0, err)
175#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
176 LWIP_EVENT_SENT, NULL, space, ERR_OK)
177#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
178 LWIP_EVENT_RECV, (p), 0, (err))
179#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
180 LWIP_EVENT_RECV, NULL, 0, ERR_OK)
181#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
182 LWIP_EVENT_CONNECTED, NULL, 0, (err))
183#define TCP_EVENT_POLL(pcb,ret) do { if ((pcb)->state != SYN_RCVD) { \
184 ret = lwip_tcp_event((pcb)->callback_arg, (pcb), LWIP_EVENT_POLL, NULL, 0, ERR_OK); \
185 } else { \
186 ret = ERR_ARG; } } while(0)
187/* For event API, last state SYN_RCVD must be excluded here: the application
188 has not seen this pcb, yet! */
189#define TCP_EVENT_ERR(last_state,errf,arg,err) do { if (last_state != SYN_RCVD) { \
190 lwip_tcp_event((arg), NULL, LWIP_EVENT_ERR, NULL, 0, (err)); } } while(0)
191
192#else /* LWIP_EVENT_API */
193
194#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) \
195 do { \
196 if((lpcb)->accept != NULL) \
197 (ret) = (lpcb)->accept((arg),(pcb),(err)); \
198 else (ret) = ERR_ARG; \
199 } while (0)
200
201#define TCP_EVENT_SENT(pcb,space,ret) \
202 do { \
203 if((pcb)->sent != NULL) \
204 (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \
205 else (ret) = ERR_OK; \
206 } while (0)
207
208#define TCP_EVENT_RECV(pcb,p,err,ret) \
209 do { \
210 if((pcb)->recv != NULL) { \
211 (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\
212 } else { \
213 (ret) = tcp_recv_null(NULL, (pcb), (p), (err)); \
214 } \
215 } while (0)
216
217#define TCP_EVENT_CLOSED(pcb,ret) \
218 do { \
219 if(((pcb)->recv != NULL)) { \
220 (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\
221 } else { \
222 (ret) = ERR_OK; \
223 } \
224 } while (0)
225
226#define TCP_EVENT_CONNECTED(pcb,err,ret) \
227 do { \
228 if((pcb)->connected != NULL) \
229 (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \
230 else (ret) = ERR_OK; \
231 } while (0)
232
233#define TCP_EVENT_POLL(pcb,ret) \
234 do { \
235 if((pcb)->poll != NULL) \
236 (ret) = (pcb)->poll((pcb)->callback_arg,(pcb)); \
237 else (ret) = ERR_OK; \
238 } while (0)
239
240#define TCP_EVENT_ERR(last_state,errf,arg,err) \
241 do { \
242 LWIP_UNUSED_ARG(last_state); \
243 if((errf) != NULL) \
244 (errf)((arg),(err)); \
245 } while (0)
246
247#endif /* LWIP_EVENT_API */
248
250#if TCP_OVERSIZE && defined(LWIP_DEBUG)
251#define TCP_OVERSIZE_DBGCHECK 1
252#else
253#define TCP_OVERSIZE_DBGCHECK 0
254#endif
255
257#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP)
258
259/* This structure represents a TCP segment on the unsent, unacked and ooseq queues */
260struct tcp_seg {
261 struct tcp_seg *next; /* used when putting segments on a queue */
262 struct pbuf *p; /* buffer containing data + TCP header */
263 u16_t len; /* the TCP length of this segment */
264#if TCP_OVERSIZE_DBGCHECK
265 u16_t oversize_left; /* Extra bytes available at the end of the last
266 pbuf in unsent (used for asserting vs.
267 tcp_pcb.unsent_oversize only) */
268#endif /* TCP_OVERSIZE_DBGCHECK */
269#if TCP_CHECKSUM_ON_COPY
270 u16_t chksum;
271 u8_t chksum_swapped;
272#endif /* TCP_CHECKSUM_ON_COPY */
273 u8_t flags;
274#define TF_SEG_OPTS_MSS (u8_t)0x01U /* Include MSS option (only used in SYN segments) */
275#define TF_SEG_OPTS_TS (u8_t)0x02U /* Include timestamp option. */
276#define TF_SEG_DATA_CHECKSUMMED (u8_t)0x04U /* ALL data (not the header) is
277 checksummed into 'chksum' */
278#define TF_SEG_OPTS_WND_SCALE (u8_t)0x08U /* Include WND SCALE option (only used in SYN segments) */
279#define TF_SEG_OPTS_SACK_PERM (u8_t)0x10U /* Include SACK Permitted option (only used in SYN segments) */
280 struct tcp_hdr *tcphdr; /* the TCP header */
281};
282
283#define LWIP_TCP_OPT_EOL 0
284#define LWIP_TCP_OPT_NOP 1
285#define LWIP_TCP_OPT_MSS 2
286#define LWIP_TCP_OPT_WS 3
287#define LWIP_TCP_OPT_SACK_PERM 4
288#define LWIP_TCP_OPT_TS 8
289
290#define LWIP_TCP_OPT_LEN_MSS 4
291#if LWIP_TCP_TIMESTAMPS
292#define LWIP_TCP_OPT_LEN_TS 10
293#define LWIP_TCP_OPT_LEN_TS_OUT 12 /* aligned for output (includes NOP padding) */
294#else
295#define LWIP_TCP_OPT_LEN_TS_OUT 0
296#endif
297#if LWIP_WND_SCALE
298#define LWIP_TCP_OPT_LEN_WS 3
299#define LWIP_TCP_OPT_LEN_WS_OUT 4 /* aligned for output (includes NOP padding) */
300#else
301#define LWIP_TCP_OPT_LEN_WS_OUT 0
302#endif
303
304#if LWIP_TCP_SACK_OUT
305#define LWIP_TCP_OPT_LEN_SACK_PERM 2
306#define LWIP_TCP_OPT_LEN_SACK_PERM_OUT 4 /* aligned for output (includes NOP padding) */
307#else
308#define LWIP_TCP_OPT_LEN_SACK_PERM_OUT 0
309#endif
310
311#define LWIP_TCP_OPT_LENGTH(flags) \
312 ((flags) & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \
313 ((flags) & TF_SEG_OPTS_TS ? LWIP_TCP_OPT_LEN_TS_OUT : 0) + \
314 ((flags) & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS_OUT : 0) + \
315 ((flags) & TF_SEG_OPTS_SACK_PERM ? LWIP_TCP_OPT_LEN_SACK_PERM_OUT : 0)
316
318#define TCP_BUILD_MSS_OPTION(mss) lwip_htonl(0x02040000 | ((mss) & 0xFFFF))
319
320#if LWIP_WND_SCALE
321#define TCPWNDSIZE_F U32_F
322#define TCPWND_MAX 0xFFFFFFFFU
323#define TCPWND_CHECK16(x) LWIP_ASSERT("window size > 0xFFFF", (x) <= 0xFFFF)
324#define TCPWND_MIN16(x) ((u16_t)LWIP_MIN((x), 0xFFFF))
325#else /* LWIP_WND_SCALE */
326#define TCPWNDSIZE_F U16_F
327#define TCPWND_MAX 0xFFFFU
328#define TCPWND_CHECK16(x)
329#define TCPWND_MIN16(x) x
330#endif /* LWIP_WND_SCALE */
331
332/* Global variables: */
333extern struct tcp_pcb *tcp_input_pcb;
334extern u32_t tcp_ticks;
335extern u8_t tcp_active_pcbs_changed;
336
337/* The TCP PCB lists. */
338union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */
339 struct tcp_pcb_listen *listen_pcbs;
340 struct tcp_pcb *pcbs;
341};
342extern struct tcp_pcb *tcp_bound_pcbs;
343extern union tcp_listen_pcbs_t tcp_listen_pcbs;
344extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a
345 state in which they accept or send
346 data. */
347extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
348
349#define NUM_TCP_PCB_LISTS_NO_TIME_WAIT 3
350#define NUM_TCP_PCB_LISTS 4
351extern struct tcp_pcb ** const tcp_pcb_lists[NUM_TCP_PCB_LISTS];
352
353/* Axioms about the above lists:
354 1) Every TCP PCB that is not CLOSED is in one of the lists.
355 2) A PCB is only in one of the lists.
356 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state.
357 4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state.
358*/
359/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB
360 with a PCB list or removes a PCB from a list, respectively. */
361#ifndef TCP_DEBUG_PCB_LISTS
362#define TCP_DEBUG_PCB_LISTS 0
363#endif
364#if TCP_DEBUG_PCB_LISTS
365#define TCP_REG(pcbs, npcb) do {\
366 struct tcp_pcb *tcp_tmp_pcb; \
367 LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %"U16_F"\n", (void *)(npcb), (npcb)->local_port)); \
368 for (tcp_tmp_pcb = *(pcbs); \
369 tcp_tmp_pcb != NULL; \
370 tcp_tmp_pcb = tcp_tmp_pcb->next) { \
371 LWIP_ASSERT("TCP_REG: already registered", tcp_tmp_pcb != (npcb)); \
372 } \
373 LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \
374 (npcb)->next = *(pcbs); \
375 LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \
376 *(pcbs) = (npcb); \
377 LWIP_ASSERT("TCP_REG: tcp_pcbs sane", tcp_pcbs_sane()); \
378 tcp_timer_needed(); \
379 } while(0)
380#define TCP_RMV(pcbs, npcb) do { \
381 struct tcp_pcb *tcp_tmp_pcb; \
382 LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \
383 LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (void *)(npcb), (void *)(*(pcbs)))); \
384 if(*(pcbs) == (npcb)) { \
385 *(pcbs) = (*pcbs)->next; \
386 } else for (tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \
387 if(tcp_tmp_pcb->next == (npcb)) { \
388 tcp_tmp_pcb->next = (npcb)->next; \
389 break; \
390 } \
391 } \
392 (npcb)->next = NULL; \
393 LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \
394 LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (void *)(npcb), (void *)(*(pcbs)))); \
395 } while(0)
396
397#else /* LWIP_DEBUG */
398
399#define TCP_REG(pcbs, npcb) \
400 do { \
401 (npcb)->next = *pcbs; \
402 *(pcbs) = (npcb); \
403 tcp_timer_needed(); \
404 } while (0)
405
406#define TCP_RMV(pcbs, npcb) \
407 do { \
408 if(*(pcbs) == (npcb)) { \
409 (*(pcbs)) = (*pcbs)->next; \
410 } \
411 else { \
412 struct tcp_pcb *tcp_tmp_pcb; \
413 for (tcp_tmp_pcb = *pcbs; \
414 tcp_tmp_pcb != NULL; \
415 tcp_tmp_pcb = tcp_tmp_pcb->next) { \
416 if(tcp_tmp_pcb->next == (npcb)) { \
417 tcp_tmp_pcb->next = (npcb)->next; \
418 break; \
419 } \
420 } \
421 } \
422 (npcb)->next = NULL; \
423 } while(0)
424
425#endif /* LWIP_DEBUG */
426
427#define TCP_REG_ACTIVE(npcb) \
428 do { \
429 TCP_REG(&tcp_active_pcbs, npcb); \
430 tcp_active_pcbs_changed = 1; \
431 } while (0)
432
433#define TCP_RMV_ACTIVE(npcb) \
434 do { \
435 TCP_RMV(&tcp_active_pcbs, npcb); \
436 tcp_active_pcbs_changed = 1; \
437 } while (0)
438
439#define TCP_PCB_REMOVE_ACTIVE(pcb) \
440 do { \
441 tcp_pcb_remove(&tcp_active_pcbs, pcb); \
442 tcp_active_pcbs_changed = 1; \
443 } while (0)
444
445
446/* Internal functions: */
447struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb);
448void tcp_pcb_purge(struct tcp_pcb *pcb);
449void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb);
450
451void tcp_segs_free(struct tcp_seg *seg);
452void tcp_seg_free(struct tcp_seg *seg);
453struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg);
454
455#define tcp_ack(pcb) \
456 do { \
457 if((pcb)->flags & TF_ACK_DELAY) { \
458 tcp_clear_flags(pcb, TF_ACK_DELAY); \
459 tcp_ack_now(pcb); \
460 } \
461 else { \
462 tcp_set_flags(pcb, TF_ACK_DELAY); \
463 } \
464 } while (0)
465
466#define tcp_ack_now(pcb) \
467 tcp_set_flags(pcb, TF_ACK_NOW)
468
469err_t tcp_send_fin(struct tcp_pcb *pcb);
470err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags);
471
472void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg);
473
474void tcp_rst(const struct tcp_pcb* pcb, u32_t seqno, u32_t ackno,
475 const ip_addr_t *local_ip, const ip_addr_t *remote_ip,
476 u16_t local_port, u16_t remote_port);
477void tcp_rst_netif(struct netif *netif, u32_t seqno, u32_t ackno,
478 const ip_addr_t *local_ip, const ip_addr_t *remote_ip,
479 u16_t local_port, u16_t remote_port);
480
481u32_t tcp_next_iss(struct tcp_pcb *pcb);
482
483err_t tcp_keepalive(struct tcp_pcb *pcb);
484err_t tcp_split_unsent_seg(struct tcp_pcb *pcb, u16_t split);
485err_t tcp_zero_window_probe(struct tcp_pcb *pcb);
486void tcp_trigger_input_pcb_close(void);
487
488#if TCP_CALCULATE_EFF_SEND_MSS
489u16_t tcp_eff_send_mss_netif(u16_t sendmss, struct netif *outif,
490 const ip_addr_t *dest);
491#define tcp_eff_send_mss(sendmss, src, dest) \
492 tcp_eff_send_mss_netif(sendmss, ip_route(src, dest), dest)
493#endif /* TCP_CALCULATE_EFF_SEND_MSS */
494
495#if LWIP_CALLBACK_API
496err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err);
497#endif /* LWIP_CALLBACK_API */
498
499#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG
500void tcp_debug_print(struct tcp_hdr *tcphdr);
501void tcp_debug_print_flags(u8_t flags);
502void tcp_debug_print_state(enum tcp_state s);
503void tcp_debug_print_pcbs(void);
504s16_t tcp_pcbs_sane(void);
505#else
506# define tcp_debug_print(tcphdr)
507# define tcp_debug_print_flags(flags)
508# define tcp_debug_print_state(s)
509# define tcp_debug_print_pcbs()
510# define tcp_pcbs_sane() 1
511#endif /* TCP_DEBUG */
512
515void tcp_timer_needed(void);
516
517void tcp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr);
518
519#if TCP_QUEUE_OOSEQ
520void tcp_free_ooseq(struct tcp_pcb *pcb);
521#endif
522
523#if LWIP_TCP_PCB_NUM_EXT_ARGS
524err_t tcp_ext_arg_invoke_callbacks_passive_open(struct tcp_pcb_listen *lpcb, struct tcp_pcb *cpcb);
525#endif
526
527#ifdef __cplusplus
528}
529#endif
530
531#endif /* LWIP_TCP */
532
533#endif /* LWIP_HDR_TCP_PRIV_H */
STREAM tcp_init(uint32 maxlen)
Definition: tcp.c:82
static LPSTR * split(LPSTR s, LPINT args)
Definition: cmdcons.c:163
GLdouble s
Definition: gl.h:2039
GLboolean reset
Definition: glext.h:5666
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
int16_t s16_t
Definition: arch.h:128
s8_t err_t
Definition: err.h:96
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
static char * dest
Definition: rtl.c:149
static unsigned __int64 next
Definition: rand_nt.c:6
#define err(...)
Definition: netif.h:269
Definition: pbuf.h:186
Definition: tcp.h:56
Definition: tcpdef.h:22
void tcp_send_fin(struct sock *sk)
void tcp_timer_needed(void)
Definition: timeouts.c:448