|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 #include <vnet/srmpls/sr_mpls.api_enum.h>
30 #include <vnet/srmpls/sr_mpls.api_types.h>
32 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
34 #define vl_api_version(n, v) static u32 api_version = v;
35 #include <vnet/srmpls/sr_mpls.api.h>
39 #include <vnet/srmpls/sr_mpls.api.h>
43 #include <vnet/srmpls/sr_mpls.api.h>
46 #define vl_msg_name_crc_list
47 #include <vnet/srmpls/sr_mpls.api.h>
48 #undef vl_msg_name_crc_list
50 #define REPLY_MSG_ID_BASE msg_id_base
53 #define foreach_vpe_api_msg \
54 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \
55 _(SR_MPLS_STEERING_ADD_DEL, sr_mpls_steering_add_del) \
56 _(SR_MPLS_POLICY_ASSIGN_ENDPOINT_COLOR, sr_mpls_policy_assign_endpoint_color)
63 vl_api_sr_mpls_policy_add_reply_t *rmp;
73 clib_memcpy (seg, &this_address,
sizeof (this_address));
87 vl_api_sr_mpls_policy_mod_reply_t *rmp;
97 clib_memcpy (seg, &this_address,
sizeof (this_address));
112 vl_api_sr_mpls_policy_del_reply_t *rmp;
122 vl_api_sr_mpls_steering_add_del_reply_t *rmp;
124 ip46_address_t next_hop;
151 REPLY_MACRO (VL_API_SR_MPLS_STEERING_ADD_DEL_REPLY);
157 vl_api_sr_mpls_policy_assign_endpoint_color_reply_t *rmp;
170 REPLY_MACRO (VL_API_SR_MPLS_POLICY_ASSIGN_ENDPOINT_COLOR_REPLY);
176 #define _(id, n, crc) \
177 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + REPLY_MSG_ID_BASE);
178 foreach_vl_msg_name_crc_sr_mpls;
187 u8 *
name =
format (0,
"sr_mpls_%08x%c", api_version, 0);
193 vl_msg_api_set_handlers (REPLY_MSG_ID_BASE + VL_API_##N, #n, \
194 vl_api_##n##_t_handler, vl_noop_handler, \
195 vl_api_##n##_t_endian, vl_api_##n##_t_print, \
196 sizeof (vl_api_##n##_t), 1);
205 "sr_mpls_policy_add",
208 vl_api_sr_mpls_policy_add_t_print, 256, 1);
215 "sr_mpls_policy_mod",
218 vl_api_sr_mpls_policy_mod_t_print, 256, 1);
bool is_del[default=false]
int sr_mpls_policy_assign_endpoint_color(mpls_label_t bsid, ip46_address_t *endpoint, u8 endpoint_type, u32 color)
Update the Endpoint,Color tuple of an SR policy.
#define clib_memcpy(d, s, n)
static void vl_api_sr_mpls_steering_add_del_t_handler(vl_api_sr_mpls_steering_add_del_t *mp)
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
Segment Routing MPLS data structures definitions.
MPLS SR steering add/del.
static void vl_api_sr_mpls_policy_mod_t_handler(vl_api_sr_mpls_policy_mod_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u16 vl_msg_api_get_msg_ids(const char *name, int n)
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
vl_api_address_t endpoint
#define REPLY_MSG_ID_BASE
vl_api_address_t next_hop
MPLS SR steering add/del.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
int sr_mpls_policy_add(mpls_label_t bsid, mpls_label_t *segments, u8 behavior, u32 weight)
Create a new SR policy.
static void setup_message_id_table(api_main_t *am)
static clib_error_t * sr_mpls_api_hookup(vlib_main_t *vm)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
static api_main_t * vlibapi_get_main(void)
static void vl_api_sr_mpls_policy_del_t_handler(vl_api_sr_mpls_policy_del_t *mp)
int sr_mpls_steering_policy_add(mpls_label_t bsid, u32 table_id, ip46_address_t *prefix, u32 mask_width, u8 traffic_type, ip46_address_t *next_hop, u8 nh_type, u32 color, char co_bits, mpls_label_t vpn_label)
Steer traffic L3 traffic through a given SR-MPLS policy.
void vl_msg_api_set_handlers(int msg_id, char *msg_name, void *handler, void *cleanup, void *endian, void *print, int msg_size, int traced)
static void vl_api_sr_mpls_policy_assign_endpoint_color_t_handler(vl_api_sr_mpls_policy_assign_endpoint_color_t *mp)
API main structure, used by both vpp and binary API clients.
#define vec_free(V)
Free vector's memory (no header).
void vl_noop_handler(void *mp)
description fragment has unexpected format
vl_api_sr_policy_op_t operation
vl_api_address_t endpoint
static void vl_api_sr_mpls_policy_add_t_handler(vl_api_sr_mpls_policy_add_t *mp)
#define foreach_vpe_api_msg
int sr_mpls_steering_policy_del(ip46_address_t *prefix, u32 mask_width, u8 traffic_type, u32 table_id, u32 color)
Delete steering rule for an SR-MPLS policy.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 mpls_label_t
A label value only, i.e.
int sr_mpls_policy_del(mpls_label_t bsid)
Delete a SR policy.
VLIB_API_INIT_FUNCTION(sr_mpls_api_hookup)
Aggregate type for a prefix.
MPLS SR policy modification.
int sr_mpls_policy_mod(mpls_label_t bsid, u8 operation, mpls_label_t *segments, u32 sl_index, u32 weight)
Modify an existing SR policy.