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