39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define foreach_vpe_api_msg \ 47 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \ 48 _(SR_POLICY_DEL, sr_policy_del) \ 49 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \ 50 _(SR_SET_ENCAP_SOURCE, sr_set_encap_source) \ 51 _(SR_LOCALSIDS_DUMP, sr_localsids_dump) 57 vl_api_sr_localsid_add_del_reply_t *rmp;
84 vl_api_sr_policy_add_reply_t *rmp;
112 vl_api_sr_policy_mod_reply_t *rmp;
144 vl_api_sr_policy_del_reply_t *rmp;
159 vl_api_sr_set_encap_source_reply_t *rmp;
169 vl_api_sr_steering_add_del_reply_t *rmp;
199 memset (rmp, 0,
sizeof (*rmp));
200 rmp->_vl_msg_id = ntohs (VL_API_SR_LOCALSIDS_DETAILS);
228 send_sr_localsid_details(t, q, mp->context);
241 #define vl_msg_name_crc_list 243 #undef vl_msg_name_crc_list 248 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 249 foreach_vl_msg_name_crc_sr;
259 vl_msg_api_set_handlers(VL_API_##N, #n, \ 260 vl_api_##n##_t_handler, \ 262 vl_api_##n##_t_endian, \ 263 vl_api_##n##_t_print, \ 264 sizeof(vl_api_##n##_t), 1); 276 vl_api_sr_policy_add_t_endian,
287 vl_api_sr_policy_mod_t_endian,
sll srl srl sll sra u16x4 i
void sr_set_source(ip6_address_t *address)
int sr_cli_localsid(char is_del, ip6_address_t *localsid_addr, char end_psp, u8 behavior, u32 sw_if_index, u32 vlan_index, u32 fib_table, ip46_address_t *nh_addr, void *ls_plugin_mem)
SR localsid add/del.
int sr_steering_policy(int is_del, ip6_address_t *bsid, u32 sr_policy_index, u32 table_id, ip46_address_t *prefix, u32 mask_width, u32 sw_if_index, u8 traffic_type)
Steer traffic L2 and L3 traffic through a given SR policy.
static void vl_api_sr_policy_add_t_handler(vl_api_sr_policy_add_t *mp)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
u16 behavior
Behavior associated to this localsid.
static void vl_api_sr_steering_add_del_t_handler(vl_api_sr_steering_add_del_t *mp)
static void * vl_api_sr_policy_add_t_print(vl_api_sr_policy_add_t *mp, void *handle)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void vl_api_sr_policy_mod_t_handler(vl_api_sr_policy_mod_t *mp)
void * vl_msg_api_alloc(int nbytes)
static void vl_api_sr_localsids_dump_t_handler(vl_api_sr_localsids_dump_t *mp)
static void setup_message_id_table(api_main_t *am)
u32 xconnect_iface_or_vrf_table
char end_psp
Combined with End.PSP?
API main structure, used by both vpp and binary API clients.
ip6_sr_localsid_t * localsids
#define BAD_SW_IF_INDEX_LABEL
VLIB_API_INIT_FUNCTION(sr_api_hookup)
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_policy_del(ip6_address_t *bsid, u32 index)
Delete a SR policy.
int sr_policy_add(ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 behavior, u32 fib_table, u8 is_encap)
Create a new SR policy.
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
void vl_noop_handler(void *mp)
IPv6 SR Set SRv6 encapsulation source.
IPv6 SR steering add/del.
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
#define foreach_vpe_api_msg
u32 fib_table
FIB table where localsid is registered.
static void * vl_api_sr_policy_mod_t_print(vl_api_sr_policy_mod_t *mp, void *handle)
static void vl_api_sr_policy_del_t_handler(vl_api_sr_policy_del_t *mp)
static clib_error_t * sr_api_hookup(vlib_main_t *vm)
Segment Routing data structures definitions.
Segment Routing main datastructure.
IPv6 SR policy modification.
ip46_address_t next_hop
Next_hop for xconnect usage only.
static void vl_api_sr_localsid_add_del_t_handler(vl_api_sr_localsid_add_del_t *mp)
u32 sw_if_index
xconnect only
IPv6 SR LocalSID add/del request.
ip6_address_t localsid
LocalSID IPv6 address.
static void vl_api_sr_set_encap_source_t_handler(vl_api_sr_set_encap_source_t *mp)
int sr_policy_mod(ip6_address_t *bsid, u32 index, u32 fib_table, u8 operation, ip6_address_t *segments, u32 sl_index, u32 weight)
Modify an existing SR policy.
#define VALIDATE_SW_IF_INDEX(mp)
struct _unix_shared_memory_queue unix_shared_memory_queue_t
static void send_sr_localsid_details(ip6_sr_localsid_t *t, unix_shared_memory_queue_t *q, u32 context)
Dump the list of SR LocalSIDs.