LISP: Fix several control plane message issues, VPP-558
[vpp.git] / vnet / vnet / lisp-cp / control.h
index 14b5460..e89c6fd 100644 (file)
@@ -36,6 +36,8 @@
 /* normal map-register period */
 #define MAP_REGISTER_INTERVAL               60.0
 
+/* 15 minutes */
+#define MAP_REGISTER_DEFAULT_TTL            900
 
 typedef struct
 {
@@ -136,7 +138,6 @@ typedef struct
 
   /* 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;
@@ -184,6 +185,9 @@ typedef struct
   /* 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;
@@ -299,21 +303,6 @@ 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);
 
-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;
-}
-
 #endif /* VNET_CONTROL_H_ */
 
 /*