FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
ip_types.h File Reference
+ Include dependency graph for ip_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ip_address
 
struct  ip_prefix
 

Macros

#define FOR_EACH_IP_ADDRESS_FAMILY(_af)   for (_af = AF_IP4; _af <= AF_IP6; _af++)
 
#define u8_ptr_add(ptr, index)   (((u8 *)ptr) + index)
 
#define u16_net_add(u, val)   clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))
 
#define ip_addr_addr(_a)   (_a)->ip
 
#define ip_addr_v4(_a)   (_a)->ip.v4
 
#define ip_addr_v6(_a)   (_a)->ip.v6
 
#define ip_addr_version(_a)   (_a)->version
 
#define ip_prefix_addr(_a)   (_a)->addr
 
#define ip_prefix_version(_a)   ip_addr_version(&ip_prefix_addr(_a))
 
#define ip_prefix_len(_a)   (_a)->len
 
#define ip_prefix_v4(_a)   ip_addr_v4(&ip_prefix_addr(_a))
 
#define ip_prefix_v6(_a)   ip_addr_v6(&ip_prefix_addr(_a))
 

Typedefs

typedef enum ip_address_family_t_ ip_address_family_t
 
typedef struct ip_address ip_address_t
 
typedef struct ip_prefix ip_prefix_t
 

Enumerations

enum  ip_address_family_t_ { AF_IP4, AF_IP6 }
 

Functions

uword unformat_ip_address_family (unformat_input_t *input, va_list *args)
 
u8format_ip_address_family (u8 *s, va_list *args)
 
int ip_address_cmp (const ip_address_t *ip1, const ip_address_t *ip2)
 
void ip_address_copy (ip_address_t *dst, const ip_address_t *src)
 
void ip_address_copy_addr (void *dst, const ip_address_t *src)
 
void ip_address_set (ip_address_t *dst, const void *src, u8 version)
 
u16 ip_address_size (const ip_address_t *a)
 
u16 ip_version_to_size (u8 ver)
 
u8format_ip_address (u8 *s, va_list *args)
 
uword unformat_ip_address (unformat_input_t *input, va_list *args)
 
void ip_address_to_46 (const ip_address_t *addr, ip46_address_t *a, fib_protocol_t *proto)
 
int ip_prefix_cmp (ip_prefix_t *p1, ip_prefix_t *p2)
 
void ip_prefix_normalize (ip_prefix_t *a)
 
void ip_address_to_fib_prefix (const ip_address_t *addr, fib_prefix_t *prefix)
 convert from a LISP address to a FIB prefix More...
 
void ip_prefix_to_fib_prefix (const ip_prefix_t *ipp, fib_prefix_t *fibp)
 convert from a LISP to a FIB prefix More...
 
u8format_ip_prefix (u8 *s, va_list *args)
 
uword unformat_ip_prefix (unformat_input_t *input, va_list *args)
 

Macro Definition Documentation

◆ FOR_EACH_IP_ADDRESS_FAMILY

#define FOR_EACH_IP_ADDRESS_FAMILY (   _af)    for (_af = AF_IP4; _af <= AF_IP6; _af++)

Definition at line 31 of file ip_types.h.

◆ ip_addr_addr

#define ip_addr_addr (   _a)    (_a)->ip

Definition at line 49 of file ip_types.h.

◆ ip_addr_v4

#define ip_addr_v4 (   _a)    (_a)->ip.v4

Definition at line 50 of file ip_types.h.

◆ ip_addr_v6

#define ip_addr_v6 (   _a)    (_a)->ip.v6

Definition at line 51 of file ip_types.h.

◆ ip_addr_version

#define ip_addr_version (   _a)    (_a)->version

Definition at line 52 of file ip_types.h.

◆ ip_prefix_addr

#define ip_prefix_addr (   _a)    (_a)->addr

Definition at line 74 of file ip_types.h.

◆ ip_prefix_len

#define ip_prefix_len (   _a)    (_a)->len

Definition at line 76 of file ip_types.h.

◆ ip_prefix_v4

#define ip_prefix_v4 (   _a)    ip_addr_v4(&ip_prefix_addr(_a))

Definition at line 77 of file ip_types.h.

◆ ip_prefix_v6

#define ip_prefix_v6 (   _a)    ip_addr_v6(&ip_prefix_addr(_a))

Definition at line 78 of file ip_types.h.

◆ ip_prefix_version

#define ip_prefix_version (   _a)    ip_addr_version(&ip_prefix_addr(_a))

Definition at line 75 of file ip_types.h.

◆ u16_net_add

#define u16_net_add (   u,
  val 
)    clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))

Definition at line 35 of file ip_types.h.

◆ u8_ptr_add

#define u8_ptr_add (   ptr,
  index 
)    (((u8 *)ptr) + index)

Definition at line 34 of file ip_types.h.

Typedef Documentation

◆ ip_address_family_t

◆ ip_address_t

typedef struct ip_address ip_address_t

◆ ip_prefix_t

typedef struct ip_prefix ip_prefix_t

Enumeration Type Documentation

◆ ip_address_family_t_

Enumerator
AF_IP4 
AF_IP6 

Definition at line 21 of file ip_types.h.

Function Documentation

◆ format_ip_address()

u8* format_ip_address ( u8 s,
va_list *  args 
)

Definition at line 20 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ip_address_family()

u8* format_ip_address_family ( u8 s,
va_list *  args 
)

Definition at line 283 of file ip.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ip_prefix()

u8* format_ip_prefix ( u8 s,
va_list *  args 
)

Definition at line 55 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_cmp()

int ip_address_cmp ( const ip_address_t ip1,
const ip_address_t ip2 
)

Definition at line 98 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_copy()

void ip_address_copy ( ip_address_t dst,
const ip_address_t src 
)

Definition at line 115 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_copy_addr()

void ip_address_copy_addr ( void *  dst,
const ip_address_t src 
)

Definition at line 131 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_set()

void ip_address_set ( ip_address_t dst,
const void *  src,
u8  version 
)

Definition at line 152 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_size()

u16 ip_address_size ( const ip_address_t a)

Definition at line 83 of file ip_types.c.

+ Here is the caller graph for this function:

◆ ip_address_to_46()

void ip_address_to_46 ( const ip_address_t addr,
ip46_address_t *  a,
fib_protocol_t proto 
)

Definition at line 159 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_address_to_fib_prefix()

void ip_address_to_fib_prefix ( const ip_address_t addr,
fib_prefix_t prefix 
)

convert from a LISP address to a FIB prefix

Definition at line 130 of file control.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_prefix_cmp()

int ip_prefix_cmp ( ip_prefix_t p1,
ip_prefix_t p2 
)

Definition at line 258 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_prefix_normalize()

void ip_prefix_normalize ( ip_prefix_t a)

Definition at line 232 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_prefix_to_fib_prefix()

void ip_prefix_to_fib_prefix ( const ip_prefix_t ipp,
fib_prefix_t fibp 
)

convert from a LISP to a FIB prefix

Definition at line 151 of file control.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_version_to_size()

u16 ip_version_to_size ( u8  ver)

Definition at line 137 of file ip_types.c.

+ Here is the caller graph for this function:

◆ unformat_ip_address()

uword unformat_ip_address ( unformat_input_t input,
va_list *  args 
)

Definition at line 40 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_ip_address_family()

uword unformat_ip_address_family ( unformat_input_t input,
va_list *  args 
)

◆ unformat_ip_prefix()

uword unformat_ip_prefix ( unformat_input_t input,
va_list *  args 
)

Definition at line 63 of file ip_types.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: