~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/garp.h

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 {
 10         __be16  protocol;
 11 };
 12 
 13 struct garp_msg_hdr {
 14         u8      attrtype;
 15 };
 16 
 17 enum garp_attr_event {
 18         GARP_LEAVE_ALL,
 19         GARP_JOIN_EMPTY,
 20         GARP_JOIN_IN,
 21         GARP_LEAVE_EMPTY,
 22         GARP_LEAVE_IN,
 23         GARP_EMPTY,
 24 };
 25 
 26 struct garp_attr_hdr {
 27         u8      len;
 28         u8      event;
 29         u8      data[];
 30 };
 31 
 32 struct garp_skb_cb {
 33         u8      cur_type;
 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 
 43 enum garp_applicant_state {
 44         GARP_APPLICANT_INVALID,
 45         GARP_APPLICANT_VA,
 46         GARP_APPLICANT_AA,
 47         GARP_APPLICANT_QA,
 48         GARP_APPLICANT_LA,
 49         GARP_APPLICANT_VP,
 50         GARP_APPLICANT_AP,
 51         GARP_APPLICANT_QP,
 52         GARP_APPLICANT_VO,
 53         GARP_APPLICANT_AO,
 54         GARP_APPLICANT_QO,
 55         __GARP_APPLICANT_MAX
 56 };
 57 #define GARP_APPLICANT_MAX      (__GARP_APPLICANT_MAX - 1)
 58 
 59 enum garp_event {
 60         GARP_EVENT_REQ_JOIN,
 61         GARP_EVENT_REQ_LEAVE,
 62         GARP_EVENT_R_JOIN_IN,
 63         GARP_EVENT_R_JOIN_EMPTY,
 64         GARP_EVENT_R_EMPTY,
 65         GARP_EVENT_R_LEAVE_IN,
 66         GARP_EVENT_R_LEAVE_EMPTY,
 67         GARP_EVENT_TRANSMIT_PDU,
 68         __GARP_EVENT_MAX
 69 };
 70 #define GARP_EVENT_MAX          (__GARP_EVENT_MAX - 1)
 71 
 72 enum garp_action {
 73         GARP_ACTION_NONE,
 74         GARP_ACTION_S_JOIN_IN,
 75         GARP_ACTION_S_LEAVE_EMPTY,
 76 };
 77 
 78 struct garp_attr {
 79         struct rb_node                  node;
 80         enum garp_applicant_state       state;
 81         u8                              type;
 82         u8                              dlen;
 83         unsigned char                   data[];
 84 };
 85 
 86 enum garp_applications {
 87         GARP_APPLICATION_GVRP,
 88         __GARP_APPLICATION_MAX
 89 };
 90 #define GARP_APPLICATION_MAX    (__GARP_APPLICATION_MAX - 1)
 91 
 92 struct garp_application {
 93         enum garp_applications  type;
 94         unsigned int            maxattr;
 95         struct stp_proto        proto;
 96 };
 97 
 98 struct garp_applicant {
 99         struct garp_application *app;
100         struct net_device       *dev;
101         struct timer_list       join_timer;
102 
103         spinlock_t              lock;
104         struct sk_buff_head     queue;
105         struct sk_buff          *pdu;
106         struct rb_root          gid;
107         struct rcu_head         rcu;
108 };
109 
110 struct garp_port {
111         struct garp_applicant __rcu     *applicants[GARP_APPLICATION_MAX + 1];
112         struct rcu_head                 rcu;
113 };
114 
115 int garp_register_application(struct garp_application *app);
116 void garp_unregister_application(struct garp_application *app);
117 
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);
121 
122 int garp_request_join(const struct net_device *dev,
123                       const struct garp_application *app, const void *data,
124                       u8 len, u8 type);
125 void garp_request_leave(const struct net_device *dev,
126                         const struct garp_application *app,
127                         const void *data, u8 len, u8 type);
128 
129 #endif /* _NET_GARP_H */
130 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp