29 struct in_caddr
faddr;
30 struct in_caddr
laddr;
38 TAILQ_ENTRY(pcb_entry) next;
42 struct tcb_entry *tcb;
48 } __cne_cache_aligned;
51 struct pcb_entry **vec;
56 cnet_pcb_free(
struct pcb_entry *pcb)
59 memset(pcb, 0,
sizeof(
struct pcb_entry));
66 static inline struct pcb_entry *
67 cnet_pcb_alloc(
struct pcb_hd *hd, uint16_t proto)
69 struct pcb_entry *pcb;
71 if (
mempool_get(this_stk->pcb_objs, (
void *)&pcb) < 0)
75 pcb->ip_proto = proto;
77 vec_add(hd->vec, pcb);
83 cnet_pcb_delete(
struct pcb_hd *hd,
struct pcb_entry *pcb)
87 vec_foreach_ptr (p, hd->vec) {
130 CNDP_API
struct pcb_entry *
cnet_pcb_lookup(
struct pcb_hd *hd,
struct pcb_key *key, int32_t flags);
162 static inline struct pcb_entry *
167 *(
struct in_caddr *)&key.faddr = *
faddr;
168 *(
struct in_caddr *)&key.laddr = *
laddr;
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.
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.
CNDP_API int mempool_get(mempool_t *mp, void **obj_p)
CNDP_API void mempool_put(mempool_t *mp, void *obj)