FD.io VPP  v20.09-64-g4f7b92f0a
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

◆ PG_EDIT_HI

#define PG_EDIT_HI   1

Definition at line 84 of file edit.h.

◆ pg_edit_init

#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.

◆ pg_edit_init_bitfield

#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)
#define STRUCT_BITS_OF(t, f)
Definition: clib.h:73
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:70
unsigned char u8
Definition: types.h:56
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ASSERT(truth)
#define BITS(x)
Definition: clib.h:66

Definition at line 98 of file edit.h.

◆ PG_EDIT_LO

#define PG_EDIT_LO   0

Definition at line 83 of file edit.h.

◆ PG_EDIT_PACKET_LENGTH

#define PG_EDIT_PACKET_LENGTH   (-1)

Definition at line 76 of file edit.h.

Enumeration Type Documentation

◆ pg_edit_type_t

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

◆ pg_edit_alloc_value()

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:

◆ pg_edit_copy_type_and_values()

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:

◆ pg_edit_free()

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:

◆ pg_edit_get_value()

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:

◆ pg_edit_is_fixed_with_value()

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:

◆ pg_edit_n_alloc_bytes()

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:

◆ pg_edit_set_fixed()

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:

◆ pg_edit_set_value()

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:

◆ unformat_pg_edit()

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:

◆ unformat_pg_interface()

uword unformat_pg_interface ( unformat_input_t input,
va_list *  args 
)
+ Here is the caller graph for this function:

◆ unformat_pg_number()

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:

◆ unformat_pg_payload()

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: