Add --monitor flag to default init scripts for secchan.
[sliver-openvswitch.git] / secchan / status.c
index 99c22aa..c1e5494 100644 (file)
@@ -38,9 +38,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include "dynamic-string.h"
-#include "nicira-ext.h"
+#include "openflow/nicira-ext.h"
 #include "ofpbuf.h"
-#include "openflow.h"
+#include "openflow/openflow.h"
 #include "rconn.h"
 #include "timeval.h"
 #include "vconn.h"
@@ -165,8 +165,17 @@ switch_status_cb(struct status_reply *sr, void *ss_)
     status_reply_put(sr, "pid=%ld", (long int) getpid());
 }
 
-struct hook
-switch_status_hook_create(const struct settings *s, struct switch_status **ssp)
+static struct hook_class switch_status_hook_class = {
+    NULL,                           /* local_packet_cb */
+    switch_status_remote_packet_cb, /* remote_packet_cb */
+    NULL,                           /* periodic_cb */
+    NULL,                           /* wait_cb */
+    NULL,                           /* closing_cb */
+};
+
+void
+switch_status_start(struct secchan *secchan, const struct settings *s,
+                    struct switch_status **ssp)
 {
     struct switch_status *ss = xcalloc(1, sizeof *ss);
     ss->s = s;
@@ -175,7 +184,7 @@ switch_status_hook_create(const struct settings *s, struct switch_status **ssp)
                                     config_status_cb, (void *) s);
     switch_status_register_category(ss, "switch", switch_status_cb, ss);
     *ssp = ss;
-    return make_hook(NULL, switch_status_remote_packet_cb, NULL, NULL, ss);
+    add_hook(secchan, &switch_status_hook_class, ss);
 }
 
 void