|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
31 #include <vnet/srv6/sr.api_enum.h>
32 #include <vnet/srv6/sr.api_types.h>
34 #define REPLY_MSG_ID_BASE sr_main.msg_id_base
40 vl_api_sr_localsid_add_del_reply_t *rmp;
43 ip6_address_t localsid;
72 vl_api_sr_policy_add_reply_t *rmp;
73 ip6_address_t *segments = 0, *seg;
74 ip6_address_t bsid_addr;
77 for (
i = 0;
i < mp->
sids.num_sids;
i++)
93 ntohl (mp->
sids.weight),
104 vl_api_sr_policy_mod_reply_t *rmp;
105 ip6_address_t *segments = 0, *seg;
106 ip6_address_t bsid_addr;
109 for (
i = 0;
i < mp->
sids.num_sids;
i++)
129 ntohl (mp->
sids.weight));
138 vl_api_sr_policy_del_reply_t *rmp;
140 ip6_address_t bsid_addr;
154 vl_api_sr_set_encap_source_reply_t *rmp;
156 ip6_address_t encaps_source;
167 vl_api_sr_set_encap_hop_limit_reply_t *rmp;
171 rv = VNET_API_ERROR_INVALID_VALUE;
181 vl_api_sr_steering_add_del_reply_t *rmp;
183 ip6_address_t bsid_addr;
184 ip46_address_t prefix_addr;
266 ip6_address_t *segment;
267 vl_api_srv6_sid_list_t *api_sid_list;
271 sizeof (vl_api_srv6_sid_list_t));
275 sizeof (vl_api_srv6_sid_list_t)));
292 api_sid_list->weight = htonl (segment_list->
weight);
333 ip6_address_t *segment;
334 vl_api_srv6_sid_list_with_sl_index_t *api_sid_list;
338 sizeof (vl_api_srv6_sid_list_with_sl_index_t));
342 sizeof (vl_api_srv6_sid_list_with_sl_index_t)));
358 api_sid_list->sl_index = htonl (*
sl_index);
360 api_sid_list->weight = htonl (segment_list->
weight);
439 #include <vnet/srv6/sr.api.c>
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.
#define REPLY_MSG_ID_BASE
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
struct sr_steering_key_t::@547::@550 l2
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.
IPv6 SR Set SRv6 encapsulation hop-limit.
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 setup_message_id_table(api_main_t *am)
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.
u32 xconnect_iface_or_vrf_table
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
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).
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.
Dump the list of SR policies along with actual segment list index on VPP.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
int sr_policy_add(ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 type, u32 fib_table, u8 is_encap, u16 plugin, void *plugin_mem)
Create a new SR policy.
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.
u16 behavior
Behavior associated to this localsid.
struct sr_steering_key_t::@547::@549 l3
u32 fib_table
FIB table where localsid is registered.
vl_api_sr_steer_t traffic_type
void * vl_msg_api_alloc(int nbytes)