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_GVRP
,
88 __GARP_APPLICATION_MAX
90 #define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
92 struct garp_application
{
93 enum garp_applications type
;
95 struct stp_proto proto
;
98 struct garp_applicant
{
99 struct garp_application
*app
;
100 struct net_device
*dev
;
101 struct timer_list join_timer
;
104 struct sk_buff_head queue
;
111 struct garp_applicant __rcu
*applicants
[GARP_APPLICATION_MAX
+ 1];
115 int garp_register_application(struct garp_application
*app
);
116 void garp_unregister_application(struct garp_application
*app
);
118 int garp_init_applicant(struct net_device
*dev
, struct garp_application
*app
);
119 void garp_uninit_applicant(struct net_device
*dev
,
120 struct garp_application
*app
);
122 int garp_request_join(const struct net_device
*dev
,
123 const struct garp_application
*app
, const void *data
,
125 void garp_request_leave(const struct net_device
*dev
,
126 const struct garp_application
*app
,
127 const void *data
, u8 len
, u8 type
);
129 #endif /* _NET_GARP_H */