1 #ifndef __NETIFD_PROTO_H
2 #define __NETIFD_PROTO_H
4 struct interface_proto_state
;
6 enum interface_proto_event
{
11 enum interface_proto_cmd
{
17 PROTO_FLAG_IMMEDIATE
= (1 << 0),
20 struct interface_proto_state
{
21 struct interface
*iface
;
24 /* filled in by the protocol user */
25 void (*proto_event
)(struct interface_proto_state
*, enum interface_proto_event ev
);
27 /* filled in by the protocol handler */
28 int (*handler
)(struct interface_proto_state
*, enum interface_proto_cmd cmd
, bool force
);
29 void (*free
)(struct interface_proto_state
*);
32 struct proto_handler
{
36 struct interface_proto_state
* (*attach
)(struct proto_handler
*h
, struct interface
*);
39 void add_proto_handler(struct proto_handler
*p
);
40 void proto_attach_interface(struct interface
*iface
, struct uci_section
*s
);
41 int interface_proto_event(struct interface_proto_state
*proto
,
42 enum interface_proto_cmd cmd
, bool force
);