move protocol flags to the handler, add a pointer to the handler in the proto state...
[project/netifd.git] / proto.h
diff --git a/proto.h b/proto.h
index 273ec94..e066b43 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -17,17 +17,18 @@ enum interface_proto_cmd {
 
 enum {
        PROTO_FLAG_IMMEDIATE = (1 << 0),
+       PROTO_FLAG_NODEV = (1 << 1),
 };
 
 struct interface_proto_state {
+       const struct proto_handler *handler;
        struct interface *iface;
-       unsigned int flags;
 
        /* filled in by the protocol user */
        void (*proto_event)(struct interface_proto_state *, enum interface_proto_event ev);
 
        /* filled in by the protocol handler */
-       int (*handler)(struct interface_proto_state *, enum interface_proto_cmd cmd, bool force);
+       int (*cb)(struct interface_proto_state *, enum interface_proto_cmd cmd, bool force);
        void (*free)(struct interface_proto_state *);
 };
 
@@ -35,6 +36,8 @@ struct interface_proto_state {
 struct proto_handler {
        struct avl_node avl;
 
+       unsigned int flags;
+
        const char *name;
        const struct config_param_list *config_params;