CNDP
22.08.0
|
#include "cnet_const.h"
#include "cnet_pcb.h"
#include <net/cne_tcp.h>
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <sys/queue.h>
#include "cne_log.h"
#include "cnet_stk.h"
#include "cnet_tcp.h"
#include "mempool.h"
#include "pktmbuf.h"
Go to the source code of this file.
Data Structures | |
struct | tcp_stats |
Macros | |
#define | TCP_MIN_MSS 64 |
#define | TCP_MSS 536 |
#define | TCP_NORMAL_MSS 1460 |
#define | TCP_MAX_MSS (16384 - 64) |
#define | TCP_MSS_OVERHEAD 52 |
#define | TCP_DEFAULT_HDR_SIZE 20 |
#define | TCP_MAXWIN ETHER_MAX_MTU |
#define | TCP_MAX_WINSHIFT 14 |
#define | TCP_INITIAL_CWND 4380 |
#define | TCP_VEC_SIZE 1024 |
#define | TCP_MSL_TV 60 |
#define | TCP_MIN_TV 2 |
#define | TCP_REXMTMAX_TV 128 |
#define | TCP_PERSMIN_TV 10 |
#define | TCP_PERSMAX_TV 120 |
#define | TCP_KEEP_INIT_TV 150 |
#define | TCP_KEEP_IDLE_TV 14400 |
#define | TCP_KEEPINTVL_TV 150 |
#define | TCP_KEEPCNT_TV 8 |
#define | TCP_SRTTBASE_TV 0 |
#define | TCP_SRTTDFLT_TV 2 |
#define | TCP_KEEPCNT_TV 8 |
#define | TCP_RTT_SCALE 8 |
#define | TCP_RTT_SHIFT 3 |
#define | TCP_RTTVAR_SCALE 4 |
#define | TCP_RTTVAR_SHIFT 2 |
#define | TCP_ISSINCR 0x01000000 |
#define | TCP_SLOWHZ 2 |
#define | TCP_MAXRXTSHIFT 12 |
Typedefs | |
typedef struct tcp_stats | tcp_stats_t |
Enumerations | |
enum | tcb_state_t { } |
enum | { TCP_OPT_EOL = 0 , TCP_OPT_NOP , TCP_OPT_MSS , TCP_OPT_WSOPT , TCP_OPT_SACK_OK , TCP_OPT_SACK , TCP_OPT_TSTAMP = 8 } |
enum | { TCPT_REXMT = 0 , TCPT_PERSIST , TCPT_KEEP , TCPT_2MSL , TCP_NTIMERS } |
enum | { SEG_TS_PRESENT = 0x8000 , SEG_MSS_PRESENT = 0x4000 , SEG_WS_PRESENT = 0x2000 , SEG_SACK_PERMIT = 0x1000 } |
enum | { TCP_FAST_TIMER = 1 , TCP_SLOW_TIMER = 2 } |
enum | { TCBF_PASSIVE_OPEN = 0x10000000 , TCBF_FORCE_TX = 0x20000000 , TCBF_DELAYED_ACK = 0x40000000 , TCBF_FREE_BIT_1 = 0x80000000 , TCBF_RFC1122_URG = 0x01000000 , TCBF_BOUND = 0x02000000 , TCBF_FREE_BIT_2 = 0x04000000 , TCBF_FREE_BIT_3 = 0x08000000 , TCBF_REQ_TSTAMP = 0x00100000 , TCBF_RCVD_SCALE = 0x00200000 , TCBF_REQ_SCALE = 0x00400000 , TCBF_SEND_URG = 0x00800000 , TCBF_ACK_NOW = 0x00010000 , TCBF_SENT_FIN = 0x00020000 , TCBF_SACK_PERMIT = 0x00040000 , TCBF_RCVD_TSTAMP = 0x00080000 , TCBF_NODELAY = 0x00001000 , TCBF_NAGLE_CREDIT = 0x00002000 , TCBF_OUR_FIN_ACKED = 0x00004000 , TCBF_FREE_BIT_4 = 0x00008000 , TCBF_FREE_BIT_5 = 0x00000100 , TCBF_NEED_FAST_REXMT = 0x00000200 , TCBF_NOPUSH = 0x00000400 , TCBF_NOOPT = 0x00000800 } |
Functions | |
static struct tcb_entry * | tcb_alloc (void) |
CNDP_API int | cnet_tcp_input (struct pcb_entry *pcb, pktmbuf_t *mbuf) |
CNDP_API void | cnet_tcp_output (struct tcb_entry *tcb) |
CNDP_API int | cnet_tcp_connect (struct pcb_entry *pcb) |
CNDP_API struct tcb_entry * | cnet_tcb_new (struct pcb_entry *pcb) |
CNDP_API void | cnet_tcp_abort (struct pcb_entry *pcb) |
CNDP_API int | cnet_tcp_close (struct pcb_entry *pcb) |
void * | tcp_q_pop (struct tcp_q *tq) |
CNDP_API void | cnet_tcp_dump (const char *msg, struct cne_tcp_hdr *tcp) |
CNDP_API void | cnet_tcb_list (stk_t *stk, struct tcb_entry *tcb) |
CNDP_API void | cnet_tcb_dump (void) |
CNET TCP protocol routines and constants.
Definition in file cnet_tcp.h.
#define TCP_MIN_MSS 64 |
Minimum segment size
Definition at line 219 of file cnet_tcp.h.
#define TCP_MSS 536 |
Default Segment size (576 - 40)
Definition at line 220 of file cnet_tcp.h.
#define TCP_NORMAL_MSS 1460 |
Normal TCP MSS value
Definition at line 221 of file cnet_tcp.h.
#define TCP_MAX_MSS (16384 - 64) |
Max TCP segment size
Definition at line 222 of file cnet_tcp.h.
#define TCP_MSS_OVERHEAD 52 |
Size of Header(IPv4/v6/TCP) overhead
Definition at line 223 of file cnet_tcp.h.
#define TCP_DEFAULT_HDR_SIZE 20 |
Default/minimum TCP header
Definition at line 224 of file cnet_tcp.h.
#define TCP_MAXWIN ETHER_MAX_MTU |
Max unscaled Window value
Definition at line 229 of file cnet_tcp.h.
#define TCP_MAX_WINSHIFT 14 |
Max Window index value
Definition at line 230 of file cnet_tcp.h.
#define TCP_INITIAL_CWND 4380 |
Max congestion window
Definition at line 231 of file cnet_tcp.h.
#define TCP_VEC_SIZE 1024 |
TCP Vector size
Definition at line 232 of file cnet_tcp.h.
#define TCP_MSL_TV 60 |
30 Seconds Max Segment Lifetime
Definition at line 235 of file cnet_tcp.h.
#define TCP_MIN_TV 2 |
1 Second retransmit timer.
Definition at line 236 of file cnet_tcp.h.
#define TCP_REXMTMAX_TV 128 |
64 Second retransmit timer.
Definition at line 237 of file cnet_tcp.h.
#define TCP_PERSMIN_TV 10 |
5 Second minimum persist timer.
Definition at line 238 of file cnet_tcp.h.
#define TCP_PERSMAX_TV 120 |
60 Seconds Max persist timer.
Definition at line 239 of file cnet_tcp.h.
#define TCP_KEEP_INIT_TV 150 |
75 Seconds connection established
Definition at line 240 of file cnet_tcp.h.
#define TCP_KEEP_IDLE_TV 14400 |
7200 Seconds idle time (first)
Definition at line 241 of file cnet_tcp.h.
#define TCP_KEEPINTVL_TV 150 |
75 Seconds between probes
Definition at line 242 of file cnet_tcp.h.
#define TCP_KEEPCNT_TV 8 |
Max number keepalive probes.
Definition at line 246 of file cnet_tcp.h.
#define TCP_SRTTBASE_TV 0 |
special value
Definition at line 244 of file cnet_tcp.h.
#define TCP_SRTTDFLT_TV 2 |
default RTT (1 seconds)
Definition at line 245 of file cnet_tcp.h.
#define TCP_KEEPCNT_TV 8 |
Max number keepalive probes.
Definition at line 246 of file cnet_tcp.h.
#define TCP_RTT_SCALE 8 |
multiplier srtt = srtt x 8
Definition at line 248 of file cnet_tcp.h.
#define TCP_RTT_SHIFT 3 |
shift srtt = srtt << 3
Definition at line 249 of file cnet_tcp.h.
#define TCP_RTTVAR_SCALE 4 |
multiplier rttvar = rttvar x 4
Definition at line 250 of file cnet_tcp.h.
#define TCP_RTTVAR_SHIFT 2 |
shift rttvar = rttvar << 2
Definition at line 251 of file cnet_tcp.h.
#define TCP_ISSINCR 0x01000000 |
Initial SYN Start increment
Definition at line 253 of file cnet_tcp.h.
#define TCP_SLOWHZ 2 |
Slow hertz
Definition at line 254 of file cnet_tcp.h.
#define TCP_MAXRXTSHIFT 12 |
Max retransmissions
Definition at line 284 of file cnet_tcp.h.
typedef struct tcp_stats tcp_stats_t |
TCP counters.
enum tcb_state_t |
TCP states (numeric values match those in RFC2452)
Definition at line 122 of file cnet_tcp.h.
anonymous enum |
Definition at line 198 of file cnet_tcp.h.
anonymous enum |
Definition at line 294 of file cnet_tcp.h.
anonymous enum |
Enumerator | |
---|---|
SEG_TS_PRESENT | Timestamp is present |
SEG_MSS_PRESENT | MSS option is present |
SEG_WS_PRESENT | Window Scale present |
SEG_SACK_PERMIT | SACK permission flag, which is not supported at this time. |
Definition at line 327 of file cnet_tcp.h.
anonymous enum |
Enumerator | |
---|---|
TCP_FAST_TIMER | Fast TCP timer (200ms) |
TCP_SLOW_TIMER | Slow TCP timer (500ms) |
Definition at line 334 of file cnet_tcp.h.
anonymous enum |
Definition at line 416 of file cnet_tcp.h.
|
inlinestatic |
Allocate a new TCB control block from the free list of TCB structures.
Definition at line 566 of file cnet_tcp.h.
CNDP_API int cnet_tcp_input | ( | struct pcb_entry * | pcb, |
pktmbuf_t * | mbuf | ||
) |
The TCP input routine
pcb | The PCB pointer for this connection |
mbuf | The mbuf to process in TCP input |
CNDP_API void cnet_tcp_output | ( | struct tcb_entry * | tcb | ) |
The TCP output routine.
tcb | The TCB to process output packets from. |
CNDP_API int cnet_tcp_connect | ( | struct pcb_entry * | pcb | ) |
The TCP connect function gives the PCB to use for the connection
pcb | The PCB pointer in which to do the connection request. |
CNDP_API struct tcb_entry* cnet_tcb_new | ( | struct pcb_entry * | pcb | ) |
Create a new TCB for the given PCB pointer.
pcb | The PCB to create the TCB from. |
CNDP_API void cnet_tcp_abort | ( | struct pcb_entry * | pcb | ) |
Abort the TCP connection
pcb | The PCB pointer in which to start the abort sequence. |
CNDP_API int cnet_tcp_close | ( | struct pcb_entry * | pcb | ) |
Close the TCP connection for the given PCB
pcb | The PCB in which to start the connect close sequence |
void* tcp_q_pop | ( | struct tcp_q * | tq | ) |
Remove an entry from the queue
CNDP_API void cnet_tcp_dump | ( | const char * | msg, |
struct cne_tcp_hdr * | tcp | ||
) |
Dump out the TCP header and information
msg | A caller supplied message or NULL if none |
tcp | The TCP header to dump |
CNDP_API void cnet_tcb_list | ( | stk_t * | stk, |
struct tcb_entry * | tcb | ||
) |
List out all of the active TCB structures
stk | The stack instance to dump the TCB from |
tcb | The TCB structure to dump or NULL for all TCB structures. |
CNDP_API void cnet_tcb_dump | ( | void | ) |
Dump out all TCBs in all stack instances.