FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
edit.h File Reference
+ Include dependency graph for edit.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pg_edit_t
 

Macros

#define PG_EDIT_PACKET_LENGTH   (-1)
 
#define PG_EDIT_LO   0
 
#define PG_EDIT_HI   1
 
#define pg_edit_init_bitfield(e, type, field, field_offset, field_n_bits)
 
#define pg_edit_init(e, type, field)   pg_edit_init_bitfield(e,type,field,0,STRUCT_BITS_OF(type,field))
 

Enumerations

enum  pg_edit_type_t {
  PG_EDIT_INVALID_TYPE, PG_EDIT_FIXED, PG_EDIT_INCREMENT, PG_EDIT_RANDOM,
  PG_EDIT_UNSPECIFIED
}
 

Functions

static void pg_edit_free (pg_edit_t *e)
 
static uword pg_edit_n_alloc_bytes (pg_edit_t *e)
 
static void pg_edit_alloc_value (pg_edit_t *e, int i)
 
void pg_edit_set_value (pg_edit_t *e, int hi_or_lo, u64 value)
 
static void pg_edit_set_fixed (pg_edit_t *e, u64 value)
 
static void pg_edit_copy_type_and_values (pg_edit_t *dst, pg_edit_t *src)
 
static u64 pg_edit_get_value (pg_edit_t *e, int hi_or_lo)
 
static uword pg_edit_is_fixed_with_value (pg_edit_t *e, u64 value)
 
uword unformat_pg_edit (unformat_input_t *input, va_list *args)
 
uword unformat_pg_payload (unformat_input_t *input, va_list *args)
 
uword unformat_pg_number (unformat_input_t *input, va_list *args)
 
uword unformat_pg_interface (unformat_input_t *input, va_list *args)
 

Macro Definition Documentation

#define PG_EDIT_HI   1

Definition at line 84 of file edit.h.

#define pg_edit_init (   e,
  type,
  field 
)    pg_edit_init_bitfield(e,type,field,0,STRUCT_BITS_OF(type,field))

Definition at line 116 of file edit.h.

#define pg_edit_init_bitfield (   e,
  type,
  field,
  field_offset,
  field_n_bits 
)
Value:
do { \
u32 _bo; \
ASSERT ((field_offset) < STRUCT_BITS_OF (type, field)); \
\
/* Start byte offset. */ \
_bo = STRUCT_OFFSET_OF (type, field); \
\
/* Adjust for big endian byte order. */ \
_bo += ((STRUCT_BITS_OF (type, field) \
- (field_offset) - 1) / BITS (u8)); \
\
(e)->lsb_bit_offset = _bo * BITS (u8) + ((field_offset) % BITS (u8)); \
(e)->n_bits = (field_n_bits); \
} while (0)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define STRUCT_BITS_OF(t, f)
Definition: clib.h:65
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:62
#define ASSERT(truth)
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56
#define BITS(x)
Definition: clib.h:58

Definition at line 98 of file edit.h.

#define PG_EDIT_LO   0

Definition at line 83 of file edit.h.

#define PG_EDIT_PACKET_LENGTH   (-1)

Definition at line 76 of file edit.h.

Enumeration Type Documentation

Enumerator
PG_EDIT_INVALID_TYPE 
PG_EDIT_FIXED 
PG_EDIT_INCREMENT 
PG_EDIT_RANDOM 
PG_EDIT_UNSPECIFIED 

Definition at line 46 of file edit.h.

Function Documentation

static void pg_edit_alloc_value ( pg_edit_t e,
int  i 
)
inlinestatic

Definition at line 145 of file edit.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void pg_edit_copy_type_and_values ( pg_edit_t dst,
pg_edit_t src 
)
inlinestatic

Definition at line 160 of file edit.h.

+ Here is the caller graph for this function:

static void pg_edit_free ( pg_edit_t e)
inlinestatic

Definition at line 91 of file edit.h.

+ Here is the caller graph for this function:

static u64 pg_edit_get_value ( pg_edit_t e,
int  hi_or_lo 
)
inlinestatic

Definition at line 173 of file edit.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword pg_edit_is_fixed_with_value ( pg_edit_t e,
u64  value 
)
inlinestatic

Definition at line 191 of file edit.h.

+ Here is the call graph for this function:

static uword pg_edit_n_alloc_bytes ( pg_edit_t e)
inlinestatic

Definition at line 120 of file edit.h.

+ Here is the caller graph for this function:

static void pg_edit_set_fixed ( pg_edit_t e,
u64  value 
)
inlinestatic

Definition at line 153 of file edit.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pg_edit_set_value ( pg_edit_t e,
int  hi_or_lo,
u64  value 
)

Definition at line 77 of file edit.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_pg_edit ( unformat_input_t input,
va_list *  args 
)

Definition at line 106 of file edit.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_pg_interface ( unformat_input_t input,
va_list *  args 
)

+ Here is the caller graph for this function:

uword unformat_pg_number ( unformat_input_t input,
va_list *  args 
)

Definition at line 85 of file edit.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_pg_payload ( unformat_input_t input,
va_list *  args 
)

Definition at line 127 of file edit.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: