vlib: Punt reason allocation listener enable/disable callback

Type: improvement

allow clients that allocate punt reasons to pass a callback function
that is invoked when the first/last client registers to use/listen on
that punt reason. This allows the client to perform some necessary
configs that might not otherwise be enabled.
IPSec uses this callback to register the ESP proto and UDP handling
nodes, that would not otherwise be enabled unless a tunnel was present.

Change-Id: I9759349903f21ffeeb253d4271e619e6bf46054b
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vlib/punt.h b/src/vlib/punt.h
index 7a3e5da..d93b5ea 100644
--- a/src/vlib/punt.h
+++ b/src/vlib/punt.h
@@ -56,12 +56,19 @@
  */
 vlib_punt_hdl_t vlib_punt_client_register (const char *who);
 
+typedef void (*punt_interested_listener_t) (vlib_enable_or_disable_t i,
+					    void *data);
+
 /**
  * Allocate a new punt reason
+ * @param fn     - A callback to invoke when an entity becomes [un]interested
+ *                 in the punt code.
+ * @param data   - To be passed in the callback function.
  */
 extern int vlib_punt_reason_alloc (vlib_punt_hdl_t client,
 				   const char *reason_name,
-				   vlib_punt_reason_t * reason);
+				   punt_interested_listener_t fn,
+				   void *data, vlib_punt_reason_t * reason);
 
 /**
  * Validate that a punt reason is assigned