FD.io VPP  v20.05.1-5-g09f167997
Vector Packet Processing
pot_util.h File Reference
+ Include dependency graph for pot_util.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pot_profile_
 Usage: More...
 
struct  pot_main_t
 

Macros

#define debug_ioam   debug_ioam_fn
 
#define PATH_NAME_SIZE   256
 
#define MAX_POT_PROFILES   2
 
#define MAX_BITS   64
 

Typedefs

typedef struct pot_profile_ pot_profile
 Usage: More...
 

Functions

int pot_util_init (void)
 
void pot_profile_list_init (u8 *name)
 
pot_profilepot_profile_find (u8 id)
 
static u16 pot_profile_get_id (pot_profile *profile)
 
int pot_profile_create (pot_profile *profile, u64 prime, u64 poly2, u64 lpc, u64 secret_share)
 
int pot_set_validator (pot_profile *profile, u64 key)
 
int pot_profile_set_bit_mask (pot_profile *profile, u16 bits)
 
u64 pot_update_cumulative (pot_profile *profile, u64 cumulative, u64 random)
 
u8 pot_validate (pot_profile *profile, u64 cumulative, u64 random)
 
u64 pot_generate_random (pot_profile *profile)
 
void clear_pot_profiles ()
 
int pot_profile_list_is_enabled (u8 *name)
 
static u8 pot_is_decap (pot_profile *p)
 
static int pot_profile_set_active (u8 id)
 
static u8 pot_profile_get_active_id (void)
 
static pot_profilepot_profile_get_active (void)
 
static void pot_profile_reset_usage_stats (pot_profile *pow)
 
static void pot_profile_incr_usage_stats (pot_profile *pow)
 

Variables

pot_main_t pot_main
 

Macro Definition Documentation

◆ debug_ioam

#define debug_ioam   debug_ioam_fn

Definition at line 22 of file pot_util.h.

◆ MAX_BITS

#define MAX_BITS   64

Definition at line 121 of file pot_util.h.

◆ MAX_POT_PROFILES

#define MAX_POT_PROFILES   2

Definition at line 28 of file pot_util.h.

◆ PATH_NAME_SIZE

#define PATH_NAME_SIZE   256

Definition at line 24 of file pot_util.h.

Typedef Documentation

◆ pot_profile

typedef struct pot_profile_ pot_profile

Usage:

On any node that participates in Proof of Transit:

Step 1: Initialize this library by calling pot_init() Step 2: Setup a proof of transit profile that contains all the parameters needed to compute cumulative: Call these functions: pot_profile_find pot_profile_create pot_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: pot_set_validator Step 2b: On initial node enable the profile to be used: pot_profile_set_active / pot_profile_get_active will return the profile Step 3a: At the initial node to generate Random number that will be read by all other nodes: pot_generate_random Step 3b: At all nodes including initial and verifier call this to compute cumulative: pot_update_cumulative Step 4: At the verifier: pot_validate

Function Documentation

◆ clear_pot_profiles()

void clear_pot_profiles ( )

Definition at line 264 of file pot_util.c.

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

◆ pot_generate_random()

u64 pot_generate_random ( pot_profile profile)

Definition at line 210 of file pot_util.c.

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

◆ pot_is_decap()

static u8 pot_is_decap ( pot_profile p)
inlinestatic

Definition at line 143 of file pot_util.h.

+ Here is the caller graph for this function:

◆ pot_profile_create()

int pot_profile_create ( pot_profile profile,
u64  prime,
u64  poly2,
u64  lpc,
u64  secret_share 
)

Definition at line 117 of file pot_util.c.

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

◆ pot_profile_find()

pot_profile* pot_profile_find ( u8  id)

Definition at line 58 of file pot_util.c.

+ Here is the caller graph for this function:

◆ pot_profile_get_active()

static pot_profile* pot_profile_get_active ( void  )
inlinestatic

Definition at line 170 of file pot_util.h.

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

◆ pot_profile_get_active_id()

static u8 pot_profile_get_active_id ( void  )
inlinestatic

Definition at line 164 of file pot_util.h.

+ Here is the caller graph for this function:

◆ pot_profile_get_id()

static u16 pot_profile_get_id ( pot_profile profile)
inlinestatic

Definition at line 101 of file pot_util.h.

+ Here is the call graph for this function:

◆ pot_profile_incr_usage_stats()

static void pot_profile_incr_usage_stats ( pot_profile pow)
inlinestatic

Definition at line 187 of file pot_util.h.

+ Here is the caller graph for this function:

◆ pot_profile_list_init()

void pot_profile_list_init ( u8 name)

Definition at line 85 of file pot_util.c.

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

◆ pot_profile_list_is_enabled()

int pot_profile_list_is_enabled ( u8 name)

Definition at line 79 of file pot_util.c.

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

◆ pot_profile_reset_usage_stats()

static void pot_profile_reset_usage_stats ( pot_profile pow)
inlinestatic

Definition at line 180 of file pot_util.h.

+ Here is the caller graph for this function:

◆ pot_profile_set_active()

static int pot_profile_set_active ( u8  id)
inlinestatic

Definition at line 148 of file pot_util.h.

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

◆ pot_profile_set_bit_mask()

int pot_profile_set_bit_mask ( pot_profile profile,
u16  bits 
)

Definition at line 240 of file pot_util.c.

+ Here is the caller graph for this function:

◆ pot_set_validator()

int pot_set_validator ( pot_profile profile,
u64  key 
)

Definition at line 136 of file pot_util.c.

+ Here is the caller graph for this function:

◆ pot_update_cumulative()

u64 pot_update_cumulative ( pot_profile profile,
u64  cumulative,
u64  random 
)

Definition at line 169 of file pot_util.c.

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

◆ pot_util_init()

int pot_util_init ( void  )

Definition at line 42 of file pot_util.c.

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

◆ pot_validate()

u8 pot_validate ( pot_profile profile,
u64  cumulative,
u64  random 
)

Definition at line 197 of file pot_util.c.

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

Variable Documentation

◆ pot_main

pot_main_t pot_main

Definition at line 23 of file pot_util.c.