Difference between revisions of "ONE/BI and VAT Guide"
m (→LISP commands) |
|||
Line 7: | Line 7: | ||
</pre> | </pre> | ||
+ | == Binary API === | ||
+ | A Lisp API message is defined in the file .../vpp/vpp/api/vpp.api. | ||
+ | |||
+ | === Lisp enable === | ||
+ | The following is the VPP API message definition for enable/disable Lisp. | ||
+ | <pre> | ||
+ | /** \brief enable or disable LISP feature | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_en - enable protocol if non-zero, else disable | ||
+ | */ | ||
+ | define lisp_enable_disable { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_en; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for lisp enable/disable | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | define lisp_enable_disable_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | The following is the VPP API message definition for show Lisp status. | ||
+ | <pre> | ||
+ | /** \brief Status of lisp protocol, enable or disable | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_en - enable protocol if non-zero, else disable | ||
+ | */ | ||
+ | manual_java define lisp_enable_disable_status_details { | ||
+ | u32 context; | ||
+ | u8 feature_status; | ||
+ | u8 gpe_status; | ||
+ | }; | ||
+ | |||
+ | /** \brief Request for lisp protocol status | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | */ | ||
+ | define lisp_enable_disable_status_dump { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | === Locator_set and Locator === | ||
+ | |||
+ | The following is the VPP API message definition for creating and deleting Lisp locator_set and Lisp locator. | ||
+ | <pre> | ||
+ | /** \brief add or delete locator_set | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_add - add address if non-zero, else delete | ||
+ | @param locator_set_name - locator name | ||
+ | */ | ||
+ | define lisp_add_del_locator_set { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_add; | ||
+ | u8 locator_set_name[64]; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for locator_set add/del | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | define lisp_add_del_locator_set_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | |||
+ | |||
+ | /** \brief add or delete locator for locator_set | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_add - add address if non-zero, else delete | ||
+ | @param locator_set_name - name of locator_set to add/del locator | ||
+ | @param sw_if_index - index of the interface | ||
+ | @param priority - priority of the lisp locator | ||
+ | @param weight - weight of the lisp locator | ||
+ | */ | ||
+ | define lisp_add_del_locator { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_add; | ||
+ | u8 locator_set_name[64]; | ||
+ | u32 sw_if_index; | ||
+ | u8 priority; | ||
+ | u8 weight; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for locator add/del | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | define lisp_add_del_locator_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | The following is the VPP API message definition for show locator_set and locator. | ||
+ | <pre> | ||
+ | /** \brief LISP locator_set status | ||
+ | @param locator_set_name - name of the locator_set | ||
+ | @param sw_if_index - sw_if_index of the locator | ||
+ | @param priority - locator priority | ||
+ | @param weight - locator weight | ||
+ | */ | ||
+ | manual_java define lisp_locator_set_details { | ||
+ | u32 context; | ||
+ | u8 local; | ||
+ | u8 locator_set_name[64]; | ||
+ | u32 sw_if_index; | ||
+ | u8 is_ipv6; | ||
+ | u8 ip_address[16]; | ||
+ | u8 prefix_len; | ||
+ | u8 priority; | ||
+ | u8 weight; | ||
+ | }; | ||
+ | |||
+ | /** \brief Request for locator_set summary status | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | */ | ||
+ | define lisp_locator_set_dump { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | === Eid === | ||
+ | The following is the VPP API message definition for creating and deleting Lisp eid address. | ||
+ | <pre> | ||
+ | /** \brief add or delete lisp eid-table | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_add - add address if non-zero, else delete | ||
+ | @param is_ipv6 - if non-zero the address is ipv6, else ipv4 | ||
+ | @param ip_address - array of address bytes | ||
+ | @param prefix_len - prefix len | ||
+ | @param locator_set_name - name of locator_set to add/del eid-table | ||
+ | */ | ||
+ | define lisp_add_del_local_eid { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_add; | ||
+ | u8 is_ipv6; | ||
+ | u8 ip_address[16]; | ||
+ | u8 prefix_len; | ||
+ | u8 locator_set_name[64]; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for local_eid add/del | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | define lisp_add_del_local_eid_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | The following is the VPP API message definition for show eid table. | ||
+ | <pre> | ||
+ | /** \brief LISP local eid table status | ||
+ | @param locator_set_name - name of the locator_set | ||
+ | @param eid_is_ipv6 - if non-zero the address is ipv6, else ipv4 | ||
+ | @param eid_ip_address - array of address bytes | ||
+ | @param eid_prefix_len - prefix len | ||
+ | */ | ||
+ | manual_java define lisp_local_eid_table_details { | ||
+ | u32 context; | ||
+ | u8 locator_set_name[64]; | ||
+ | u8 eid_is_ipv6; | ||
+ | u8 eid_ip_address[16]; | ||
+ | u8 eid_prefix_len; | ||
+ | }; | ||
+ | |||
+ | /** \brief Request for local eid table summary status | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | */ | ||
+ | define lisp_local_eid_table_dump { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | === Map resolver === | ||
+ | The following is the VPP API message definition for creating and deleting map resolver ip address. | ||
+ | <pre> | ||
+ | /** \brief add or delete map-resolver | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_add - add address if non-zero, else delete | ||
+ | @param is_ipv6 - if non-zero the address is ipv6, else ipv4 | ||
+ | @param ip_address - array of address bytes | ||
+ | */ | ||
+ | define lisp_add_del_map_resolver { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_add; | ||
+ | u8 is_ipv6; | ||
+ | u8 ip_address[16]; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for map_resolver add/del | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | define lisp_add_del_map_resolver_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | The following is the VPP API message definition for show map resolver ip address. | ||
+ | <pre> | ||
+ | /** \brief LISP map resolver status | ||
+ | @param locator_set_name - name of the locator_set | ||
+ | @param is_ipv6 - if non-zero the address is ipv6, else ipv4 | ||
+ | @param ip_address - array of address bytes | ||
+ | */ | ||
+ | manual_java define lisp_map_resolver_details { | ||
+ | u32 context; | ||
+ | u8 is_ipv6; | ||
+ | u8 ip_address[16]; | ||
+ | }; | ||
+ | |||
+ | /** \brief Request for map resolver summary status | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | */ | ||
+ | define lisp_map_resolver_dump { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | }; | ||
+ | </pre> | ||
+ | |||
+ | === Remote Mapping === | ||
+ | The following is the VPP API message definition for creating and deleting remote mapping. | ||
+ | <pre> | ||
+ | /** \brief add or delete remote static mapping | ||
+ | @param client_index - opaque cookie to identify the sender | ||
+ | @param context - sender context, to match reply w/ request | ||
+ | @param is_add - add address if non-zero, else delete | ||
+ | @param vni - virtual network instance | ||
+ | @param action - negative map-reply action | ||
+ | @param eid_is_ip4 - ipv4/6 of source and destination EIDs | ||
+ | @param deid - destination EID | ||
+ | @param seid - source EID | ||
+ | @param rloc_num - number of remote locators | ||
+ | @param rlocs - remote locator data | ||
+ | */ | ||
+ | define lisp_add_del_remote_mapping { | ||
+ | u32 client_index; | ||
+ | u32 context; | ||
+ | u8 is_add; | ||
+ | u32 vni; | ||
+ | u8 action; | ||
+ | u8 eid_is_ip4; | ||
+ | u8 deid[16]; | ||
+ | u8 seid[16]; | ||
+ | u8 deid_len; | ||
+ | u8 seid_len; | ||
+ | u32 rloc_num; | ||
+ | u8 rlocs[0]; | ||
+ | }; | ||
+ | |||
+ | /** \brief Reply for lisp_add_del_remote_mapping | ||
+ | @param context - returned sender context, to match reply w/ request | ||
+ | @param retval - return code | ||
+ | */ | ||
+ | |||
+ | define lisp_add_del_remote_mapping_reply { | ||
+ | u32 context; | ||
+ | i32 retval; | ||
+ | }; | ||
+ | </pre> | ||
== LISP commands == | == LISP commands == |
Revision as of 11:57, 26 May 2016
Contents
Introduction
The vpp contain a set of commands to set and debug LISP. One way to access the VAT (with proper permissions) is to use the vpp_api_test command:
sudo vpp_api_test
Binary API =
A Lisp API message is defined in the file .../vpp/vpp/api/vpp.api.
Lisp enable
The following is the VPP API message definition for enable/disable Lisp.
/** \brief enable or disable LISP feature @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_en - enable protocol if non-zero, else disable */ define lisp_enable_disable { u32 client_index; u32 context; u8 is_en; }; /** \brief Reply for lisp enable/disable @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_enable_disable_reply { u32 context; i32 retval; };
The following is the VPP API message definition for show Lisp status.
/** \brief Status of lisp protocol, enable or disable @param context - sender context, to match reply w/ request @param is_en - enable protocol if non-zero, else disable */ manual_java define lisp_enable_disable_status_details { u32 context; u8 feature_status; u8 gpe_status; }; /** \brief Request for lisp protocol status @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request */ define lisp_enable_disable_status_dump { u32 client_index; u32 context; };
Locator_set and Locator
The following is the VPP API message definition for creating and deleting Lisp locator_set and Lisp locator.
/** \brief add or delete locator_set @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_add - add address if non-zero, else delete @param locator_set_name - locator name */ define lisp_add_del_locator_set { u32 client_index; u32 context; u8 is_add; u8 locator_set_name[64]; }; /** \brief Reply for locator_set add/del @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_add_del_locator_set_reply { u32 context; i32 retval; }; /** \brief add or delete locator for locator_set @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_add - add address if non-zero, else delete @param locator_set_name - name of locator_set to add/del locator @param sw_if_index - index of the interface @param priority - priority of the lisp locator @param weight - weight of the lisp locator */ define lisp_add_del_locator { u32 client_index; u32 context; u8 is_add; u8 locator_set_name[64]; u32 sw_if_index; u8 priority; u8 weight; }; /** \brief Reply for locator add/del @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_add_del_locator_reply { u32 context; i32 retval; };
The following is the VPP API message definition for show locator_set and locator.
/** \brief LISP locator_set status @param locator_set_name - name of the locator_set @param sw_if_index - sw_if_index of the locator @param priority - locator priority @param weight - locator weight */ manual_java define lisp_locator_set_details { u32 context; u8 local; u8 locator_set_name[64]; u32 sw_if_index; u8 is_ipv6; u8 ip_address[16]; u8 prefix_len; u8 priority; u8 weight; }; /** \brief Request for locator_set summary status @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request */ define lisp_locator_set_dump { u32 client_index; u32 context; };
Eid
The following is the VPP API message definition for creating and deleting Lisp eid address.
/** \brief add or delete lisp eid-table @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_add - add address if non-zero, else delete @param is_ipv6 - if non-zero the address is ipv6, else ipv4 @param ip_address - array of address bytes @param prefix_len - prefix len @param locator_set_name - name of locator_set to add/del eid-table */ define lisp_add_del_local_eid { u32 client_index; u32 context; u8 is_add; u8 is_ipv6; u8 ip_address[16]; u8 prefix_len; u8 locator_set_name[64]; }; /** \brief Reply for local_eid add/del @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_add_del_local_eid_reply { u32 context; i32 retval; };
The following is the VPP API message definition for show eid table.
/** \brief LISP local eid table status @param locator_set_name - name of the locator_set @param eid_is_ipv6 - if non-zero the address is ipv6, else ipv4 @param eid_ip_address - array of address bytes @param eid_prefix_len - prefix len */ manual_java define lisp_local_eid_table_details { u32 context; u8 locator_set_name[64]; u8 eid_is_ipv6; u8 eid_ip_address[16]; u8 eid_prefix_len; }; /** \brief Request for local eid table summary status @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request */ define lisp_local_eid_table_dump { u32 client_index; u32 context; };
Map resolver
The following is the VPP API message definition for creating and deleting map resolver ip address.
/** \brief add or delete map-resolver @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_add - add address if non-zero, else delete @param is_ipv6 - if non-zero the address is ipv6, else ipv4 @param ip_address - array of address bytes */ define lisp_add_del_map_resolver { u32 client_index; u32 context; u8 is_add; u8 is_ipv6; u8 ip_address[16]; }; /** \brief Reply for map_resolver add/del @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_add_del_map_resolver_reply { u32 context; i32 retval; };
The following is the VPP API message definition for show map resolver ip address.
/** \brief LISP map resolver status @param locator_set_name - name of the locator_set @param is_ipv6 - if non-zero the address is ipv6, else ipv4 @param ip_address - array of address bytes */ manual_java define lisp_map_resolver_details { u32 context; u8 is_ipv6; u8 ip_address[16]; }; /** \brief Request for map resolver summary status @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request */ define lisp_map_resolver_dump { u32 client_index; u32 context; };
Remote Mapping
The following is the VPP API message definition for creating and deleting remote mapping.
/** \brief add or delete remote static mapping @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @param is_add - add address if non-zero, else delete @param vni - virtual network instance @param action - negative map-reply action @param eid_is_ip4 - ipv4/6 of source and destination EIDs @param deid - destination EID @param seid - source EID @param rloc_num - number of remote locators @param rlocs - remote locator data */ define lisp_add_del_remote_mapping { u32 client_index; u32 context; u8 is_add; u32 vni; u8 action; u8 eid_is_ip4; u8 deid[16]; u8 seid[16]; u8 deid_len; u8 seid_len; u32 rloc_num; u8 rlocs[0]; }; /** \brief Reply for lisp_add_del_remote_mapping @param context - returned sender context, to match reply w/ request @param retval - return code */ define lisp_add_del_remote_mapping_reply { u32 context; i32 retval; };
LISP commands
Lisp enable
To enable lisp, use "lisp_enable_disable":
vat# lisp_enable_disable enable
To disable lisp.
vat# lisp_enable_disable disable
To display lisp status
vat# lisp_enable_disable_status_dump lisp enable
Locator_set
To add new locator_set, use "lisp_add_del_locator_set". This command also "reset" exist locator_set in vpp:
vat# lisp_add_del_locator_set locator-set ls1
To delete a specific locator_set, use "lisp_add_del_locator_set locator-set <name> del":
vat# lisp_add_del_locator_set locator-set ls1 del
When delete locator_set, then also delete all locator which are assigned to locator_set
To add new locator to locator_set, use "lisp_add_del_locator":
vat# lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2
Where p is priority and w is weight.
Locator API also support sw_if_index instead of interface name:
lisp_add_del_locator locator-set ls1 sw_if_index 6 p 1 w 2
To delete specific locator, use "lisp_add_del_locator locator-set <name> iface <interface> p <priority> w <weight> del"
vat# lisp_add_del_locator locator-set ls1 iface GigabitEthernet0/a/0 p 1 w 2 del
To display locator_set and locator:
vat# lisp_locator_set_dump Locator-set Locator Priority Weight ls1 6 1 2
Eid
To add new Eid address, use "lisp_add_del_local_eid"
vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1
There must exist locator_set, before add new eid address.
To delete specific eid address, use "isp_add_del_local_eid eid <address>/<prefix> locator-set <name>"
vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1 del
To display Eid table:
vat# lisp_local_eid_table_dump Locator-set Eid ls1 6.0.1.0/24 ls1 6:0:1::/64
Map resolver
To add new map resolver, use "lisp_add_del_map_resolver"
vat# lisp_add_del_map_resolver 6:0:3::100
To delete specific map resolver, use "lisp_add_del_map_resolver <ip address> del"
vat# lisp_add_del_map_resolver 6:0:3::100 del
To display map resolver:
vat# lisp_map_resolver_dump Map resolver 6:0:3::100
Remote Mapping
To add new remote mapping, use "lisp_add_del_remote_mapping"
vat# lisp_add_del_remote_mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2
To delete specific remote mapping, use "lisp_add_del_remote_mapping del vni <vni> deid <ip prefix> seid <ip prefix> rloc <ip address>"
lisp_add_del_remote_mapping del vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2
To display remote mapping use:
vat# lisp_locator_set_dump Locator-set Locator Priority Weight remote-1 6.0.3.20/0 0 0 vat#
Proxy-ITR
To add new proxy-itr, use "lisp_pitr_set_locator_set"
vat# lisp_pitr_set_locator_set 6:0:3::100