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;
110 struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1];
113 extern int garp_register_application(struct garp_application *app);
114 extern void garp_unregister_application(struct garp_application *app);
116 extern int garp_init_applicant(struct net_device *dev,
117 struct garp_application *app);
118 extern void garp_uninit_applicant(struct net_device *dev,
119 struct garp_application *app);
121 extern int garp_request_join(const struct net_device *dev,
122 const struct garp_application *app,
123 const void *data, u8 len, u8 type);
124 extern void garp_request_leave(const struct net_device *dev,
125 const struct garp_application *app,
126 const void *data, u8 len, u8 type);
128 #endif /* _NET_GARP_H */