FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
mpls_tunnel.h File Reference
+ Include dependency graph for mpls_tunnel.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mpls_tunnel_t_
 A uni-directional MPLS tunnel. More...
 

Macros

#define MPLS_TUNNEL_ATTRIBUTES
 
#define FOR_EACH_MPLS_TUNNEL_ATTRIBUTE(_item)
 

Typedefs

typedef enum mpls_tunnel_attribute_t_ mpls_tunnel_attribute_t
 
typedef enum mpls_tunnel_flag_t_ mpls_tunnel_flags_t
 
typedef struct mpls_tunnel_t_ mpls_tunnel_t
 A uni-directional MPLS tunnel. More...
 
typedef void(* mpls_tunnel_walk_cb_t) (u32 index, void *ctx)
 Callback function invoked while walking MPLS tunnels. More...
 

Enumerations

enum  mpls_tunnel_attribute_t_ { MPLS_TUNNEL_ATTRIBUTE_FIRST = 0, MPLS_TUNNEL_ATTRIBUTE_L2 = MPLS_TUNNEL_ATTRIBUTE_FIRST, MPLS_TUNNEL_ATTRIBUTE_MCAST, MPLS_TUNNEL_ATTRIBUTE_LAST = MPLS_TUNNEL_ATTRIBUTE_MCAST }
 
enum  mpls_tunnel_flag_t_ { MPLS_TUNNEL_FLAG_NONE = 0, MPLS_TUNNEL_FLAG_L2 = (1 << MPLS_TUNNEL_ATTRIBUTE_L2), MPLS_TUNNEL_FLAG_MCAST = (1 << MPLS_TUNNEL_ATTRIBUTE_MCAST) }
 

Functions

u32 vnet_mpls_tunnel_create (u8 l2_only, u8 is_multicast)
 Create a new MPLS tunnel. More...
 
void vnet_mpls_tunnel_path_add (u32 sw_if_index, fib_route_path_t *rpath)
 Add a path to an MPLS tunnel. More...
 
int vnet_mpls_tunnel_path_remove (u32 sw_if_index, fib_route_path_t *rpath)
 remove a path from a tunnel. More...
 
int vnet_mpls_tunnel_get_index (u32 sw_if_index)
 return the tunnel index from the sw_if_index More...
 
void vnet_mpls_tunnel_del (u32 sw_if_index)
 Delete an MPLS tunnel. More...
 
const mpls_tunnel_tmpls_tunnel_get (u32 index)
 
void mpls_tunnel_walk (mpls_tunnel_walk_cb_t cb, void *ctx)
 Walk all the MPLS tunnels. More...
 

Macro Definition Documentation

◆ FOR_EACH_MPLS_TUNNEL_ATTRIBUTE

#define FOR_EACH_MPLS_TUNNEL_ATTRIBUTE (   _item)

◆ MPLS_TUNNEL_ATTRIBUTES

#define MPLS_TUNNEL_ATTRIBUTES
Value:
{ \
[MPLS_TUNNEL_ATTRIBUTE_MCAST] = "multicast", \
}
The tunnel has an underlying multicast LSP.
Definition: mpls_tunnel.h:32
The tunnel is L2 only.
Definition: mpls_tunnel.h:28

Definition at line 36 of file mpls_tunnel.h.

Typedef Documentation

◆ mpls_tunnel_attribute_t

◆ mpls_tunnel_flags_t

◆ mpls_tunnel_t

typedef struct mpls_tunnel_t_ mpls_tunnel_t

A uni-directional MPLS tunnel.

◆ mpls_tunnel_walk_cb_t

typedef void(* mpls_tunnel_walk_cb_t) (u32 index, void *ctx)

Callback function invoked while walking MPLS tunnels.

Definition at line 134 of file mpls_tunnel.h.

Enumeration Type Documentation

◆ mpls_tunnel_attribute_t_

Enumerator
MPLS_TUNNEL_ATTRIBUTE_FIRST 
MPLS_TUNNEL_ATTRIBUTE_L2 

The tunnel is L2 only.

MPLS_TUNNEL_ATTRIBUTE_MCAST 

The tunnel has an underlying multicast LSP.

MPLS_TUNNEL_ATTRIBUTE_LAST 

Definition at line 22 of file mpls_tunnel.h.

◆ mpls_tunnel_flag_t_

Enumerator
MPLS_TUNNEL_FLAG_NONE 
MPLS_TUNNEL_FLAG_L2 
MPLS_TUNNEL_FLAG_MCAST 

Definition at line 45 of file mpls_tunnel.h.

Function Documentation

◆ mpls_tunnel_get()

const mpls_tunnel_t* mpls_tunnel_get ( u32  index)

Definition at line 566 of file mpls_tunnel.c.

+ Here is the caller graph for this function:

◆ mpls_tunnel_walk()

void mpls_tunnel_walk ( mpls_tunnel_walk_cb_t  cb,
void *  ctx 
)

Walk all the MPLS tunnels.

Definition at line 575 of file mpls_tunnel.c.

+ Here is the caller graph for this function:

◆ vnet_mpls_tunnel_create()

u32 vnet_mpls_tunnel_create ( u8  l2_only,
u8  is_multicast 
)

Create a new MPLS tunnel.

Returns
the SW Interface index of the newly created tuneel

Definition at line 608 of file mpls_tunnel.c.

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

◆ vnet_mpls_tunnel_del()

void vnet_mpls_tunnel_del ( u32  sw_if_index)

Delete an MPLS tunnel.

Definition at line 587 of file mpls_tunnel.c.

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

◆ vnet_mpls_tunnel_get_index()

int vnet_mpls_tunnel_get_index ( u32  sw_if_index)

return the tunnel index from the sw_if_index

Definition at line 780 of file mpls_tunnel.c.

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

◆ vnet_mpls_tunnel_path_add()

void vnet_mpls_tunnel_path_add ( u32  sw_if_index,
fib_route_path_t rpath 
)

Add a path to an MPLS tunnel.

Definition at line 654 of file mpls_tunnel.c.

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

◆ vnet_mpls_tunnel_path_remove()

int vnet_mpls_tunnel_path_remove ( u32  sw_if_index,
fib_route_path_t rpath 
)

remove a path from a tunnel.

Returns
the number of remaining paths. 0 implies the tunnel can be deleted

Definition at line 710 of file mpls_tunnel.c.

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