> We are trying to use VPP C API in our C application to call VPP functionality 
> in our system. Our system has different sub systems running different VPP 
> versions. We want to have single C application interacting with different 
> versions of VPP. We started with reading SRv6 policy and steering policy data 
> using VPP C API's sr_steering_pol_dump and sr_policies_dump structures. But, 
> while testing with different version, we found differences during data 
> reading in handler functions. 
>  
> Till VPP v20.01, fields in structures sr_policies_details and 
> sr_steering_pol_details are as shown below : -  
> define sr_policies_details
> {
>   u32 context;
>   vl_api_srv6_sid_t bsid;
>   u8 type;
>   u8 is_encap;
>   u32 fib_table;
>   u8 num_sid_lists;
>   vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
> };
>  
> define sr_steering_pol_details
> {
>   u32 context;
>   u8 traffic_type;
>   u32 fib_table;
>   u8 prefix_addr[16];
>   u32 mask_width;
>   u32 sw_if_index;
>   vl_api_srv6_sid_t bsid;
> };
>  
> From VPP v20.05, fields in structures sr_policies_details and 
> sr_steering_pol_details are as shown below : - 
> define sr_policies_details
> {
>   u32 context;
>   vl_api_ip6_address_t bsid;
>   bool is_spray;
>   bool is_encap;
>   u32 fib_table;
>   u8 num_sid_lists;
>   vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
> };
> define sr_steering_pol_details
> {
>   u32 context;
>   vl_api_sr_steer_t traffic_type;
>   u32 fib_table;
>   vl_api_prefix_t prefix;
>   vl_api_interface_index_t sw_if_index;
>   vl_api_ip6_address_t bsid;
> };
>  
> Our handler functions has following signatures : -
> static void 
> vl_api_sr_steering_pol_details_t_handler(vl_api_sr_steering_pol_details_t * 
> mp)
> static void vl_api_sr_policies_details_t_handler(vl_api_sr_policies_details_t 
> * mp)
> 
> Is there a way to abstract this difference and use the same piece of code for 
> both versions of VPP?

Yes, but you would have to build your own wrapper.

Cheers,
Ole
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16712): https://lists.fd.io/g/vpp-dev/message/16712
Mute This Topic: https://lists.fd.io/mt/74796193/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to