#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include "cnet_const.h"
Go to the source code of this file.
|
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. More...
|
|
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. More...
|
|
CNDP_API void | cnet_protosw_dump (struct stk_s *stk) |
| Dump out the list of protocol switch values. More...
|
|
CNDP_API int | cnet_ipproto_set (uint8_t ipproto, struct protosw_entry *psw) |
| Set the IP proto value in the given protosw_entry pointer. More...
|
|
CNDP_API struct protosw_entry * | cnet_ipproto_get (uint8_t ipproto) |
| Get the protosw_entry to locate using the IP proto type. More...
|
|
CNDP_API struct protosw_entry * | cnet_protosw_find_by_proto (uint8_t proto) |
| Find a protocol switch entry using the IP proto type. More...
|
|
CNET Ptotocol switch routines.
Definition in file cnet_protosw.h.
◆ cnet_protosw_add()
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.
- Parameters
-
name | The number of protocol name to add. |
domain | The domain of the protocol to add. |
type | The type of protocol to add. |
proto | The proto type value to add. |
- Returns
- NULL on error or a pointer to a protocol switch entry.
◆ cnet_protosw_find()
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.
- Parameters
-
domain | The domain to search for in the list. |
type | The type of protocol. |
proto | The proto type value. |
- Returns
- NULL on error or a pointer to a protocol switch entry.
◆ cnet_protosw_dump()
CNDP_API void cnet_protosw_dump |
( |
struct stk_s * |
stk | ) |
|
Dump out the list of protocol switch values.
- Parameters
-
stk | The stack instance to be dumped. |
- Returns
- N/A
◆ cnet_ipproto_set()
CNDP_API int cnet_ipproto_set |
( |
uint8_t |
ipproto, |
|
|
struct protosw_entry * |
psw |
|
) |
| |
Set the IP proto value in the given protosw_entry pointer.
- Parameters
-
ipproto | The IP proto type value to be set in the structure. |
psw | The protosw_entry structure pointer. |
- Returns
- -1 on error or 0 on success
◆ cnet_ipproto_get()
CNDP_API struct protosw_entry* cnet_ipproto_get |
( |
uint8_t |
ipproto | ) |
|
Get the protosw_entry to locate using the IP proto type.
- Parameters
-
ipproto | The IP proto type value to be set in the structure. |
- Returns
- NULL on error or a pointer to a protocol switch entry.
◆ cnet_protosw_find_by_proto()
CNDP_API struct protosw_entry* cnet_protosw_find_by_proto |
( |
uint8_t |
proto | ) |
|
Find a protocol switch entry using the IP proto type.
- Parameters
-
proto | The IP proto type value to be set in the structure. |
- Returns
- NULL on error or a pointer to a protocol switch entry.