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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/net/garp.h (Version linux-6.11.5) and /include/net/garp.h (Version linux-4.14.336)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _NET_GARP_H                                 2 #ifndef _NET_GARP_H
  3 #define _NET_GARP_H                                 3 #define _NET_GARP_H
  4                                                     4 
  5 #include <linux/if_ether.h>                    << 
  6 #include <linux/types.h>                       << 
  7 #include <net/stp.h>                                5 #include <net/stp.h>
  8                                                     6 
  9 #define GARP_PROTOCOL_ID        0x1                 7 #define GARP_PROTOCOL_ID        0x1
 10 #define GARP_END_MARK           0x0                 8 #define GARP_END_MARK           0x0
 11                                                     9 
 12 struct garp_pdu_hdr {                              10 struct garp_pdu_hdr {
 13         __be16  protocol;                          11         __be16  protocol;
 14 };                                                 12 };
 15                                                    13 
 16 struct garp_msg_hdr {                              14 struct garp_msg_hdr {
 17         u8      attrtype;                          15         u8      attrtype;
 18 };                                                 16 };
 19                                                    17 
 20 enum garp_attr_event {                             18 enum garp_attr_event {
 21         GARP_LEAVE_ALL,                            19         GARP_LEAVE_ALL,
 22         GARP_JOIN_EMPTY,                           20         GARP_JOIN_EMPTY,
 23         GARP_JOIN_IN,                              21         GARP_JOIN_IN,
 24         GARP_LEAVE_EMPTY,                          22         GARP_LEAVE_EMPTY,
 25         GARP_LEAVE_IN,                             23         GARP_LEAVE_IN,
 26         GARP_EMPTY,                                24         GARP_EMPTY,
 27 };                                                 25 };
 28                                                    26 
 29 struct garp_attr_hdr {                             27 struct garp_attr_hdr {
 30         u8      len;                               28         u8      len;
 31         u8      event;                             29         u8      event;
 32         u8      data[];                            30         u8      data[];
 33 };                                                 31 };
 34                                                    32 
 35 struct garp_skb_cb {                               33 struct garp_skb_cb {
 36         u8      cur_type;                          34         u8      cur_type;
 37 };                                                 35 };
 38                                                    36 
 39 static inline struct garp_skb_cb *garp_cb(stru     37 static inline struct garp_skb_cb *garp_cb(struct sk_buff *skb)
 40 {                                                  38 {
 41         BUILD_BUG_ON(sizeof(struct garp_skb_cb     39         BUILD_BUG_ON(sizeof(struct garp_skb_cb) >
 42                      sizeof_field(struct sk_bu !!  40                      FIELD_SIZEOF(struct sk_buff, cb));
 43         return (struct garp_skb_cb *)skb->cb;      41         return (struct garp_skb_cb *)skb->cb;
 44 }                                                  42 }
 45                                                    43 
 46 enum garp_applicant_state {                        44 enum garp_applicant_state {
 47         GARP_APPLICANT_INVALID,                    45         GARP_APPLICANT_INVALID,
 48         GARP_APPLICANT_VA,                         46         GARP_APPLICANT_VA,
 49         GARP_APPLICANT_AA,                         47         GARP_APPLICANT_AA,
 50         GARP_APPLICANT_QA,                         48         GARP_APPLICANT_QA,
 51         GARP_APPLICANT_LA,                         49         GARP_APPLICANT_LA,
 52         GARP_APPLICANT_VP,                         50         GARP_APPLICANT_VP,
 53         GARP_APPLICANT_AP,                         51         GARP_APPLICANT_AP,
 54         GARP_APPLICANT_QP,                         52         GARP_APPLICANT_QP,
 55         GARP_APPLICANT_VO,                         53         GARP_APPLICANT_VO,
 56         GARP_APPLICANT_AO,                         54         GARP_APPLICANT_AO,
 57         GARP_APPLICANT_QO,                         55         GARP_APPLICANT_QO,
 58         __GARP_APPLICANT_MAX                       56         __GARP_APPLICANT_MAX
 59 };                                                 57 };
 60 #define GARP_APPLICANT_MAX      (__GARP_APPLIC     58 #define GARP_APPLICANT_MAX      (__GARP_APPLICANT_MAX - 1)
 61                                                    59 
 62 enum garp_event {                                  60 enum garp_event {
 63         GARP_EVENT_REQ_JOIN,                       61         GARP_EVENT_REQ_JOIN,
 64         GARP_EVENT_REQ_LEAVE,                      62         GARP_EVENT_REQ_LEAVE,
 65         GARP_EVENT_R_JOIN_IN,                      63         GARP_EVENT_R_JOIN_IN,
 66         GARP_EVENT_R_JOIN_EMPTY,                   64         GARP_EVENT_R_JOIN_EMPTY,
 67         GARP_EVENT_R_EMPTY,                        65         GARP_EVENT_R_EMPTY,
 68         GARP_EVENT_R_LEAVE_IN,                     66         GARP_EVENT_R_LEAVE_IN,
 69         GARP_EVENT_R_LEAVE_EMPTY,                  67         GARP_EVENT_R_LEAVE_EMPTY,
 70         GARP_EVENT_TRANSMIT_PDU,                   68         GARP_EVENT_TRANSMIT_PDU,
 71         __GARP_EVENT_MAX                           69         __GARP_EVENT_MAX
 72 };                                                 70 };
 73 #define GARP_EVENT_MAX          (__GARP_EVENT_     71 #define GARP_EVENT_MAX          (__GARP_EVENT_MAX - 1)
 74                                                    72 
 75 enum garp_action {                                 73 enum garp_action {
 76         GARP_ACTION_NONE,                          74         GARP_ACTION_NONE,
 77         GARP_ACTION_S_JOIN_IN,                     75         GARP_ACTION_S_JOIN_IN,
 78         GARP_ACTION_S_LEAVE_EMPTY,                 76         GARP_ACTION_S_LEAVE_EMPTY,
 79 };                                                 77 };
 80                                                    78 
 81 struct garp_attr {                                 79 struct garp_attr {
 82         struct rb_node                  node;      80         struct rb_node                  node;
 83         enum garp_applicant_state       state;     81         enum garp_applicant_state       state;
 84         u8                              type;      82         u8                              type;
 85         u8                              dlen;      83         u8                              dlen;
 86         unsigned char                   data[]     84         unsigned char                   data[];
 87 };                                                 85 };
 88                                                    86 
 89 enum garp_applications {                           87 enum garp_applications {
 90         GARP_APPLICATION_GVRP,                     88         GARP_APPLICATION_GVRP,
 91         __GARP_APPLICATION_MAX                     89         __GARP_APPLICATION_MAX
 92 };                                                 90 };
 93 #define GARP_APPLICATION_MAX    (__GARP_APPLIC     91 #define GARP_APPLICATION_MAX    (__GARP_APPLICATION_MAX - 1)
 94                                                    92 
 95 struct garp_application {                          93 struct garp_application {
 96         enum garp_applications  type;              94         enum garp_applications  type;
 97         unsigned int            maxattr;           95         unsigned int            maxattr;
 98         struct stp_proto        proto;             96         struct stp_proto        proto;
 99 };                                                 97 };
100                                                    98 
101 struct garp_applicant {                            99 struct garp_applicant {
102         struct garp_application *app;             100         struct garp_application *app;
103         struct net_device       *dev;             101         struct net_device       *dev;
104         struct timer_list       join_timer;       102         struct timer_list       join_timer;
105                                                   103 
106         spinlock_t              lock;             104         spinlock_t              lock;
107         struct sk_buff_head     queue;            105         struct sk_buff_head     queue;
108         struct sk_buff          *pdu;             106         struct sk_buff          *pdu;
109         struct rb_root          gid;              107         struct rb_root          gid;
110         struct rcu_head         rcu;              108         struct rcu_head         rcu;
111 };                                                109 };
112                                                   110 
113 struct garp_port {                                111 struct garp_port {
114         struct garp_applicant __rcu     *appli    112         struct garp_applicant __rcu     *applicants[GARP_APPLICATION_MAX + 1];
115         struct rcu_head                 rcu;      113         struct rcu_head                 rcu;
116 };                                                114 };
117                                                   115 
118 int garp_register_application(struct garp_appl    116 int garp_register_application(struct garp_application *app);
119 void garp_unregister_application(struct garp_a    117 void garp_unregister_application(struct garp_application *app);
120                                                   118 
121 int garp_init_applicant(struct net_device *dev    119 int garp_init_applicant(struct net_device *dev, struct garp_application *app);
122 void garp_uninit_applicant(struct net_device *    120 void garp_uninit_applicant(struct net_device *dev,
123                            struct garp_applica    121                            struct garp_application *app);
124                                                   122 
125 int garp_request_join(const struct net_device     123 int garp_request_join(const struct net_device *dev,
126                       const struct garp_applic    124                       const struct garp_application *app, const void *data,
127                       u8 len, u8 type);           125                       u8 len, u8 type);
128 void garp_request_leave(const struct net_devic    126 void garp_request_leave(const struct net_device *dev,
129                         const struct garp_appl    127                         const struct garp_application *app,
130                         const void *data, u8 l    128                         const void *data, u8 len, u8 type);
131                                                   129 
132 #endif /* _NET_GARP_H */                          130 #endif /* _NET_GARP_H */
133                                                   131 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php