FD.io VPP  v16.06
Vector Packet Processing
interface.h File Reference
+ Include dependency graph for interface.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vnet_hw_interface_t
 
struct  vnet_sub_interface_t
 
struct  vnet_sw_interface_t
 
struct  vnet_hw_interface_nodes_t
 
struct  vnet_interface_main_t
 

Macros

#define VNET_HW_INTERFACE_ADD_DEL_FUNCTION(f)   _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_add_del)
 
#define VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(f)   _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_link_up_down)
 
#define VNET_SW_INTERFACE_ADD_DEL_FUNCTION(f)   _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_add_del)
 
#define VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(f)   _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_admin_up_down)
 
#define VNET_DEVICE_CLASS(x, ...)
 
#define VNET_HW_INTERFACE_CLASS(x, ...)
 
#define VNET_HW_INTERFACE_FLAG_LINK_UP   (1 << 0)
 
#define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT   1
 
#define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX   (1 << 1)
 
#define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX   (1 << 2)
 
#define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK
 
#define VNET_HW_INTERFACE_FLAG_SPEED_SHIFT   3
 
#define VNET_HW_INTERFACE_FLAG_SPEED_10M   (1 << 3)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_100M   (1 << 4)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_1G   (1 << 5)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_10G   (1 << 6)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_40G   (1 << 7)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_100G   (1 << 8)
 
#define VNET_HW_INTERFACE_FLAG_SPEED_MASK
 
#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT   9
 
#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED   (1 << 9)
 
#define VNET_HW_INTERFACE_BOND_INFO_NONE   ((uword *) 0)
 
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE   ((uword *) ~0)
 
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP   (1 << 0)
 
#define VNET_SW_INTERFACE_FLAG_PUNT   (1 << 1)
 
#define VNET_SW_INTERFACE_FLAG_PROXY_ARP   (1 << 2)
 
#define VNET_SW_INTERFACE_FLAG_UNNUMBERED   (1 << 3)
 
#define VNET_SW_INTERFACE_FLAG_BOND_SLAVE   (1 << 4)
 
#define foreach_intf_output_feat   _(IPSEC, "ipsec-output")
 
#define INTF_OUTPUT_FEAT_DONE   INTF_OUTPUT_N_FEAT
 

Typedefs

typedef clib_error_t *( vnet_interface_function_t) (struct vnet_main_t *vnm, u32 if_index, u32 flags)
 
typedef clib_error_t *( vnet_subif_add_del_function_t) (struct vnet_main_t *vnm, u32 if_index, struct vnet_sw_interface_t *template, int is_add)
 
typedef struct _vnet_device_class vnet_device_class_t
 
typedef struct _vnet_hw_interface_class vnet_hw_interface_class_t
 
typedef struct vnet_hw_interface_t vnet_hw_interface_t
 

Enumerations

enum  vnet_sw_interface_type_t { VNET_SW_INTERFACE_TYPE_HARDWARE, VNET_SW_INTERFACE_TYPE_SUB }
 
enum  vnet_interface_counter_type_t {
  VNET_INTERFACE_COUNTER_DROP = 0, VNET_INTERFACE_COUNTER_PUNT = 1, VNET_INTERFACE_COUNTER_IP4 = 2, VNET_INTERFACE_COUNTER_IP6 = 3,
  VNET_INTERFACE_COUNTER_RX_NO_BUF = 4, VNET_INTERFACE_COUNTER_RX_MISS = 5, VNET_INTERFACE_COUNTER_RX_ERROR = 6, VNET_INTERFACE_COUNTER_TX_ERROR = 7,
  VNET_N_SIMPLE_INTERFACE_COUNTER = 8, VNET_INTERFACE_COUNTER_RX = 0, VNET_INTERFACE_COUNTER_TX = 1, VNET_N_COMBINED_INTERFACE_COUNTER = 2
}
 
enum  intf_output_feat_t { INTF_OUTPUT_N_FEAT }
 

Functions

static void vnet_interface_counter_lock (vnet_interface_main_t *im)
 
static void vnet_interface_counter_unlock (vnet_interface_main_t *im)
 
void vnet_pcap_drop_trace_filter_add_del (u32 error_index, int is_add)
 
int vnet_interface_name_renumber (u32 sw_if_index, u32 new_show_dev_instance)
 
int vnet_interface_add_del_feature (struct vnet_main_t *vnm, vlib_main_t *vm, u32 sw_if_index, intf_output_feat_t feature, int is_add)
 

Macro Definition Documentation

#define foreach_intf_output_feat   _(IPSEC, "ipsec-output")

Definition at line 493 of file interface.h.

#define INTF_OUTPUT_FEAT_DONE   INTF_OUTPUT_N_FEAT

Definition at line 505 of file interface.h.

#define VNET_DEVICE_CLASS (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_device_class_t x; \
static void __vnet_add_device_class_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_device_class_registration_##x (void) \
{ \
x.next_class_registration = vnm->device_class_registrations; \
vnm->device_class_registrations = &x; \
} \
__VA_ARGS__ vnet_device_class_t x
struct _vnet_device_class vnet_device_class_t
vnet_main_t * vnet_get_main(void)
Definition: misc.c:45
struct vnet_main_t vnet_main_t

Definition at line 154 of file interface.h.

#define VNET_HW_INTERFACE_ADD_DEL_FUNCTION (   f)    _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_add_del)

Definition at line 78 of file interface.h.

#define VNET_HW_INTERFACE_BOND_INFO_NONE   ((uword *) 0)

Definition at line 326 of file interface.h.

