summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-11 12:31:50 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-11 12:31:50 +0200
commitbbfa8c18c8ae086b6fd941e950c466f25c134c17 (patch)
tree208e77fd95237c1d6e525861179826d445012766 /proto.h
parente32103ad7e944ccbebef4335333481e565311f5c (diff)
downloadnetifd-bbfa8c18c8ae086b6fd941e950c466f25c134c17.tar.gz
move protocol flags to the handler, add a pointer to the handler in the proto state, add PROTO_FLAG_NODEV
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/proto.h b/proto.h
index 273ec94..e066b43 100644
--- 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;