6 #define GARP_PROTOCOL_ID 0x1
7 #define GARP_END_MARK 0x0
17 enum garp_attr_event
{
26 struct garp_attr_hdr
{
36 static inline struct garp_skb_cb
*garp_cb(struct sk_buff
*skb
)
38 BUILD_BUG_ON(sizeof(struct garp_skb_cb
) >
39 FIELD_SIZEOF(struct sk_buff
, cb
));
40 return (struct garp_skb_cb
*)skb
->cb
;
43 enum garp_applicant_state
{
44 GARP_APPLICANT_INVALID
,
57 #define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1)
63 GARP_EVENT_R_JOIN_EMPTY
,
65 GARP_EVENT_R_LEAVE_IN
,
66 GARP_EVENT_R_LEAVE_EMPTY
,
67 GARP_EVENT_TRANSMIT_PDU
,
70 #define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1)
74 GARP_ACTION_S_JOIN_IN
,
75 GARP_ACTION_S_LEAVE_EMPTY
,
80 enum garp_applicant_state state
;
86 enum garp_applications
{
87 __GARP_APPLICATION_MAX
89 #define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
91 struct garp_application
{
92 enum garp_applications type
;
94 struct stp_proto proto
;
97 struct garp_applicant
{
98 struct garp_application
*app
;
99 struct net_device
*dev
;
100 struct timer_list join_timer
;
103 struct sk_buff_head queue
;
109 struct garp_applicant
*applicants
[GARP_APPLICATION_MAX
+ 1];
112 extern int garp_register_application(struct garp_application
*app
);
113 extern void garp_unregister_application(struct garp_application
*app
);
115 extern int garp_init_applicant(struct net_device
*dev
,
116 struct garp_application
*app
);
117 extern void garp_uninit_applicant(struct net_device
*dev
,
118 struct garp_application
*app
);
120 extern int garp_request_join(const struct net_device
*dev
,
121 const struct garp_application
*app
,
122 const void *data
, u8 len
, u8 type
);
123 extern void garp_request_leave(const struct net_device
*dev
,
124 const struct garp_application
*app
,
125 const void *data
, u8 len
, u8 type
);
127 #endif /* _NET_GARP_H */