#define VNET_HW_INTERFACE_BOND_INFO_SLAVE   ((uword *) ~0)

Definition at line 327 of file interface.h.

#define VNET_HW_INTERFACE_CLASS (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_hw_interface_class_t x; \
static void __vnet_add_hw_interface_class_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_hw_interface_class_registration_##x (void) \
{ \
x.next_class_registration = vnm->hw_interface_class_registrations; \
vnm->hw_interface_class_registrations = &x; \
} \
vnet_main_t * vnet_get_main(void)
Definition: misc.c:45
struct _vnet_hw_interface_class vnet_hw_interface_class_t
struct vnet_main_t vnet_main_t

Definition at line 221 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK
Value:
#define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX
Definition: interface.h:244
#define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX
Definition: interface.h:245

Definition at line 246 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT   1

Definition at line 243 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX   (1 << 2)

Definition at line 245 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX   (1 << 1)

Definition at line 244 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED   (1 << 9)

Definition at line 268 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT   9

Definition at line 267 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_LINK_UP   (1 << 0)

Definition at line 241 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_100G   (1 << 8)

Definition at line 257 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_100M   (1 << 4)

Definition at line 253 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_10G   (1 << 6)

Definition at line 255 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_10M   (1 << 3)

Definition at line 252 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_1G   (1 << 5)

Definition at line 254 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_40G   (1 << 7)

Definition at line 256 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_MASK
Value:
#define VNET_HW_INTERFACE_FLAG_SPEED_1G
Definition: interface.h:254
#define VNET_HW_INTERFACE_FLAG_SPEED_100G
Definition: interface.h:257
#define VNET_HW_INTERFACE_FLAG_SPEED_10M
Definition: interface.h:252
#define VNET_HW_INTERFACE_FLAG_SPEED_10G
Definition: interface.h:255
#define VNET_HW_INTERFACE_FLAG_SPEED_100M
Definition: interface.h:253
#define VNET_HW_INTERFACE_FLAG_SPEED_40G
Definition: interface.h:256

Definition at line 258 of file interface.h.

#define VNET_HW_INTERFACE_FLAG_SPEED_SHIFT   3

Definition at line 251 of file interface.h.

#define VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (   f)    _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_link_up_down)

Definition at line 80 of file interface.h.

#define VNET_SW_INTERFACE_ADD_DEL_FUNCTION (   f)    _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_add_del)

Definition at line 82 of file interface.h.

#define VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (   f)    _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_admin_up_down)

Definition at line 84 of file interface.h.

#define VNET_SW_INTERFACE_FLAG_ADMIN_UP   (1 << 0)

Definition at line 373 of file interface.h.

#define VNET_SW_INTERFACE_FLAG_BOND_SLAVE   (1 << 4)

Definition at line 382 of file interface.h.

#define VNET_SW_INTERFACE_FLAG_PROXY_ARP   (1 << 2)

Definition at line 378 of file interface.h.

#define VNET_SW_INTERFACE_FLAG_PUNT   (1 << 1)

Definition at line 376 of file interface.h.

#define VNET_SW_INTERFACE_FLAG_UNNUMBERED   (1 << 3)

Definition at line 380 of file interface.h.

Typedef Documentation

typedef struct _vnet_device_class vnet_device_class_t
typedef struct _vnet_hw_interface_class vnet_hw_interface_class_t
typedef clib_error_t*( vnet_interface_function_t) (struct vnet_main_t *vnm, u32 if_index, u32 flags)

Definition at line 51 of file interface.h.

typedef clib_error_t*( vnet_subif_add_del_function_t) (struct vnet_main_t *vnm, u32 if_index, struct vnet_sw_interface_t *template, int is_add)

Definition at line 55 of file interface.h.

Enumeration Type Documentation

Enumerator
INTF_OUTPUT_N_FEAT 

Definition at line 497 of file interface.h.

Enumerator
VNET_INTERFACE_COUNTER_DROP 
VNET_INTERFACE_COUNTER_PUNT 
VNET_INTERFACE_COUNTER_IP4 
VNET_INTERFACE_COUNTER_IP6 
VNET_INTERFACE_COUNTER_RX_NO_BUF 
VNET_INTERFACE_COUNTER_RX_MISS 
VNET_INTERFACE_COUNTER_RX_ERROR 
VNET_INTERFACE_COUNTER_TX_ERROR 
VNET_N_SIMPLE_INTERFACE_COUNTER 
VNET_INTERFACE_COUNTER_RX 
VNET_INTERFACE_COUNTER_TX 
VNET_N_COMBINED_INTERFACE_COUNTER 

Definition at line 411 of file interface.h.

Enumerator
VNET_SW_INTERFACE_TYPE_HARDWARE 
VNET_SW_INTERFACE_TYPE_SUB 

Definition at line 331 of file interface.h.

Function Documentation

int vnet_interface_add_del_feature ( struct vnet_main_t vnm,
vlib_main_t vm,
u32  sw_if_index,
intf_output_feat_t  feature,
int  is_add 
)

Definition at line 1056 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vnet_interface_counter_lock ( vnet_interface_main_t im)
inlinestatic

Definition at line 472 of file interface.h.

+ Here is the caller graph for this function:

static void vnet_interface_counter_unlock ( vnet_interface_main_t im)
inlinestatic

Definition at line 478 of file interface.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_interface_name_renumber ( u32  sw_if_index,
u32  new_show_dev_instance 
)

Definition at line 1028 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vnet_pcap_drop_trace_filter_add_del ( u32  error_index,
int  is_add 
)

Definition at line 1118 of file interface_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: