CNDP  22.08.0
cnet_pcb.h File Reference
#include <cne_inet.h>
#include <stdint.h>
#include <string.h>
#include "cne_common.h"
#include "cne_log.h"
#include "cne_vec.h"
#include "cnet_const.h"
#include "cnet_stk.h"
#include "mempool.h"

Go to the source code of this file.

Functions

CNDP_API struct pcb_entry * cnet_pcb_lookup (struct pcb_hd *hd, struct pcb_key *key, int32_t flags)
 
CNDP_API void cnet_pcb_dump (stk_t *stk)
 Dump out the PCB information. More...
 
CNDP_API void cnet_pcb_show (struct pcb_entry *pcb)
 
static struct pcb_entry * cnet_pcb_locate (struct pcb_hd *hd, struct in_caddr *faddr, struct in_caddr *laddr)
 Return the PCB entry matching the given information. More...
 

Variables

struct in_caddr faddr
 
struct in_caddr laddr
 

Detailed Description

CNET PCB routines.

Definition in file cnet_pcb.h.

Function Documentation

◆ cnet_pcb_lookup()

CNDP_API struct pcb_entry* cnet_pcb_lookup ( struct pcb_hd *  hd,
struct pcb_key *  key,
int32_t  flags 
)

Lookup a PCB in the given list to locate the matching PCB or near matching PCB. The flag value denotes is the match is EXACT or a best match. With the local (laddr) and foreign address (faddr) locate the matching or best matching PCB data.

Find a matching local, foreign and port address in the PCB list given. A local copy of the local and foreign address is created for the compare when not doing a exact match, but looking for the best match.

Parameters:

Parameters
hdA pointer to the PCB list head.
keyPointer to key information to PCB list.
flagsFlags for the compare EXACT or BEST match

PCB laddr | laddr | Type --------—+--------—+-----— non-Zero | non-Zero | Exact non-Zero | Zero | Best Zero | non-Zero | Best Zero | Zero | Invalid

PCB faddr | faddr | Type --------—+--------—+-----— non-Zero | non-Zero | Exact non-Zero | Zero | Best Zero | non-Zero | Best Zero | Zero | Invalid

Returns
NULL or the matching PCB pointer.

◆ cnet_pcb_dump()

CNDP_API void cnet_pcb_dump ( stk_t *  stk)

Dump out the PCB information.

Parameters
stkThe stack instance pointer to use for dumping the data.
Returns
N/A

◆ cnet_pcb_show()

CNDP_API void cnet_pcb_show ( struct pcb_entry *  pcb)

Print out the given PCB entry.

Parameters
pcbThe PCB entry to dump out

◆ cnet_pcb_locate()

static struct pcb_entry* cnet_pcb_locate ( struct pcb_hd *  hd,
struct in_caddr *  faddr,
struct in_caddr *  laddr 
)
inlinestatic

Return the PCB entry matching the given information.

Parameters
hdA pointer to the PCB list head.
faddrThe foreign address entry to look for in the list.
laddrThe local address entyr to look for in the list.
Returns
NULL on error or pointer to a pcb_entry.

Definition at line 163 of file cnet_pcb.h.

Variable Documentation

◆ faddr

struct in_caddr faddr

foreign IP address

Definition at line 163 of file cnet_pcb.h.

◆ laddr

struct in_caddr laddr

local IP address

Definition at line 163 of file cnet_pcb.h.