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

Go to the source code of this file.

Data Structures

struct  scv_profile_
 Usage: More...
 

Macros

#define MAXDEGREE   1024
 
#define MAXTOKENLEN   128
 
#define debug_ioam   debug_ioam_fn
 
#define MAX_SERVICE_NODES   10
 
#define PATH_NAME_SIZE   256
 
#define MAX_SERVICE_PROFILES   16
 
#define MAX_BITS   64
 

Typedefs

typedef struct scv_profile_ scv_profile
 Usage: More...
 

Functions

void scv_init (u8 *path_name, u8 max, u8 indx)
 
u8 scv_get_max_profiles (void)
 
scv_profilescv_profile_find (u16 id)
 
static u16 scv_profile_get_id (scv_profile *profile)
 
void scv_profile_create (scv_profile *profile, u64 prime, u64 poly2, u64 lpc, u64 secret_share, u64 validity)
 
void scv_set_validator (scv_profile *profile, u64 key)
 
void scv_profile_cleanup (scv_profile *profile)
 
void scv_profile_set_bit_mask (scv_profile *profile, u16 bits)
 
u64 scv_update_cumulative (scv_profile *profile, u64 cumulative, u64 random)
 
u8 scv_validate (scv_profile *profile, u64 cumulative, u64 random)
 
u64 scv_generate_random (scv_profile *profile)
 
int scv_profile_to_str (scv_profile *profile, char *buf, int n)
 
void clear_ioam_scv_profiles ()
 
static u8 scv_get_profile_in_use (void)
 
static void scv_notification_reset (u16 start_index_recvd, u8 num_profiles_recvd)
 
int scv_profile_renew (u8 *path_name, u8 start_index, u8 num_profiles)
 
int scv_profile_refresh (u8 *path_name, u8 start_index, u8 num_profiles)
 
static u8 scv_is_decap (scv_profile *p)
 
static u16 scv_get_next_profile_id (vlib_main_t *vm, u16 id)
 
static void scv_profile_invalidate (vlib_main_t *vm, ip6_hop_by_hop_main_t *hm, u16 id, u8 is_encap)
 

Variables

scv_profilepow_profile
 
u16 pow_profile_index
 
u64 total_pkts_using_this_profile
 
u8 chain_path_name [PATH_NAME_SIZE]
 
u16 invalid_profile_start_index
 
u8 number_of_invalid_profiles
 
f64 next_time_to_send
 
u32 time_exponent
 

Macro Definition Documentation

#define debug_ioam   debug_ioam_fn

Definition at line 24 of file scv_util.h.

#define MAX_BITS   64

Definition at line 117 of file scv_util.h.

#define MAX_SERVICE_NODES   10

Definition at line 25 of file scv_util.h.

#define MAX_SERVICE_PROFILES   16

Definition at line 31 of file scv_util.h.

#define MAXDEGREE   1024

Definition at line 22 of file scv_util.h.

#define MAXTOKENLEN   128

Definition at line 23 of file scv_util.h.

#define PATH_NAME_SIZE   256

Definition at line 27 of file scv_util.h.

Typedef Documentation

typedef struct scv_profile_ scv_profile

Usage:

On any [service] node that participates in Service / Path verfication:

Step 1: Initialize this library by calling scv_init() Step 2: Setup a Service chain validation profile that contains all the parameters needed to compute cumulative: Call these functions: scv_profile_find scv_profile_create scv_profile_set_bit_mask - To setup how large we want the numbers used in the computation and random number <= 64 bits Step 2a: For validator do this: scv_set_validator Step 3a: At the initial Service node to generate Random number that will be read by all other nodes: scv_generate_random Step 3b: At all service nodes including initial and verifier call this to compute cumulative: scv_update_cumulative Step 4: At the verifier: scv_validate

Function Documentation

void clear_ioam_scv_profiles ( )
u64 scv_generate_random ( scv_profile profile)

Definition at line 181 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8 scv_get_max_profiles ( void  )

Definition at line 47 of file scv_util.c.

+ Here is the caller graph for this function:

static u16 scv_get_next_profile_id ( vlib_main_t vm,
u16  id 
)
inlinestatic

Definition at line 182 of file scv_util.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 scv_get_profile_in_use ( void  )
inlinestatic

Definition at line 139 of file scv_util.h.

void scv_init ( u8 path_name,
u8  max,
u8  indx 
)

Definition at line 64 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 scv_is_decap ( scv_profile p)
inlinestatic

Definition at line 177 of file scv_util.h.

+ Here is the caller graph for this function:

static void scv_notification_reset ( u16  start_index_recvd,
u8  num_profiles_recvd 
)
inlinestatic

Definition at line 145 of file scv_util.h.

+ Here is the call graph for this function:

void scv_profile_cleanup ( scv_profile profile)

Definition at line 84 of file scv_util.c.

+ Here is the caller graph for this function:

void scv_profile_create ( scv_profile profile,
u64  prime,
u64  poly2,
u64  lpc,
u64  secret_share,
u64  validity 
)

Definition at line 92 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

scv_profile* scv_profile_find ( u16  id)

Definition at line 52 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 scv_profile_get_id ( scv_profile profile)
inlinestatic

Definition at line 96 of file scv_util.h.

+ Here is the call graph for this function:

static void scv_profile_invalidate ( vlib_main_t vm,
ip6_hop_by_hop_main_t hm,
u16  id,
u8  is_encap 
)
inlinestatic

Definition at line 209 of file scv_util.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int scv_profile_refresh ( u8 path_name,
u8  start_index,
u8  num_profiles 
)

+ Here is the caller graph for this function:

int scv_profile_renew ( u8 path_name,
u8  start_index,
u8  num_profiles 
)

+ Here is the caller graph for this function:

void scv_profile_set_bit_mask ( scv_profile profile,
u16  bits 
)

Definition at line 211 of file scv_util.c.

+ Here is the caller graph for this function:

int scv_profile_to_str ( scv_profile profile,
char *  buf,
int  n 
)
void scv_set_validator ( scv_profile profile,
u64  key 
)

Definition at line 109 of file scv_util.c.

+ Here is the caller graph for this function:

u64 scv_update_cumulative ( scv_profile profile,
u64  cumulative,
u64  random 
)

Definition at line 140 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8 scv_validate ( scv_profile profile,
u64  cumulative,
u64  random 
)

Definition at line 168 of file scv_util.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

u8 chain_path_name[PATH_NAME_SIZE]

Definition at line 26 of file scv_util.c.

u16 invalid_profile_start_index

Definition at line 29 of file scv_util.c.

f64 next_time_to_send

Definition at line 31 of file scv_util.c.

u8 number_of_invalid_profiles

Definition at line 30 of file scv_util.c.

scv_profile* pow_profile

Definition at line 23 of file scv_util.c.

u16 pow_profile_index

Definition at line 24 of file scv_util.c.

u32 time_exponent

Definition at line 32 of file scv_util.c.

u64 total_pkts_using_this_profile

Definition at line 25 of file scv_util.c.