40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_vpe_api_msg \ 48 _(SR_MPLS_POLICY_DEL, sr_mpls_policy_del) \ 49 _(SR_MPLS_STEERING_ADD_DEL, sr_mpls_steering_add_del) \ 50 _(SR_MPLS_POLICY_ASSIGN_ENDPOINT_COLOR, sr_mpls_policy_assign_endpoint_color) 56 vl_api_sr_mpls_policy_add_reply_t *rmp;
65 this_address = ntohl (mp->
segments[i]);
66 clib_memcpy (seg, &this_address,
sizeof (this_address));
80 vl_api_sr_mpls_policy_mod_reply_t *rmp;
89 this_address = ntohl (mp->
segments[i]);
90 clib_memcpy (seg, &this_address,
sizeof (this_address));
105 vl_api_sr_mpls_policy_del_reply_t *rmp;
115 vl_api_sr_mpls_steering_add_del_reply_t *rmp;
117 ip46_address_t next_hop;
144 REPLY_MACRO (VL_API_SR_MPLS_STEERING_ADD_DEL_REPLY);
150 vl_api_sr_mpls_policy_assign_endpoint_color_reply_t *rmp;
154 clib_memset (&endpoint, 0,
sizeof (ip46_address_t));
163 REPLY_MACRO (VL_API_SR_MPLS_POLICY_ASSIGN_ENDPOINT_COLOR_REPLY);
171 #define vl_msg_name_crc_list 173 #undef vl_msg_name_crc_list 178 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 179 foreach_vl_msg_name_crc_sr_mpls;
189 vl_msg_api_set_handlers(VL_API_##N, #n, \ 190 vl_api_##n##_t_handler, \ 192 vl_api_##n##_t_endian, \ 193 vl_api_##n##_t_print, \ 194 sizeof(vl_api_##n##_t), 1); 203 "sr_mpls_policy_add",
206 vl_api_sr_mpls_policy_add_t_endian,
214 "sr_mpls_policy_mod",
217 vl_api_sr_mpls_policy_mod_t_endian,
218 vl_api_sr_mpls_policy_mod_t_print, 256, 1);
MPLS SR steering add/del.
static void * vl_api_sr_mpls_policy_add_t_print(vl_api_sr_mpls_policy_add_t *mp, void *handle)
vl_api_address_t endpoint
bool is_del[default=false]
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void vl_noop_handler(void *mp)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
u32 mpls_label_t
A label value only, i.e.
MPLS SR steering add/del.
MPLS SR policy modification.
#define clib_memcpy(d, s, n)
static void vl_api_sr_mpls_policy_mod_t_handler(vl_api_sr_mpls_policy_mod_t *mp)
static void vl_api_sr_mpls_steering_add_del_t_handler(vl_api_sr_mpls_steering_add_del_t *mp)
static clib_error_t * sr_mpls_api_hookup(vlib_main_t *vm)
int sr_mpls_policy_add(mpls_label_t bsid, mpls_label_t *segments, u8 behavior, u32 weight)
Create a new SR policy.
vl_api_sr_policy_op_t operation
Aggregate type for a prefix.
u16 fp_len
The mask length.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
static void setup_message_id_table(api_main_t *am)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
vl_api_address_t next_hop
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)
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.
API main structure, used by both vpp and binary API clients.
vl_api_address_t endpoint
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_sr_mpls_policy_del_t_handler(vl_api_sr_mpls_policy_del_t *mp)
int sr_mpls_policy_del(mpls_label_t bsid)
Delete a SR policy.
#define foreach_vpe_api_msg
static void vl_api_sr_mpls_policy_assign_endpoint_color_t_handler(vl_api_sr_mpls_policy_assign_endpoint_color_t *mp)
VLIB_API_INIT_FUNCTION(sr_mpls_api_hookup)
static void vl_api_sr_mpls_policy_add_t_handler(vl_api_sr_mpls_policy_add_t *mp)
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.
Segment Routing MPLS data structures definitions.
static api_main_t * vlibapi_get_main(void)
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.
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.