LISP: add API handlers for set/get transport protocol
[vpp.git] / src / vnet / lisp-cp / control.h
index a3e2fc2..a6da818 100644 (file)
@@ -103,6 +103,12 @@ typedef struct
   u32 ip4;
 } lisp_api_l2_arp_entry_t;
 
+typedef struct
+{
+  u8 mac[6];
+  u8 ip6[16];
+} lisp_api_ndp_entry_t;
+
 typedef enum
 {
   MR_MODE_DST_ONLY = 0,
@@ -134,6 +140,12 @@ typedef struct
   u32 bd;
 } lisp_l2_arp_key_t;
 
+typedef enum
+{
+  LISP_TRANSPORT_PROTOCOL_UDP = 1,
+  LISP_TRANSPORT_PROTOCOL_API
+} lisp_transport_protocol_t;
+
 typedef struct
 {
   u64 nonce;
@@ -180,6 +192,12 @@ typedef struct
   /* hash map of forwarding entries by mapping index */
   u32 *fwd_entry_by_mapping_index;
 
+  /* pool of vectors of rmts per lcl mapping in adjacencies */
+  u32 **lcl_to_rmt_adjacencies;
+
+  /* hash of pool positions of vectors of rmts by lcl mapping index */
+  u32 *lcl_to_rmt_adjs_by_lcl_idx;
+
   /* forwarding entries pool */
   fwd_entry_t *fwd_entry_pool;
 
@@ -259,6 +277,9 @@ typedef struct
   u32 max_expired_map_registers;
   u32 expired_map_registers;
 
+  /** either UDP based or binary API. Default is UDP */
+  lisp_transport_protocol_t transport_protocol;
+
   /* commodity */
   ip4_main_t *im4;
   ip6_main_t *im6;
@@ -381,7 +402,8 @@ int vnet_lisp_rloc_probe_enable_disable (u8 is_enable);
 int vnet_lisp_map_register_enable_disable (u8 is_enable);
 u8 vnet_lisp_map_register_state_get (void);
 u8 vnet_lisp_rloc_probe_state_get (void);
-int vnet_lisp_add_del_l2_arp_entry (gid_address_t * key, u8 * mac, u8 is_add);
+int vnet_lisp_add_del_l2_arp_ndp_entry (gid_address_t * key, u8 * mac,
+                                       u8 is_add);
 u32 *vnet_lisp_l2_arp_bds_get (void);
 lisp_api_l2_arp_entry_t *vnet_lisp_l2_arp_entries_get_by_bd (u32 bd);
 int vnet_lisp_nsh_set_locator_set (u8 * locator_set_name, u8 is_add);
@@ -389,6 +411,10 @@ int vnet_lisp_map_register_set_ttl (u32 ttl);
 u32 vnet_lisp_map_register_get_ttl (void);
 int vnet_lisp_map_register_fallback_threshold_set (u32 value);
 u32 vnet_lisp_map_register_fallback_threshold_get (void);
+u32 *vnet_lisp_ndp_bds_get (void);
+lisp_api_ndp_entry_t *vnet_lisp_ndp_entries_get_by_bd (u32 bd);
+u32 vnet_lisp_set_transport_protocol (u8 protocol);
+lisp_transport_protocol_t vnet_lisp_get_transport_protocol (void);
 
 map_records_arg_t *parse_map_reply (vlib_buffer_t * b);