1 #ifndef __NETIFD_PROTO_H
2 #define __NETIFD_PROTO_H
5 struct interface_proto_state
;
8 enum interface_proto_event
{
14 enum interface_proto_cmd
{
20 PROTO_FLAG_IMMEDIATE
= (1 << 0),
21 PROTO_FLAG_NODEV
= (1 << 1),
24 struct interface_proto_state
{
25 const struct proto_handler
*handler
;
26 struct interface
*iface
;
28 /* filled in by the protocol user */
29 void (*proto_event
)(struct interface_proto_state
*, enum interface_proto_event ev
);
31 /* filled in by the protocol handler */
32 int (*notify
)(struct interface_proto_state
*, struct blob_attr
*data
);
33 int (*cb
)(struct interface_proto_state
*, enum interface_proto_cmd cmd
, bool force
);
34 void (*free
)(struct interface_proto_state
*);
38 struct proto_handler
{
44 const struct config_param_list
*config_params
;
46 struct interface_proto_state
*(*attach
)(const struct proto_handler
*h
,
47 struct interface
*iface
, struct blob_attr
*attr
);
50 void add_proto_handler(struct proto_handler
*p
);
51 void proto_init_interface(struct interface
*iface
, struct blob_attr
*attr
);
52 void proto_attach_interface(struct interface
*iface
, const char *proto_name
);
53 int interface_proto_event(struct interface_proto_state
*proto
,
54 enum interface_proto_cmd cmd
, bool force
);
55 struct device_addr
*proto_parse_ip_addr_string(const char *str
, bool v6
, int mask
);