#include <stdlib.h>
#include "dynamic-string.h"
#include "ofpbuf.h"
-#include "openflow.h"
+#include "openflow/openflow.h"
#include "poll-loop.h"
#include "port-array.h"
#include "rconn.h"
return pw->got_feature_reply;
}
-struct hook
-port_watcher_create(struct rconn *local_rconn, struct rconn *remote_rconn,
- struct port_watcher **pwp)
+static struct hook_class port_watcher_hook_class = {
+ port_watcher_local_packet_cb, /* local_packet_cb */
+ port_watcher_remote_packet_cb, /* remote_packet_cb */
+ port_watcher_periodic_cb, /* periodic_cb */
+ port_watcher_wait_cb, /* wait_cb */
+ NULL, /* closing_cb */
+};
+
+void
+port_watcher_start(struct secchan *secchan,
+ struct rconn *local_rconn, struct rconn *remote_rconn,
+ struct port_watcher **pwp)
{
struct port_watcher *pw;
port_array_init(&pw->ports);
pw->local_port_name[0] = '\0';
port_watcher_register_callback(pw, log_port_status, NULL);
- return make_hook(port_watcher_local_packet_cb,
- port_watcher_remote_packet_cb,
- port_watcher_periodic_cb,
- port_watcher_wait_cb, pw);
+ add_hook(secchan, &port_watcher_hook_class, pw);
}