Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
garp.h
Go to the documentation of this file.
1 #ifndef _NET_GARP_H
2 #define _NET_GARP_H
3 
4 #include <net/stp.h>
5 
6 #define GARP_PROTOCOL_ID 0x1
7 #define GARP_END_MARK 0x0
8 
9 struct garp_pdu_hdr {
11 };
12 
13 struct garp_msg_hdr {
15 };
16 
24 };
25 
26 struct garp_attr_hdr {
29  u8 data[];
30 };
31 
32 struct garp_skb_cb {
34 };
35 
36 static inline struct garp_skb_cb *garp_cb(struct sk_buff *skb)
37 {
38  BUILD_BUG_ON(sizeof(struct garp_skb_cb) >
39  FIELD_SIZEOF(struct sk_buff, cb));
40  return (struct garp_skb_cb *)skb->cb;
41 }
42 
56 };
57 #define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1)
58 
59 enum garp_event {
69 };
70 #define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1)
71 
76 };
77 
78 struct garp_attr {
79  struct rb_node node;
83  unsigned char data[];
84 };
85 
89 };
90 #define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
91 
94  unsigned int maxattr;
95  struct stp_proto proto;
96 };
97 
100  struct net_device *dev;
102 
105  struct sk_buff *pdu;
106  struct rb_root gid;
107  struct rcu_head rcu;
108 };
109 
110 struct garp_port {
112  struct rcu_head rcu;
113 };
114 
115 extern int garp_register_application(struct garp_application *app);
116 extern void garp_unregister_application(struct garp_application *app);
117 
118 extern int garp_init_applicant(struct net_device *dev,
119  struct garp_application *app);
120 extern void garp_uninit_applicant(struct net_device *dev,
121  struct garp_application *app);
122 
123 extern int garp_request_join(const struct net_device *dev,
124  const struct garp_application *app,
125  const void *data, u8 len, u8 type);
126 extern void garp_request_leave(const struct net_device *dev,
127  const struct garp_application *app,
128  const void *data, u8 len, u8 type);
129 
130 #endif /* _NET_GARP_H */