1 /* SPDX-License-Identifier: GPL-2.0 */
7 #define GARP_PROTOCOL_ID 0x1
8 #define GARP_END_MARK 0x0
18 enum garp_attr_event
{
27 struct garp_attr_hdr
{
37 static inline struct garp_skb_cb
*garp_cb(struct sk_buff
*skb
)
39 BUILD_BUG_ON(sizeof(struct garp_skb_cb
) >
40 FIELD_SIZEOF(struct sk_buff
, cb
));
41 return (struct garp_skb_cb
*)skb
->cb
;
44 enum garp_applicant_state
{
45 GARP_APPLICANT_INVALID
,
58 #define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1)
64 GARP_EVENT_R_JOIN_EMPTY
,
66 GARP_EVENT_R_LEAVE_IN
,
67 GARP_EVENT_R_LEAVE_EMPTY
,
68 GARP_EVENT_TRANSMIT_PDU
,
71 #define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1)
75 GARP_ACTION_S_JOIN_IN
,
76 GARP_ACTION_S_LEAVE_EMPTY
,
81 enum garp_applicant_state state
;
87 enum garp_applications
{
88 GARP_APPLICATION_GVRP
,
89 __GARP_APPLICATION_MAX
91 #define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
93 struct garp_application
{
94 enum garp_applications type
;
96 struct stp_proto proto
;
99 struct garp_applicant
{
100 struct garp_application
*app
;
101 struct net_device
*dev
;
102 struct timer_list join_timer
;
105 struct sk_buff_head queue
;
112 struct garp_applicant __rcu
*applicants
[GARP_APPLICATION_MAX
+ 1];
116 int garp_register_application(struct garp_application
*app
);
117 void garp_unregister_application(struct garp_application
*app
);
119 int garp_init_applicant(struct net_device
*dev
, struct garp_application
*app
);
120 void garp_uninit_applicant(struct net_device
*dev
,
121 struct garp_application
*app
);
123 int garp_request_join(const struct net_device
*dev
,
124 const struct garp_application
*app
, const void *data
,
126 void garp_request_leave(const struct net_device
*dev
,
127 const struct garp_application
*app
,
128 const void *data
, u8 len
, u8 type
);
130 #endif /* _NET_GARP_H */