5 #ifndef __CNET_PROTOSW_H
6 #define __CNET_PROTOSW_H
15 #include <sys/types.h>
22 #define CNET_MAX_IPPROTO 256
23 #define PROTOSW_WILDCARD 0xFFFF
38 typedef int (*close_func_t)(
struct chnl *ch);
39 typedef int (*send_func_t)(
struct chnl *ch,
pktmbuf_t **mbufs, uint16_t nb_mbufs);
40 typedef int (*recv_func_t)(
struct chnl *ch,
pktmbuf_t **mbufs,
int nb_mbufs);
41 typedef int (*bind_func_t)(
struct chnl *ch,
struct in_caddr *pAddr,
int len);
42 typedef int (*connect_func_t)(
struct chnl *ch,
struct in_caddr *to,
int slen);
43 typedef int (*shutdown_func_t)(
struct chnl *ch,
int how);
44 typedef int (*accept_func_t)(
struct chnl *ch,
struct in_caddr *addr,
int *addrlen);
45 typedef int (*listen_func_t)(
struct chnl *ch,
int backlog);
48 close_func_t close_func;
49 recv_func_t recv_func;
50 send_func_t send_func;
51 bind_func_t bind_func;
52 connect_func_t connect_func;
53 shutdown_func_t shutdown_func;
54 accept_func_t accept_func;
55 listen_func_t listen_func;
61 struct protosw_entry {
67 struct proto_funcs *funcs;
84 CNDP_API
struct protosw_entry *
cnet_protosw_add(
const char *name, uint16_t domain, uint16_t type,
99 CNDP_API
struct protosw_entry *
cnet_protosw_find(uint16_t domain, uint16_t type, uint16_t proto);
CNDP_API int cnet_ipproto_set(uint8_t ipproto, struct protosw_entry *psw)
Set the IP proto value in the given protosw_entry pointer.
CNDP_API struct protosw_entry * cnet_protosw_add(const char *name, uint16_t domain, uint16_t type, uint16_t proto)
Add protocol information to the list of protocol switch list.
CNDP_API struct protosw_entry * cnet_protosw_find(uint16_t domain, uint16_t type, uint16_t proto)
Find a protocol entry in the protocol switch list.
CNDP_API void cnet_protosw_dump(struct stk_s *stk)
Dump out the list of protocol switch values.
CNDP_API struct protosw_entry * cnet_protosw_find_by_proto(uint8_t proto)
Find a protocol switch entry using the IP proto type.
CNDP_API struct protosw_entry * cnet_ipproto_get(uint8_t ipproto)
Get the protosw_entry to locate using the IP proto type.