#define PENDING_MREQ_EXPIRATION_TIME 3.0 /* seconds */
#define PENDING_MREQ_QUEUE_LEN 5
+#define PENDING_MREG_EXPIRATION_TIME 3.0 /* seconds */
+#define RLOC_PROBING_INTERVAL 60.0
+
+/* when map-registration is enabled "quick registration" takes place first.
+ In this mode ETR sends map-register messages at an increased frequency
+ until specified message count is reached */
+#define QUICK_MAP_REGISTER_MSG_COUNT 3
+#define QUICK_MAP_REGISTER_INTERVAL 3.0
+
+/* normal map-register period */
+#define MAP_REGISTER_INTERVAL 60.0
+
+/* 15 minutes */
+#define MAP_REGISTER_DEFAULT_TTL 900
+
typedef struct
{
gid_address_t src;
typedef struct
{
- gid_address_t seid;
- gid_address_t deid;
+ gid_address_t leid;
+ gid_address_t reid;
+ u8 is_src_dst;
locator_pair_t *locator_pairs;
} fwd_entry_t;
+typedef struct
+{
+ gid_address_t leid;
+ gid_address_t reid;
+} lisp_adjacency_t;
+
typedef enum
{
IP4_MISS_PACKET,
IP6_MISS_PACKET
} miss_packet_type_t;
+/* map-server/map-resolver structure */
typedef struct
{
u8 is_down;
f64 last_update;
ip_address_t address;
-} map_resolver_t;
+ char *key;
+} lisp_msmr_t;
typedef struct
{
miss_packet_type_t type;
} miss_packet_t;
+typedef enum
+{
+ MR_MODE_DST_ONLY = 0,
+ MR_MODE_SRC_DST,
+ _MR_MODE_MAX
+} map_request_mode_t;
+
typedef struct
{
/* LISP feature status */
/* pool of mappings */
mapping_t *mapping_pool;
+ /* hash map of secret keys by mapping index */
+ u8 *key_by_mapping_index;
+
/* pool of locators */
locator_t *locator_pool;
/* pool of pending map requests */
pending_map_request_t *pending_map_requests_pool;
- volatile u32 *pending_map_request_lock;
+
+ /* hash map of sent map register messages */
+ uword *map_register_messages_by_nonce;
/* vector of map-resolvers */
- map_resolver_t *map_resolvers;
+ lisp_msmr_t *map_resolvers;
+
+ /* vector of map-servers */
+ lisp_msmr_t *map_servers;
/* map resolver address currently being used for sending requests.
* This has to be an actual address and not an index to map_resolvers vector
uword *vni_by_bd_id;
/* track l2 and l3 interfaces that have been created for vni */
- uword *dp_intf_by_vni;
uword *l2_dp_intf_by_vni;
/* Proxy ETR map index */
/* LISP PITR mode */
u8 lisp_pitr;
+ /* map request mode */
+ u8 map_request_mode;
+
+ /* enable/disable map registering */
+ u8 map_registering;
+
+ /* enable/disable rloc-probing */
+ u8 rloc_probing;
+
+ /* timing wheel for mappping timeouts */
+ timing_wheel_t wheel;
+
/* commodity */
ip4_main_t *im4;
ip6_main_t *im6;
lisp_cp_main_t lisp_control_main;
extern vlib_node_registration_t lisp_cp_input_node;
-extern vlib_node_registration_t lisp_cp_lookup_node;
+extern vlib_node_registration_t lisp_cp_lookup_ip4_node;
+extern vlib_node_registration_t lisp_cp_lookup_ip6_node;
clib_error_t *lisp_cp_init ();
u8 local;
u8 is_static;
+ u8 *key;
+ u8 key_id;
} vnet_lisp_add_del_mapping_args_t;
int
typedef struct
{
- gid_address_t deid;
- gid_address_t seid;
+ gid_address_t reid;
+ gid_address_t leid;
u8 is_add;
} vnet_lisp_add_del_adjacency_args_t;
int
vnet_lisp_add_del_map_resolver (vnet_lisp_add_del_map_resolver_args_t * a);
+int vnet_lisp_add_del_map_server (ip_address_t * addr, u8 is_add);
clib_error_t *vnet_lisp_enable_disable (u8 is_enabled);
u8 vnet_lisp_enable_disable_status (void);
int vnet_lisp_clear_all_remote_adjacencies (void);
int vnet_lisp_eid_table_map (u32 vni, u32 vrf, u8 is_l2, u8 is_add);
-
-static inline void
-lisp_pending_map_request_lock (lisp_cp_main_t * lcm)
-{
- if (lcm->pending_map_request_lock)
- while (__sync_lock_test_and_set (lcm->pending_map_request_lock, 1))
- /* sweet dreams */ ;
-}
-
-static inline void
-lisp_pending_map_request_unlock (lisp_cp_main_t * lcm)
-{
- if (lcm->pending_map_request_lock)
- *lcm->pending_map_request_lock = 0;
-}
+int vnet_lisp_add_del_map_table_key (gid_address_t * eid, char *key,
+ u8 is_add);
+int vnet_lisp_set_map_request_mode (u8 mode);
+u8 vnet_lisp_get_map_request_mode (void);
+lisp_adjacency_t *vnet_lisp_adjacencies_get_by_vni (u32 vni);
+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);
#endif /* VNET_CONTROL_H_ */