|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
49 #define foreach_vpe_api_msg \
50 _(SR_LOCALSID_ADD_DEL, sr_localsid_add_del) \
51 _(SR_POLICY_ADD, sr_policy_add) \
52 _(SR_POLICY_MOD, sr_policy_mod) \
53 _(SR_POLICY_DEL, sr_policy_del) \
54 _(SR_STEERING_ADD_DEL, sr_steering_add_del) \
55 _(SR_SET_ENCAP_SOURCE, sr_set_encap_source) \
56 _(SR_SET_ENCAP_HOP_LIMIT, sr_set_encap_hop_limit) \
57 _(SR_LOCALSIDS_DUMP, sr_localsids_dump) \
58 _(SR_POLICIES_DUMP, sr_policies_dump) \
59 _(SR_POLICIES_WITH_SL_INDEX_DUMP, sr_policies_with_sl_index_dump) \
60 _(SR_STEERING_POL_DUMP, sr_steering_pol_dump)
65 vl_api_sr_localsid_add_del_reply_t *rmp;
68 ip6_address_t localsid;
97 vl_api_sr_policy_add_reply_t *rmp;
98 ip6_address_t *segments = 0, *seg;
99 ip6_address_t bsid_addr;
102 for (
i = 0;
i < mp->
sids.num_sids;
i++)
118 ntohl (mp->
sids.weight),
129 vl_api_sr_policy_mod_reply_t *rmp;
130 ip6_address_t *segments = 0, *seg;
131 ip6_address_t bsid_addr;
134 for (
i = 0;
i < mp->
sids.num_sids;
i++)
154 ntohl (mp->
sids.weight));
163 vl_api_sr_policy_del_reply_t *rmp;
165 ip6_address_t bsid_addr;
179 vl_api_sr_set_encap_source_reply_t *rmp;
181 ip6_address_t encaps_source;
192 vl_api_sr_set_encap_hop_limit_reply_t *rmp;
196 rv = VNET_API_ERROR_INVALID_VALUE;
206 vl_api_sr_steering_add_del_reply_t *rmp;
208 ip6_address_t bsid_addr;
209 ip46_address_t prefix_addr;
242 rmp->_vl_msg_id =
ntohs (VL_API_SR_LOCALSIDS_DETAILS);
291 ip6_address_t *segment;
292 vl_api_srv6_sid_list_t *api_sid_list;
296 sizeof (vl_api_srv6_sid_list_t));
300 sizeof (vl_api_srv6_sid_list_t)));
302 rmp->_vl_msg_id =
ntohs (VL_API_SR_POLICIES_DETAILS);
317 api_sid_list->weight = htonl (segment_list->
weight);
358 ip6_address_t *segment;
359 vl_api_srv6_sid_list_with_sl_index_t *api_sid_list;
363 sizeof (vl_api_srv6_sid_list_with_sl_index_t));
367 sizeof (vl_api_srv6_sid_list_with_sl_index_t)));
369 rmp->_vl_msg_id =
ntohs (VL_API_SR_POLICIES_WITH_SL_INDEX_DETAILS);
382 api_sid_list->sl_index = htonl (*
sl_index);
384 api_sid_list->weight = htonl (segment_list->
weight);
424 rmp->_vl_msg_id =
ntohs (VL_API_SR_STEERING_POL_DETAILS);
470 #define vl_msg_name_crc_list
472 #undef vl_msg_name_crc_list
477 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
478 foreach_vl_msg_name_crc_sr;
488 vl_msg_api_set_handlers(VL_API_##N, #n, \
489 vl_api_##n##_t_handler, \
491 vl_api_##n##_t_endian, \
492 vl_api_##n##_t_print, \
493 sizeof(vl_api_##n##_t), 1);
vl_api_srv6_sid_list_t sid_lists[num_sid_lists]
static clib_error_t * sr_api_hookup(vlib_main_t *vm)
vl_api_address_t xconnect_nh_addr
char end_psp
Combined with End.PSP?
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
u8 is_encap
Mode (0 is SRH insert, 1 Encaps)
vl_api_sr_steer_t traffic_type
static void vl_api_sr_localsid_add_del_t_handler(vl_api_sr_localsid_add_del_t *mp)
IPv6 SR policy modification.
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static void vl_api_sr_policy_add_t_handler(vl_api_sr_policy_add_t *mp)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vl_api_sr_behavior_t behavior
vl_api_srv6_sid_list_with_sl_index_t sid_lists[num_sid_lists]
u32 sw_if_index
xconnect only
ip46_address_t next_hop
Next_hop for xconnect usage only.
ip6_sr_steering_policy_t * steer_policies
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
static void send_sr_policies_details_with_sl_index(ip6_sr_policy_t *t, vl_api_registration_t *reg, u32 context)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void vl_api_sr_steering_add_del_t_handler(vl_api_sr_steering_add_del_t *mp)
int sr_cli_localsid(char is_del, ip6_address_t *localsid_addr, u16 localsid_prefix_len, char end_psp, u8 behavior, u32 sw_if_index, u32 vlan_index, u32 fib_table, ip46_address_t *nh_addr, int usid_len, void *ls_plugin_mem)
SR localsid add/del.
struct sr_steering_key_t::@541::@543 l3
IPv6 SR Set SRv6 encapsulation hop-limit.
static void setup_message_id_table(api_main_t *am)
vl_api_ip6_address_t bsid_addr
u32 vlan_index
VLAN tag (not an index)
static void send_sr_policies_details(ip6_sr_policy_t *t, vl_api_registration_t *reg, u32 context)
vl_api_sr_behavior_t behavior
sr_steering_key_t classify
Traffic classification.
vl_api_interface_index_t sw_if_index[default=0xffffffff]
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
Segment Routing data structures definitions.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
bool is_del[default=false]
static void vl_api_sr_policies_with_sl_index_dump_t_handler(vl_api_sr_policies_with_sl_index_dump_t *mp)
vl_api_ip6_address_t bsid_addr
vl_api_ip6_address_t bsid
vl_api_ip6_address_t bsid_addr
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
u8 traffic_type
Traffic type (IPv4, IPv6, L2)
SR Segment List (SID list)
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
vl_api_interface_index_t sw_if_index
VLIB_API_INIT_FUNCTION(sr_api_hookup)
vl_api_ip6_address_t bsid
An API client registration, only in vpp/vlib.
static void vl_api_sr_set_encap_hop_limit_t_handler(vl_api_sr_set_encap_hop_limit_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.
int sr_policy_del(ip6_address_t *bsid, u32 index)
Delete a SR policy.
u32 * segments_lists
SID lists indexes (vector)
static void vl_api_sr_steering_pol_dump_t_handler(vl_api_sr_policies_dump_t *mp)
static void vl_api_sr_localsids_dump_t_handler(vl_api_sr_localsids_dump_t *mp)
void sr_set_source(ip6_address_t *address)
static void vl_api_sr_policy_mod_t_handler(vl_api_sr_policy_mod_t *mp)
u32 sr_policy
SR Policy index.
static api_main_t * vlibapi_get_main(void)
u32 xconnect_iface_or_vrf_table
sll srl srl sll sra u16x4 i
u32 weight
SID list weight (wECMP / UCMP)
vl_api_interface_index_t sw_if_index
static void send_sr_steering_pol_details(ip6_sr_steering_policy_t *t, vl_api_registration_t *reg, u32 context)
static void send_sr_localsid_details(ip6_sr_localsid_t *t, vl_api_registration_t *reg, u32 context)
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.
ip6_sr_localsid_t * localsids
#define BAD_SW_IF_INDEX_LABEL
API main structure, used by both vpp and binary API clients.
vl_api_ip6_address_t localsid
vl_api_ip6_address_t bsid_addr
Segment Routing main datastructure.
#define vec_free(V)
Free vector's memory (no header).
struct sr_steering_key_t::@541::@544 l2
ip6_address_t bsid
BindingSID (key)
static void vl_api_sr_policies_dump_t_handler(vl_api_sr_policies_dump_t *mp)
vl_api_ip6_address_t bsid
IPv6 SR Set SRv6 encapsulation source.
u8 type
Type (default is 0)
static void vl_api_sr_policy_del_t_handler(vl_api_sr_policy_del_t *mp)
ip6_address_t localsid
LocalSID IPv6 address.
ip6_address_t * segments
SIDs (key)
void sr_set_hop_limit(u8 hop_limit)
#define vec_foreach(var, vec)
Vector iterator.
Dump the list of SR policies.
IPv6 SR steering add/del.
int sr_policy_add(ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 behavior, u32 fib_table, u8 is_encap, u16 plugin, void *plugin_mem)
Create a new SR policy.
Dump the list of SR policies along with actual segment list index on VPP.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_srv6_sid_list_t sids
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static void vl_api_sr_set_encap_source_t_handler(vl_api_sr_set_encap_source_t *mp)
bool is_del[default=false]
ip6_sr_policy_t * sr_policies
vl_api_srv6_sid_list_t sids
Dump the list of SR LocalSIDs.
vl_api_ip6_address_t encaps_source
vl_api_sr_policy_op_t operation
vl_api_ip6_address_t addr
IPv6 SR LocalSID add/del request.
#define foreach_vpe_api_msg
u16 behavior
Behavior associated to this localsid.
u32 fib_table
FIB table where localsid is registered.
vl_api_sr_steer_t traffic_type
void * vl_msg_api_alloc(int nbytes)