FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
sr.h File Reference

Segment Routing MPLS data structures definitions. More...

+ Include dependency graph for sr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mpls_sr_sl_t
 SR Segment List (SID list) More...
 
struct  mpls_sr_policy_t
 
struct  sr_mpls_steering_key_t
 Steering db key. More...
 
struct  mpls_sr_steering_policy_t
 
struct  mpls_sr_main_t
 Segment Routing main datastructure. More...
 

Macros

#define SR_POLICY_TYPE_DEFAULT   0
 
#define SR_POLICY_TYPE_SPRAY   1
 
#define SR_SEGMENT_LIST_WEIGHT_DEFAULT   1
 
#define SR_STEER_IPV4   4
 
#define SR_STEER_IPV6   6
 

Functions

int sr_mpls_policy_add (mpls_label_t bsid, mpls_label_t *segments, u8 behavior, u32 weight)
 Create a new SR policy. More...
 
int sr_mpls_policy_mod (mpls_label_t bsid, u32 index, u8 operation, mpls_label_t *segments, u32 sl_index, u32 weight)
 Modify an existing SR policy. More...
 
int sr_mpls_policy_del (mpls_label_t bsid, u32 index)
 Delete a SR policy. More...
 

Variables

mpls_sr_main_t sr_mpls_main
 

Detailed Description

Segment Routing MPLS data structures definitions.

Definition in file sr.h.

Macro Definition Documentation

#define SR_POLICY_TYPE_DEFAULT   0

Definition at line 37 of file sr.h.

#define SR_POLICY_TYPE_SPRAY   1

Definition at line 38 of file sr.h.

#define SR_SEGMENT_LIST_WEIGHT_DEFAULT   1

Definition at line 40 of file sr.h.

#define SR_STEER_IPV4   4

Definition at line 42 of file sr.h.

#define SR_STEER_IPV6   6

Definition at line 43 of file sr.h.

Function Documentation

int sr_mpls_policy_add ( mpls_label_t  bsid,
mpls_label_t segments,
u8  behavior,
u32  weight 
)

Create a new SR policy.

Parameters
bsidis the bindingSID of the SR Policy
segmentsis a vector of MPLS labels composing the segment list
behavioris the behavior of the SR policy. (default//spray)
fib_tableis the VRF where to install the FIB entry for the BSID
weightis the weight of this specific SID list
Returns
0 if correct, else error

Definition at line 137 of file sr_mpls_policy.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int sr_mpls_policy_del ( mpls_label_t  bsid,
u32  index 
)

Delete a SR policy.

Parameters
bsidis the bindingSID of the SR Policy
indexis the index of the SR policy
Returns
0 if correct, else error

Definition at line 176 of file sr_mpls_policy.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int sr_mpls_policy_mod ( mpls_label_t  bsid,
u32  index,
u8  operation,
mpls_label_t segments,
u32  sl_index,
u32  weight 
)

Modify an existing SR policy.

The possible modifications are adding a new Segment List, modifying an existing Segment List (modify the weight only) and delete a given Segment List from the SR Policy.

Parameters
bsidis the bindingSID of the SR Policy
indexis the index of the SR policy
fib_tableis the VRF where to install the FIB entry for the BSID
operationis the operation to perform (among the top ones)
segmentsis a vector of IPv6 address composing the segment list
sl_indexis the index of the Segment List to modify/delete
weightis the weight of the sid list. optional.
Returns
0 if correct, else error

Definition at line 262 of file sr_mpls_policy.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

mpls_sr_main_t sr_mpls_main

Definition at line 44 of file sr_mpls_policy.c.