net: Support specifying the network namespace upon device creation.
Subsystems (15)
PATCH 1/1 net: Support specifying the network namespace upon device creation.
There is no good reason to not support userspace specifying the network namespace during device creation, and it makes it easier to create a network device and pass it to a child network namespace with a well known name.
We have to be careful to ensure that the target network namespace for the new device exists through the life of the call. To keep that logic clear I have factored out the network namespace grabbing logic into rtnl_link_get_net.
In addtion we need to continue to pass the source network namespace to the rtnl_link_ops.newlink method so that we can find the base device source network namespace.
--- drivers/net/can/dev.c | 2 +- drivers/net/macvlan.c | 4 ++-- drivers/net/veth.c | 15 ++++++++++++--- include/net/rtnetlink.h | 8 +++++--- net/8021q/vlan_netlink.c | 4 ++-- net/core/rtnetlink.c | 38 +++++++++++++++++++++++++++----------- net/ipv4/ip_gre.c | 2 +- 7 files changed, 50 insertions(+), 23 deletions(-)
drivers/net/can/dev.c +1 -1
@@ -674,7 +674,7 @@ nla_put_failure:return -EMSGSIZE ; } -static int can_newlink (struct net_device *dev, +static int can_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {return -EOPNOTSUPP ;
drivers/net/macvlan.c +2 -2
@@ -504,7 +504,7 @@ static int macvlan_get_tx_queues(struct net *net,return 0 ; } -static int macvlan_newlink (struct net_device *dev, +static int macvlan_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct macvlan_dev *vlan =netdev_priv (dev);
@@ -515,7 +515,7 @@ static int macvlan_newlink(struct net_device *dev,if (!tb[IFLA_LINK ])return -EINVAL ; - lowerdev =__dev_get_by_index (dev_net (dev),nla_get_u32 (tb[IFLA_LINK ])); + lowerdev =__dev_get_by_index (src_net,nla_get_u32 (tb[IFLA_LINK ]));if (lowerdev ==NULL )return -ENODEV ;
drivers/net/veth.c +12 -3
@@ -340,7 +340,7 @@ static int veth_validate(struct nlattr *tb[], struct nlattr *data[])static struct rtnl_link_ops veth_link_ops; -static int veth_newlink (struct net_device *dev, +static int veth_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {int err;
@@ -348,6 +348,7 @@ static int veth_newlink(struct net_device *dev,struct veth_priv *priv;char ifname[IFNAMSIZ ];struct nlattr *peer_tb[IFLA_MAX +1 ], **tbp; +struct net *net;/* * create and register peer first
@@ -380,14 +381,22 @@ static int veth_newlink(struct net_device *dev,else snprintf (ifname,IFNAMSIZ ,DRV_NAME "%%d" ); - peer =rtnl_create_link (dev_net (dev), ifname, &veth_link_ops, tbp); -if (IS_ERR (peer)) + net =rtnl_link_get_net (src_net, tbp); +if (IS_ERR (net)) +return PTR_ERR (net); + + peer =rtnl_create_link (src_net, net, ifname, &veth_link_ops, tbp); +if (IS_ERR (peer)) { +put_net (net);return PTR_ERR (peer); + }if (tbp[IFLA_ADDRESS ] ==NULL )random_ether_addr (peer->dev_addr); err =register_netdevice (peer); +put_net (net); + net =NULL ;if (err <0 ) goto err_register_peer;
include/net/rtnetlink.h +5 -3
@@ -55,7 +55,8 @@ struct rtnl_link_ops {int (*validate)(struct nlattr *tb[],struct nlattr *data[]); -int (*newlink)(struct net_device *dev, +int (*newlink)(struct net *src_net, +struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]); int (*changelink)(struct net_device *dev,
@@ -83,8 +84,9 @@ extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops);extern int rtnl_link_register (struct rtnl_link_ops *ops);extern void rtnl_link_unregister (struct rtnl_link_ops *ops); -extern struct net_device *rtnl_create_link (struct net *net,char *ifname, -const struct rtnl_link_ops *ops,struct nlattr *tb[]); +extern struct net *rtnl_link_get_net (struct net *src_net,struct nlattr *tb[]); +extern struct net_device *rtnl_create_link (struct net *src_net,struct net *net, +char *ifname,const struct rtnl_link_ops *ops,struct nlattr *tb[]);extern const struct nla_policy ifla_policy[IFLA_MAX +1 ];#define MODULE_ALIAS_RTNL_LINK (kind) MODULE_ALIAS("rtnl-link-" kind)
net/8021q/vlan_netlink.c +2 -2
@@ -119,7 +119,7 @@ static int vlan_get_tx_queues(struct net *net,return 0 ; } -static int vlan_newlink (struct net_device *dev, +static int vlan_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct vlan_dev_info *vlan =vlan_dev_info (dev);
@@ -131,7 +131,7 @@ static int vlan_newlink(struct net_device *dev,if (!tb[IFLA_LINK ])return -EINVAL ; - real_dev =__dev_get_by_index (dev_net (dev),nla_get_u32 (tb[IFLA_LINK ])); + real_dev =__dev_get_by_index (src_net,nla_get_u32 (tb[IFLA_LINK ]));if (!real_dev)return -ENODEV ;
net/core/rtnetlink.c +27 -11
@@ -734,6 +734,19 @@ static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = { [IFLA_INFO_DATA] = { .type = NLA_NESTED }, }; +struct net *rtnl_link_get_net (struct net *src_net,struct nlattr *tb[]) +{ +struct net *net; +/* Examine the link attributes and figure out which +* network namespace we are talking about. +*/ +if (tb[IFLA_NET_NS_PID ]) + net =get_net_ns_by_pid (nla_get_u32 (tb[IFLA_NET_NS_PID ])); +else + net =get_net (src_net); +return net; +} +static int validate_linkmsg (struct net_device *dev,struct nlattr *tb[]) {if (dev) {
@@ -757,8 +770,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,int err;if (tb[IFLA_NET_NS_PID ]) { -struct net *net; - net =get_net_ns_by_pid (nla_get_u32 (tb[IFLA_NET_NS_PID ])); +struct net *net =rtnl_link_get_net (dev_net (dev), tb);if (IS_ERR (net)) { err =PTR_ERR (net); goto errout;
@@ -976,8 +988,8 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)return 0 ; } -struct net_device *rtnl_create_link (struct net *net,char *ifname, -const struct rtnl_link_ops *ops,struct nlattr *tb[]) +struct net_device *rtnl_create_link (struct net *src_net,struct net *net, +char *ifname,const struct rtnl_link_ops *ops,struct nlattr *tb[]) {int err;struct net_device *dev;
@@ -985,7 +997,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,unsigned int real_num_queues =1 ;if (ops->get_tx_queues) { - err = ops->get_tx_queues (net, tb, &num_queues, &real_num_queues); + err = ops->get_tx_queues (src_net, tb, &num_queues, &real_num_queues);if (err) goto err; }
@@ -994,16 +1006,16 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,if (!dev) goto err; +dev_net_set (dev, net); + dev->rtnl_link_ops = ops; dev->real_num_tx_queues = real_num_queues; +if (strchr (dev->name,'%' )) { err =dev_alloc_name (dev, dev->name);if (err <0 ) goto err_free; } -dev_net_set (dev, net); - dev->rtnl_link_ops = ops; -if (tb[IFLA_MTU ]) dev->mtu =nla_get_u32 (tb[IFLA_MTU ]);if (tb[IFLA_ADDRESS ])
@@ -1080,6 +1092,7 @@ replay:if (1 ) {struct nlattr *attr[ops ? ops->maxtype +1 :0 ], **data =NULL ; +struct net *dest_net;if (ops) {if (ops->maxtype && linkinfo[IFLA_INFO_DATA ]) {
@@ -1144,17 +1157,19 @@ replay:if (!ifname[0 ])snprintf (ifname,IFNAMSIZ ,"%s%%d" , ops->kind); - dev =rtnl_create_link (net, ifname, ops, tb); + dest_net =rtnl_link_get_net (net, tb); + dev =rtnl_create_link (net, dest_net, ifname, ops, tb);if (IS_ERR (dev)) err =PTR_ERR (dev);else if (ops->newlink) - err = ops->newlink (dev, tb, data); + err = ops->newlink (net, dev, tb, data);else err =register_netdevice (dev); -if (err <0 && !IS_ERR (dev))free_netdev (dev); + +put_net (dest_net);return err; } }
@@ -1425,5 +1440,6 @@ EXPORT_SYMBOL(rtnl_is_locked);EXPORT_SYMBOL (rtnl_unicast);EXPORT_SYMBOL (rtnl_notify);EXPORT_SYMBOL (rtnl_set_sk_err); +EXPORT_SYMBOL (rtnl_link_get_net);EXPORT_SYMBOL (rtnl_create_link);EXPORT_SYMBOL (ifla_policy);
net/ipv4/ip_gre.c +1 -1
@@ -1483,7 +1483,7 @@ static void ipgre_tap_setup(struct net_device *dev) dev->features |=NETIF_F_NETNS_LOCAL ; } -static int ipgre_newlink (struct net_device *dev,struct nlattr *tb[], +static int ipgre_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct ip_tunnel *nt;
Signature · 1 line
1.6.3.1.54.g99dd.dirty
Quoted 10 lines · Eric W. Biederman
There is no good reason to not support userspace specifying the network namespace during device creation, and it makes it easier to create a network device and pass it to a child network namespace with a well known name.
We have to be careful to ensure that the target network namespace for the new device exists through the life of the call. To keep that logic clear I have factored out the network namespace grabbing logic into
rtnl_link_get_net.
Quoted 5 lines
In addtion we need to continue to pass the source network namespace to the rtnl_link_ops.newlink method so that we can find the base device source network namespace.
Signed-off-by Eric W. Biederman <[email protected]>
Very nice, with only one long line you could wrap differently.
Quoted 5 lines
net/ipv4/ip_gre.c +1
-1-static int ipgre_newlink (struct net_device *dev,struct nlattr *tb[], +static int ipgre_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct ip_tunnel *nt;
Quoted 2 lines · Eric Dumazet
Very nice, with only one long line you could wrap differently.
Say again? Was that very nice with respect to the rest of the patch? Or sarcasm because I overlooked this wrap at 80 columns opportunity in ipgre?
Eric
Quoted 11 lines
net/ipv4/ip_gre.c static void ipgre_tap_setup(struct net_device *dev) · line 1489
Quoted 6 lines
net/ipv4/ip_gre.c +1
-1-static int ipgre_newlink (struct net_device *dev,struct nlattr *tb[], +static int ipgre_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct ip_tunnel *nt;--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Eric Dumazet
Acked-byQuoted 7 lines · Eric W. Biederman
Quoted 1 line · Eric Dumazet
Very nice, with only one long line you could wrap differently.
Say again? Was that very nice with respect to the rest of the patch? Or sarcasm because I overlooked this wrap at 80 columns opportunity in ipgre?
Quoted 7 lines
Eric
Quoted 6 lines
net/ipv4/ip_gre.c static void ipgre_tap_setup(struct net_device *dev) · line 1489
Quoted 6 lines
net/ipv4/ip_gre.c +1
-1-static int ipgre_newlink (struct net_device *dev,struct nlattr *tb[], +static int ipgre_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct ip_tunnel *nt;
Hmm, I am very sorry you take it as a sarcasm, I would not treat you or anyone like that.
I was basically Acking your patch, with only one minor note about one line becoming a bit long.
It would be better to write :
static int ipgre_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
David Miller
maintainerFrom: [email protected] (Eric W. Biederman)
Date: Tue, 03 Nov 2009 01:50:23 -0800
Quoted 7 lines
Quoted 2 lines · Eric Dumazet
Very nice, with only one long line you could wrap differently.
Say again? Was that very nice with respect to the rest of the patch? Or sarcasm because I overlooked this wrap at 80 columns opportunity in ipgre?
It can also be argued that for functions, wrapping the args is worse because it makes grep output less useful. In fact that's, I believe, Linus's most recent recommendation in this area :)
Quoted 10 lines · Eric Dumazet
Quoted 9 lines · Eric W. Biederman
Quoted 1 line · Eric Dumazet
Very nice, with only one long line you could wrap differently.
Say again? Was that very nice with respect to the rest of the patch? Or sarcasm because I overlooked this wrap at 80 columns opportunity in ipgre?
Eric
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
net/ipv4/ip_gre.c static void ipgre_tap_setup(struct net_device *dev) · line 1489
Quoted 5 lines
net/ipv4/ip_gre.c +1
-1-static int ipgre_newlink (struct net_device *dev,struct nlattr *tb[], +static int ipgre_newlink (struct net *src_net,struct net_device *dev,struct nlattr *tb[],struct nlattr *data[]) {struct ip_tunnel *nt;Hmm, I am very sorry you take it as a sarcasm, I would not treat you or anyone like that.
I wasn't certain so I asked. You were sufficiently terse I wasn't certain what you meant.
Quoted 8 lines
I was basically Acking your patch, with only one minor note about one line becoming a bit long.
Acked-by Eric Dumazet <[email protected]>It would be better to write :
static int ipgre_newlink(struct net
*src_net, structnet_device*dev,
struct nlattr *tb[], struct nlattr *data[])
Agreed.
Eric
Quoted 3 lines · David Miller
It can also be argued that for functions, wrapping the args is worse because it makes grep output less useful. In fact that's, I believe, Linus's most recent recommendation in this area :)
Yes, true.
One thing I usually miss is the { next to "struct some_name" declarations, to ease games based on "grep"
Would you accept one boring cleanup patch in include/net like following ?
include/net/route.h +3 -6
@@ -49,8 +49,7 @@struct fib_nh ;struct inet_peer ; -struct rtable -{ +struct rtable {union {struct dst_entry dst;
@@ -77,16 +76,14 @@ struct rtablestruct inet_peer *peer;/* long-living peer info */ }; -struct ip_rt_acct -{ +struct ip_rt_acct {__u32 o_bytes;__u32 o_packets;__u32 i_bytes;__u32 i_packets; }; -struct rt_cache_stat -{ +struct rt_cache_stat {unsigned int in_hit;unsigned int in_slow_tot;unsigned int in_slow_mc;
Quoted 7 lines · David Miller
From: [email protected] (Eric W. Biederman)
Date: Tue, 03 Nov 2009 01:50:23 -0800Quoted 4 lines
Quoted 2 lines · Eric Dumazet
Very nice, with only one long line you could wrap differently.
Quoted 7 lines
Quoted 3 lines
Say again? Was that very nice with respect to the rest of the patch? Or sarcasm because I overlooked this wrap at 80 columns opportunity in ipgre?
It can also be argued that for functions, wrapping the args is worse because it makes grep output less useful. In fact that's, I believe, Linus's most recent recommendation in this area :)
The arguments are already wrapped in this instance.
But since I don't have clear guidance to change the patch I will leave it.
Eric
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Tue, 03 Nov 2009 11:16:59 +0100
Quoted 6 lines
Quoted 3 lines · David Miller
It can also be argued that for functions, wrapping the args is worse because it makes grep output less useful. In fact that's, I believe, Linus's most recent recommendation in this area :)
Quoted 6 lines
Yes, true.
One thing I usually miss is the { next to "struct
some_name" declarations, to ease games based on "grep"Would you accept one boring cleanup patch in
include/netlike following ?
Absolutely.
PATCH 1/1 net: cleanup include/net
Quoted 4 lines · David Miller
From: Eric Dumazet <[email protected]>
Quoted 1 line
Would you accept one boring cleanup patch in
include/netlike following ?Absolutely.
Good, here it is.
[PATCH net-next-2.6] net: cleanup include/net
This cleanup patch puts struct/union/enum opening braces, in first line to ease grep games.
struct something
{
becomes :
struct something {
--- include/net/ah.h | 3 - include/net/dn_dev.h | 12 ++---- include/net/dn_fib.h | 3 - include/net/dn_nsp.h | 24 ++++--------- include/net/dst.h | 3 - include/net/fib_rules.h | 9 +--- include/net/gen_stats.h | 3 - include/net/genetlink.h | 12 ++---- include/net/if_inet6.h | 24 ++++--------- include/net/inetpeer.h | 3 - include/net/ip.h | 15 ++------ include/net/ip6_fib.h | 15 ++------ include/net/ip6_route.h | 3 - include/net/ip_vs.h | 6 +-- include/net/ipip.h | 9 +--- include/net/ipv6.h | 12 ++---- include/net/iw_handler.h | 12 ++---- include/net/neighbour.h | 18 +++------ include/net/netfilter/nf_conntrack_ecache.h | 3 - include/net/netfilter/nf_conntrack_expect.h | 6 +-- include/net/netfilter/nf_conntrack_extend.h | 6 +-- include/net/netfilter/nf_conntrack_helper.h | 3 - include/net/netfilter/nf_conntrack_l3proto.h | 3 - include/net/netfilter/nf_conntrack_l4proto.h | 3 - include/net/netfilter/nf_conntrack_tuple.h | 12 ++---- include/net/netfilter/nf_nat.h | 15 ++------ include/net/netfilter/nf_nat_protocol.h | 3 - include/net/pkt_cls.h | 24 ++++--------- include/net/pkt_sched.h | 3 - include/net/protocol.h | 3 - include/net/red.h | 6 +-- include/net/route.h | 12 ++---- include/net/sch_generic.h | 30 +++++----------- include/net/scm.h | 9 +--- include/net/sctp/sctp.h | 3 - include/net/tcp.h | 3 - include/net/xfrm.h | 31 ++++++----------- 37 files changed, 122 insertions(+), 242 deletions(-)
include/net/ah.h +1 -2
@@ -8,8 +8,7 @@struct crypto_ahash ; -struct ah_data -{ +struct ah_data {int icv_full_len;int icv_trunc_len;
include/net/dn_dev.h +4 -8
@@ -97,16 +97,14 @@ struct dn_dev {unsigned long uptime;/* Time device went up in jiffies */ }; -struct dn_short_packet -{ +struct dn_short_packet {__u8 msgflg;__le16 dstnode;__le16 srcnode;__u8 forward; } __attribute__((packed)); -struct dn_long_packet -{ +struct dn_long_packet {__u8 msgflg;__u8 d_area;__u8 d_subarea;
@@ -122,8 +120,7 @@ struct dn_long_packet/*------------------------- DRP - Routing messages ---------------------*/ -struct endnode_hello_message -{ +struct endnode_hello_message {__u8 msgflg;__u8 tiver[3 ];__u8 id[6 ];
@@ -138,8 +135,7 @@ struct endnode_hello_message__u8 data[2 ]; } __attribute__((packed)); -struct rtnode_hello_message -{ +struct rtnode_hello_message {__u8 msgflg;__u8 tiver[3 ];__u8 id[6 ];
include/net/dn_fib.h +1 -2
@@ -4,8 +4,7 @@/* WARNING: The ordering of these elements must match ordering * of RTA_* rtnetlink attribute numbers. */ -struct dn_kern_rta -{ +struct dn_kern_rta {void *rta_dst;void *rta_src;int *rta_iif;
include/net/dn_nsp.h +8 -16
@@ -70,30 +70,26 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl/* Data Messages (data segment/interrupt/link service) */ -struct nsp_data_seg_msg -{ +struct nsp_data_seg_msg {__u8 msgflg;__le16 dstaddr;__le16 srcaddr; } __attribute__((packed)); -struct nsp_data_opt_msg -{ +struct nsp_data_opt_msg {__le16 acknum;__le16 segnum;__le16 lsflgs; } __attribute__((packed)); -struct nsp_data_opt_msg1 -{ +struct nsp_data_opt_msg1 {__le16 acknum;__le16 segnum; } __attribute__((packed));/* Acknowledgment Message (data/other data) */ -struct nsp_data_ack_msg -{ +struct nsp_data_ack_msg {__u8 msgflg;__le16 dstaddr;__le16 srcaddr;
@@ -101,16 +97,14 @@ struct nsp_data_ack_msg } __attribute__((packed));/* Connect Acknowledgment Message */ -struct nsp_conn_ack_msg -{ +struct nsp_conn_ack_msg {__u8 msgflg;__le16 dstaddr; } __attribute__((packed));/* Connect Initiate/Retransmit Initiate/Connect Confirm */ -struct nsp_conn_init_msg -{ +struct nsp_conn_init_msg {__u8 msgflg;#define NSP_CI 0x18/* Connect Initiate */ #define NSP_RCI 0x68/* Retrans. Conn Init */
@@ -126,8 +120,7 @@ struct nsp_conn_init_msg } __attribute__((packed));/* Disconnect Initiate/Disconnect Confirm */ -struct nsp_disconn_init_msg -{ +struct nsp_disconn_init_msg {__u8 msgflg;__le16 dstaddr;__le16 srcaddr;
@@ -136,8 +129,7 @@ struct nsp_disconn_init_msg -struct srcobj_fmt -{ +struct srcobj_fmt {__u8 format;__u8 task;__le16 grpcode;
include/net/dst.h +1 -2
@@ -36,8 +36,7 @@struct sk_buff ; -struct dst_entry -{ +struct dst_entry {struct rcu_head rcu_head;struct dst_entry *child;struct net_device *dev;
include/net/fib_rules.h +3 -6
@@ -7,8 +7,7 @@#include <net/flow.h> #include <net/rtnetlink.h> -struct fib_rule -{ +struct fib_rule {struct list_head list;atomic_t refcnt;int ifindex;
@@ -25,15 +24,13 @@ struct fib_rulestruct net * fr_net; }; -struct fib_lookup_arg -{ +struct fib_lookup_arg {void *lookup_ptr;void *result;struct fib_rule *rule; }; -struct fib_rules_ops -{ +struct fib_rules_ops {int family;struct list_head list;int rule_size;
include/net/gen_stats.h +1 -2
@@ -6,8 +6,7 @@#include <linux/rtnetlink.h> #include <linux/pkt_sched.h> -struct gnet_dump -{ +struct gnet_dump {spinlock_t * lock;struct sk_buff * skb;struct nlattr * tail;
include/net/genetlink.h +4 -8
@@ -13,8 +13,7 @@* @list: list entry for linking * @family: pointer to family, need not be set before registering */ -struct genl_multicast_group -{ +struct genl_multicast_group {struct genl_family *family;/* private */ struct list_head list;/* private */ char name[GENL_NAMSIZ ];
@@ -35,8 +34,7 @@ struct genl_multicast_group* @family_list: family list * @mcast_groups: multicast groups list */ -struct genl_family -{ +struct genl_family {unsigned int id;unsigned int hdrsize;char name[GENL_NAMSIZ ];
@@ -58,8 +56,7 @@ struct genl_family* @userhdr: user specific header * @attrs: netlink attributes */ -struct genl_info -{ +struct genl_info {u32 snd_seq;u32 snd_pid;struct nlmsghdr * nlhdr;
@@ -102,8 +99,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net)* @done: completion callback for dumps * @ops_list: operations list */ -struct genl_ops -{ +struct genl_ops {u8 cmd;unsigned int flags;const struct nla_policy *policy;
include/net/if_inet6.h +8 -16
@@ -32,8 +32,7 @@ #ifdef __KERNEL__ -struct inet6_ifaddr -{ +struct inet6_ifaddr { struct in6_addr addr; __u32 prefix_len;
@@ -67,8 +66,7 @@ struct inet6_ifaddrint dead; }; -struct ip6_sf_socklist -{ +struct ip6_sf_socklist {unsigned int sl_max;unsigned int sl_count;struct in6_addr sl_addr[0 ];
@@ -79,8 +77,7 @@ struct ip6_sf_socklist#define IP6_SFBLOCK 10/* allocate this many at once */ -struct ipv6_mc_socklist -{ +struct ipv6_mc_socklist {struct in6_addr addr;int ifindex;struct ipv6_mc_socklist *next;
@@ -89,8 +86,7 @@ struct ipv6_mc_sockliststruct ip6_sf_socklist *sflist; }; -struct ip6_sf_list -{ +struct ip6_sf_list {struct ip6_sf_list *sf_next;struct in6_addr sf_addr;unsigned long sf_count[2 ];/* include/exclude counts */
@@ -105,8 +101,7 @@ struct ip6_sf_list#define MAF_NOREPORT 0x08#define MAF_GSQUERY 0x10 -struct ifmcaddr6 -{ +struct ifmcaddr6 {struct in6_addr mca_addr;struct inet6_dev *idev;struct ifmcaddr6 *next;
@@ -126,15 +121,13 @@ struct ifmcaddr6/* Anycast stuff */ -struct ipv6_ac_socklist -{ +struct ipv6_ac_socklist {struct in6_addr acl_addr;int acl_ifindex;struct ipv6_ac_socklist *acl_next; }; -struct ifacaddr6 -{ +struct ifacaddr6 {struct in6_addr aca_addr;struct inet6_dev *aca_idev;struct rt6_info *aca_rt;
@@ -157,8 +150,7 @@ struct ipv6_devstat { DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); }; -struct inet6_dev -{ +struct inet6_dev {struct net_device *dev;struct inet6_ifaddr *addr_list;
include/net/inetpeer.h +1 -2
@@ -13,8 +13,7 @@#include <linux/spinlock.h> #include <asm/atomic.h> -struct inet_peer -{ +struct inet_peer {/* group together avl_left,avl_right,v4daddr to speedup lookups */ struct inet_peer *avl_left, *avl_right;__be32 v4daddr;/* peer's address */
include/net/ip.h +5 -10
@@ -33,8 +33,7 @@struct sock ; -struct inet_skb_parm -{ +struct inet_skb_parm {struct ip_options opt;/* Compiled IP options */ unsigned char flags;
@@ -50,8 +49,7 @@ static inline unsigned int ip_hdrlen(const struct sk_buff *skb)return ip_hdr (skb)->ihl *4 ; } -struct ipcm_cookie -{ +struct ipcm_cookie {__be32 addr;int oif;struct ip_options *opt;
@@ -60,8 +58,7 @@ struct ipcm_cookie#define IPCB (skb) ((struct inet_skb_parm*)((skb)->cb)) -struct ip_ra_chain -{ +struct ip_ra_chain {struct ip_ra_chain *next;struct sock *sk;void (*destructor)(struct sock *);
@@ -159,8 +156,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)void ip_send_reply (struct sock *sk,struct sk_buff *skb,struct ip_reply_arg *arg,unsigned int len); -struct ipv4_config -{ +struct ipv4_config {int log_martians;int no_pmtu_disc; };
@@ -336,8 +332,7 @@ extern int ip_call_ra_chain(struct sk_buff *skb);* Functions provided by ip_fragment.c */ -enum ip_defrag_users -{ +enum ip_defrag_users {IP_DEFRAG_LOCAL_DELIVER ,IP_DEFRAG_CALL_RA_CHAIN ,IP_DEFRAG_CONNTRACK_IN ,
include/net/ip6_fib.h +5 -10
@@ -30,8 +30,7 @@struct rt6_info ; -struct fib6_config -{ +struct fib6_config {u32 fc_table;u32 fc_metric;int fc_dst_len;
@@ -51,8 +50,7 @@ struct fib6_configstruct nl_info fc_nlinfo; }; -struct fib6_node -{ +struct fib6_node {struct fib6_node *parent;struct fib6_node *left;struct fib6_node *right;
@@ -78,16 +76,14 @@ struct fib6_node* */ -struct rt6key -{ +struct rt6key {struct in6_addr addr;int plen; };struct fib6_table ; -struct rt6_info -{ +struct rt6_info {union {struct dst_entry dst; } u;
@@ -127,8 +123,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)return ((struct rt6_info *)dst)->rt6i_idev; } -struct fib6_walker_t -{ +struct fib6_walker_t {struct fib6_walker_t *prev, *next;struct fib6_node *root, *node;struct rt6_info *leaf;
include/net/ip6_route.h +1 -2
@@ -103,8 +103,7 @@ extern void rt6_pmtu_discovery(struct in6_addr *daddr,struct netlink_callback ; -struct rt6_rtnl_dump_arg -{ +struct rt6_rtnl_dump_arg {struct sk_buff *skb;struct netlink_callback *cb;struct net *net;
include/net/ip_vs.h +2 -4
@@ -251,8 +251,7 @@ struct ip_vs_estimator {u32 outbps; }; -struct ip_vs_stats -{ +struct ip_vs_stats {struct ip_vs_stats_user ustats;/* statistics */ struct ip_vs_estimator est;/* estimator */
@@ -518,8 +517,7 @@ struct ip_vs_scheduler {/* * The application module object (a.k.a. app incarnation) */ -struct ip_vs_app -{ +struct ip_vs_app {struct list_head a_list;/* member in app list */ int type;/* IP_VS_APP_TYPE_xxx */ char *name;/* application module name */
include/net/ipip.h +3 -6
@@ -8,16 +8,14 @@#define IPTUNNEL_ERR_TIMEO (30*HZ)/* 6rd prefix/relay information */ -struct ip_tunnel_6rd_parm -{ +struct ip_tunnel_6rd_parm {struct in6_addr prefix;__be32 relay_prefix;u16 prefixlen;u16 relay_prefixlen; }; -struct ip_tunnel -{ +struct ip_tunnel {struct ip_tunnel *next;struct net_device *dev;
@@ -40,8 +38,7 @@ struct ip_tunnelunsigned int prl_count;/* # of entries in PRL */ }; -struct ip_tunnel_prl_entry -{ +struct ip_tunnel_prl_entry {struct ip_tunnel_prl_entry *next;__be32 addr;u16 flags;
include/net/ipv6.h +4 -8
@@ -160,8 +160,7 @@ extern struct ctl_path net_ipv6_ctl_path[];#define ICMP6MSGIN_INC_STATS_BH (net, idev, field) \ _DEVINC(net, icmpv6msg, _BH, idev, field) -struct ip6_ra_chain -{ +struct ip6_ra_chain {struct ip6_ra_chain *next;struct sock *sk;int sel;
@@ -176,8 +175,7 @@ extern rwlock_t ip6_ra_lock;ancillary data and passed to IPv6. */ -struct ipv6_txoptions -{ +struct ipv6_txoptions {/* Length of this structure */ int tot_len;
@@ -194,8 +192,7 @@ struct ipv6_txoptions/* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ }; -struct ip6_flowlabel -{ +struct ip6_flowlabel {struct ip6_flowlabel *next;__be32 label;atomic_t users;
@@ -212,8 +209,7 @@ struct ip6_flowlabel#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) -struct ipv6_fl_socklist -{ +struct ipv6_fl_socklist {struct ipv6_fl_socklist *next;struct ip6_flowlabel *fl; };
include/net/iw_handler.h +4 -8
@@ -300,8 +300,7 @@* This struct is also my long term insurance. I can add new fields here * without breaking the prototype of iw_handler... */ -struct iw_request_info -{ +struct iw_request_info {__u16 cmd;/* Wireless Extension command */ __u16 flags;/* More to come ;-) */ };
@@ -321,8 +320,7 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info,* shared by all driver instances... Same for the members... * This will be linked from net_device in <linux/netdevice.h> */ -struct iw_handler_def -{ +struct iw_handler_def {/* Array of handlers for standard ioctls * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT]
@@ -372,8 +370,7 @@ struct iw_handler_def/* * Describe how a standard IOCTL looks like. */ -struct iw_ioctl_description -{ +struct iw_ioctl_description {__u8 header_type;/* NULL, iw_point or other */ __u8 token_type;/* Future */ __u16 token_size;/* Granularity of payload */
@@ -395,8 +392,7 @@ struct iw_ioctl_description/* * Instance specific spy data, i.e. addresses spied and quality for them. */ -struct iw_spy_data -{ +struct iw_spy_data {/* --- Standard spy support --- */ int spy_number;u_char spy_address[IW_MAX_SPY ][ETH_ALEN ];
include/net/neighbour.h +6 -12
@@ -37,8 +37,7 @@struct neighbour ; -struct neigh_parms -{ +struct neigh_parms {#ifdef CONFIG_NET_NS struct net *net;#endif
@@ -70,8 +69,7 @@ struct neigh_parmsint locktime; }; -struct neigh_statistics -{ +struct neigh_statistics {unsigned long allocs;/* number of allocated neighs */ unsigned long destroys;/* number of destroyed neighs */ unsigned long hash_grows;/* number of hash resizes */
@@ -97,8 +95,7 @@ struct neigh_statisticspreempt_enable (); \ }while (0 ) -struct neighbour -{ +struct neighbour {struct neighbour *next;struct neigh_table *tbl;struct neigh_parms *parms;
@@ -122,8 +119,7 @@ struct neighbouru8 primary_key[0 ]; }; -struct neigh_ops -{ +struct neigh_ops {int family;void (*solicit)(struct neighbour *,struct sk_buff *);void (*error_report)(struct neighbour *,struct sk_buff *);
@@ -133,8 +129,7 @@ struct neigh_opsint (*queue_xmit)(struct sk_buff *); }; -struct pneigh_entry -{ +struct pneigh_entry {struct pneigh_entry *next;#ifdef CONFIG_NET_NS struct net *net;
@@ -149,8 +144,7 @@ struct pneigh_entry*/ -struct neigh_table -{ +struct neigh_table {struct neigh_table *next;int family;int entry_size;
include/net/netfilter/nf_conntrack_ecache.h +1 -2
@@ -13,8 +13,7 @@#include <net/netfilter/nf_conntrack_extend.h> /* Connection tracking event types */ -enum ip_conntrack_events -{ +enum ip_conntrack_events {IPCT_NEW =0 ,/* new conntrack */ IPCT_RELATED =1 ,/* related conntrack */ IPCT_DESTROY =2 ,/* destroyed conntrack */
include/net/netfilter/nf_conntrack_expect.h +2 -4
@@ -9,8 +9,7 @@extern unsigned int nf_ct_expect_hsize;extern unsigned int nf_ct_expect_max; -struct nf_conntrack_expect -{ +struct nf_conntrack_expect {/* Conntrack expectation list member */ struct hlist_node lnode;
@@ -64,8 +63,7 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)#endif } -struct nf_conntrack_expect_policy -{ +struct nf_conntrack_expect_policy {unsigned int max_expected;unsigned int timeout; };
include/net/netfilter/nf_conntrack_extend.h +2 -4
@@ -3,8 +3,7 @@#include <net/netfilter/nf_conntrack.h> -enum nf_ct_ext_id -{ +enum nf_ct_ext_id {NF_CT_EXT_HELPER ,NF_CT_EXT_NAT ,NF_CT_EXT_ACCT ,
@@ -65,8 +64,7 @@ __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);#define NF_CT_EXT_F_PREALLOC 0x0001 -struct nf_ct_ext_type -{ +struct nf_ct_ext_type {/* Destroys relationships (can be NULL). */ void (*destroy)(struct nf_conn *ct);/* Called when realloacted (can be NULL).
include/net/netfilter/nf_conntrack_helper.h +1 -2
@@ -16,8 +16,7 @@ struct module;#define NF_CT_HELPER_NAME_LEN 16 -struct nf_conntrack_helper -{ +struct nf_conntrack_helper {struct hlist_node hnode;/* Internal use. */ const char *name;/* name of the module */
include/net/netfilter/nf_conntrack_l3proto.h +1 -2
@@ -16,8 +16,7 @@#include <linux/seq_file.h> #include <net/netfilter/nf_conntrack.h> -struct nf_conntrack_l3proto -{ +struct nf_conntrack_l3proto {/* L3 Protocol Family number. ex) PF_INET */ u_int16_t l3proto;
include/net/netfilter/nf_conntrack_l4proto.h +1 -2
@@ -15,8 +15,7 @@struct seq_file ; -struct nf_conntrack_l4proto -{ +struct nf_conntrack_l4proto {/* L3 Protocol number. */ u_int16_t l3proto;
include/net/netfilter/nf_conntrack_tuple.h +4 -8
@@ -26,8 +26,7 @@/* The protocol-specific manipulable parts of the tuple: always in network order! */ -union nf_conntrack_man_proto -{ +union nf_conntrack_man_proto {/* Add other protocols here. */ __be16 all;
@@ -52,8 +51,7 @@ union nf_conntrack_man_proto };/* The manipulable part of the tuple. */ -struct nf_conntrack_man -{ +struct nf_conntrack_man {union nf_inet_addr u3;union nf_conntrack_man_proto u;/* Layer 3 protocol */
@@ -61,8 +59,7 @@ struct nf_conntrack_man };/* This contains the information to distinguish a connection. */ -struct nf_conntrack_tuple -{ +struct nf_conntrack_tuple {struct nf_conntrack_man src;/* These are the parts of the tuple which are fixed. */
@@ -100,8 +97,7 @@ struct nf_conntrack_tuple } dst; }; -struct nf_conntrack_tuple_mask -{ +struct nf_conntrack_tuple_mask {struct {union nf_inet_addr u3;union nf_conntrack_man_proto u;
include/net/netfilter/nf_nat.h +5 -10
@@ -5,8 +5,7 @@#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 -enum nf_nat_manip_type -{ +enum nf_nat_manip_type {IP_NAT_MANIP_SRC ,IP_NAT_MANIP_DST };
@@ -30,8 +29,7 @@ struct nf_nat_seq { };/* Single range specification. */ -struct nf_nat_range -{ +struct nf_nat_range {/* Set to OR of flags above. */ unsigned int flags;
@@ -43,8 +41,7 @@ struct nf_nat_range };/* For backwards compat: don't use in modern code. */ -struct nf_nat_multi_range_compat -{ +struct nf_nat_multi_range_compat {unsigned int rangesize;/* Must be 1. */ /* hangs off end. */
@@ -57,8 +54,7 @@ struct nf_nat_multi_range_compat#include <net/netfilter/nf_conntrack_extend.h> /* per conntrack: nat application helper private data */ -union nf_conntrack_nat_help -{ +union nf_conntrack_nat_help {/* insert nat helper private data here */ struct nf_nat_pptp nat_pptp_info; };
@@ -66,8 +62,7 @@ union nf_conntrack_nat_helpstruct nf_conn ;/* The structure embedded in the conntrack structure. */ -struct nf_conn_nat -{ +struct nf_conn_nat {struct hlist_node bysource;struct nf_nat_seq seq[IP_CT_DIR_MAX ];struct nf_conn *ct;
include/net/netfilter/nf_nat_protocol.h +1 -2
@@ -6,8 +6,7 @@struct nf_nat_range ; -struct nf_nat_protocol -{ +struct nf_nat_protocol {/* Protocol number. */ unsigned int protonum;
include/net/pkt_cls.h +8 -16
@@ -7,8 +7,7 @@/* Basic packet classifier frontend definitions. */ -struct tcf_walker -{ +struct tcf_walker {int stop;int skip;int count;
@@ -61,8 +60,7 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r) tp->q->ops->cl_ops->unbind_tcf (tp->q, cl); } -struct tcf_exts -{ +struct tcf_exts {#ifdef CONFIG_NET_CLS_ACT struct tc_action *action;#endif
@@ -71,8 +69,7 @@ struct tcf_exts/* Map to export classifier specific extension TLV types to the * generic extensions API. Unsupported extensions must be set to 0. */ -struct tcf_ext_map -{ +struct tcf_ext_map {int action;int police; };
@@ -143,8 +140,7 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,/** * struct tcf_pkt_info - packet information */ -struct tcf_pkt_info -{ +struct tcf_pkt_info {unsigned char * ptr;int nexthdr; };
@@ -162,8 +158,7 @@ struct tcf_ematch_ops;* @datalen: length of the ematch specific configuration data * @data: ematch specific data */ -struct tcf_ematch -{ +struct tcf_ematch {struct tcf_ematch_ops * ops;unsigned long data;unsigned int datalen;
@@ -211,8 +206,7 @@ static inline int tcf_em_early_end(struct tcf_ematch *em, int result)* @hdr: ematch tree header supplied by userspace * @matches: array of ematches */ -struct tcf_ematch_tree -{ +struct tcf_ematch_tree {struct tcf_ematch_tree_hdr hdr;struct tcf_ematch * matches;
@@ -230,8 +224,7 @@ struct tcf_ematch_tree* @owner: owner, must be set to THIS_MODULE * @link: link to previous/next ematch module (internal use) */ -struct tcf_ematch_ops -{ +struct tcf_ematch_ops {int kind;int datalen; int (*change)(struct tcf_proto *, void *,
@@ -302,8 +295,7 @@ static inline int tcf_em_tree_match(struct sk_buff *skb,#else /* CONFIG_NET_EMATCH */ -struct tcf_ematch_tree -{ +struct tcf_ematch_tree { };#define tcf_em_tree_validate (tp, tb, t) ((void)(t), 0)
include/net/pkt_sched.h +1 -2
@@ -5,8 +5,7 @@#include <linux/ktime.h> #include <net/sch_generic.h> -struct qdisc_walker -{ +struct qdisc_walker {int stop;int skip;int count;
include/net/protocol.h +1 -2
@@ -47,8 +47,7 @@ struct net_protocol { }; #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) -struct inet6_protocol -{ +struct inet6_protocol { int (*handler)(struct sk_buff *skb); void (*err_handler)(struct sk_buff *skb,
include/net/red.h +2 -4
@@ -90,8 +90,7 @@#define RED_STAB_SIZE 256#define RED_STAB_MASK (RED_STAB_SIZE - 1) -struct red_stats -{ +struct red_stats {u32 prob_drop;/* Early probability drops */ u32 prob_mark;/* Early probability marks */ u32 forced_drop;/* Forced drops, qavg > max_thresh */
@@ -101,8 +100,7 @@ struct red_statsu32 backlog; }; -struct red_parms -{ +struct red_parms {/* Parameters */ u32 qth_min;/* Min avg length threshold: A scaled */ u32 qth_max;/* Max avg length threshold: A scaled */
include/net/route.h +4 -8
@@ -49,10 +49,8 @@struct fib_nh ;struct inet_peer ; -struct rtable -{ -union - { +struct rtable { +union {struct dst_entry dst; } u;
@@ -77,16 +75,14 @@ struct rtablestruct inet_peer *peer;/* long-living peer info */ }; -struct ip_rt_acct -{ +struct ip_rt_acct {__u32 o_bytes;__u32 o_packets;__u32 i_bytes;__u32 i_packets; }; -struct rt_cache_stat -{ +struct rt_cache_stat {unsigned int in_hit;unsigned int in_slow_tot;unsigned int in_slow_mc;
include/net/sch_generic.h +10 -20
@@ -15,16 +15,14 @@ struct qdisc_walker;struct tcf_walker ;struct module ; -struct qdisc_rate_table -{ +struct qdisc_rate_table {struct tc_ratespec rate;u32 data[256 ];struct qdisc_rate_table *next;int refcnt; }; -enum qdisc_state_t -{ +enum qdisc_state_t { __QDISC_STATE_RUNNING, __QDISC_STATE_SCHED, __QDISC_STATE_DEACTIVATED,
@@ -37,8 +35,7 @@ struct qdisc_size_table {u16 data[]; }; -struct Qdisc -{ +struct Qdisc {int (*enqueue)(struct sk_buff *skb,struct Qdisc *dev);struct sk_buff * (*dequeue)(struct Qdisc *dev);unsigned flags;
@@ -78,8 +75,7 @@ struct Qdiscstruct gnet_stats_queue qstats; }; -struct Qdisc_class_ops -{ +struct Qdisc_class_ops {/* Child qdisc manipulation */ struct netdev_queue * (*select_queue)(struct Qdisc *,struct tcmsg *); int (*graft)(struct Qdisc *, unsigned long cl,
@@ -108,8 +104,7 @@ struct Qdisc_class_ops struct gnet_dump *); }; -struct Qdisc_ops -{ +struct Qdisc_ops {struct Qdisc_ops *next;const struct Qdisc_class_ops *cl_ops;char id[IFNAMSIZ ];
@@ -133,14 +128,12 @@ struct Qdisc_ops }; -struct tcf_result -{ +struct tcf_result {unsigned long class;u32 classid; }; -struct tcf_proto_ops -{ +struct tcf_proto_ops {struct tcf_proto_ops *next;char kind[IFNAMSIZ ];
@@ -164,8 +157,7 @@ struct tcf_proto_opsstruct module *owner; }; -struct tcf_proto -{ +struct tcf_proto {/* Fast access part */ struct tcf_proto *next;void *root;
@@ -261,14 +253,12 @@ extern struct Qdisc_ops noop_qdisc_ops;extern struct Qdisc_ops pfifo_fast_ops;extern struct Qdisc_ops mq_qdisc_ops; -struct Qdisc_class_common -{ +struct Qdisc_class_common {u32 classid;struct hlist_node hnode; }; -struct Qdisc_class_hash -{ +struct Qdisc_class_hash {struct hlist_head *hash;unsigned int hashsize;unsigned int hashmask;
include/net/scm.h +3 -6
@@ -12,15 +12,13 @@*/ #define SCM_MAX_FD 255 -struct scm_fp_list -{ +struct scm_fp_list {struct list_head list;int count;struct file *fp[SCM_MAX_FD ]; }; -struct scm_cookie -{ +struct scm_cookie {struct ucred creds;/* Skb credentials */ struct scm_fp_list *fp;/* Passed files */ #ifdef CONFIG_SECURITY_NETWORK
@@ -88,8 +86,7 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scstatic __inline__void scm_recv (struct socket *sock,struct msghdr *msg,struct scm_cookie *scm,int flags) { -if (!msg->msg_control) - { +if (!msg->msg_control) {if (test_bit (SOCK_PASSCRED , &sock->flags) || scm->fp) msg->msg_flags |=MSG_CTRUNC ;scm_destroy (scm);
include/net/sctp/sctp.h +1 -2
@@ -227,8 +227,7 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);#endif /* !TEST_FRAME */ /* sctp mib definitions */ -enum -{ +enum {SCTP_MIB_NUM =0 ,SCTP_MIB_CURRESTAB ,/* CurrEstab */ SCTP_MIB_ACTIVEESTABS ,/* ActiveEstabs */
include/net/tcp.h +1 -2
@@ -359,8 +359,7 @@ TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)inet_rsk (req)->ecn_ok =1 ; } -enum tcp_tw_status -{ +enum tcp_tw_status {TCP_TW_SUCCESS =0 ,TCP_TW_RST =1 ,TCP_TW_ACK =2 ,
include/net/xfrm.h +9 -18
@@ -121,8 +121,7 @@ struct xfrm_state_walk { };/* Full description of state of transformer. */ -struct xfrm_state -{ +struct xfrm_state {#ifdef CONFIG_NET_NS struct net *xs_net;#endif
@@ -237,8 +236,7 @@ enum { };/* callback structure passed from either netlink or pfkey */ -struct km_event -{ +struct km_event {union {u32 hard;u32 proto;
@@ -313,8 +311,7 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);extern void xfrm_state_delete_tunnel (struct xfrm_state *x); -struct xfrm_type -{ +struct xfrm_type {char *description;struct module *owner;__u8 proto;
@@ -420,8 +417,7 @@ static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ippreturn x->inner_mode_iaf; } -struct xfrm_tmpl -{ +struct xfrm_tmpl {/* id in template is interpreted as: * daddr - destination of tunnel, may be zero for transport mode. * spi - zero to acquire spi. Not zero if spi is static, then
@@ -468,8 +464,7 @@ struct xfrm_policy_walk {u32 seq; }; -struct xfrm_policy -{ +struct xfrm_policy {#ifdef CONFIG_NET_NS struct net *xp_net;#endif
@@ -538,8 +533,7 @@ struct xfrm_migrate {/* default seq threshold size */ #define XFRM_AE_SEQT_SIZE 2 -struct xfrm_mgr -{ +struct xfrm_mgr {struct list_head list;char *id;int (*notify)(struct xfrm_state *x,struct km_event *c);
@@ -626,8 +620,7 @@ struct xfrm_spi_skb_cb {#define XFRM_SPI_SKB_CB (__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0]))/* Audit Information */ -struct xfrm_audit -{ +struct xfrm_audit {u32 secid;uid_t loginuid;u32 sessionid;
@@ -871,8 +864,7 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct* bundles differing by session id. All the bundles grow from a parent * policy rule. */ -struct xfrm_dst -{ +struct xfrm_dst {union {struct dst_entry dst;struct rtable rt;
@@ -907,8 +899,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)extern void xfrm_dst_ifdown (struct dst_entry *dst,struct net_device *dev); -struct sec_path -{ +struct sec_path {atomic_t refcnt;int len;struct xfrm_state *xvec[XFRM_MAX_DEPTH ];
Re: [PATCH net-next-2.6] net: cleanup include/net
From: Eric Dumazet <[email protected]>
Date: Tue, 03 Nov 2009 14:26:03 +0100
Quoted 11 lines
This cleanup patch puts struct/union/enum opening braces, in first line to ease grep games.
struct something
{becomes :
struct something {
Signed-off-by Eric Dumazet <[email protected]>
Applied.
PATCH 1/1 net: cleanup include/linux
David, here is the second patch, for include/linux/ files that 'belong' to network stacks.
Thanks
[PATCH net-next-2.6] net: cleanup include/linux
This cleanup patch puts struct/union/enum opening braces, in first line to ease grep games.
struct something
{
becomes :
struct something {
--- include/linux/dn.h | 9 - include/linux/errqueue.h | 6 include/linux/fib_rules.h | 9 - include/linux/filter.h | 6 include/linux/gen_stats.h | 15 -- include/linux/if.h | 15 -- include/linux/if_addr.h | 9 - include/linux/if_addrlabel.h | 6 include/linux/if_arcnet.h | 18 -- include/linux/if_arp.h | 3 include/linux/if_bonding.h | 3 include/linux/if_bridge.h | 9 - include/linux/if_ec.h | 12 - include/linux/if_fddi.h | 22 +- include/linux/if_hippi.h | 15 -- include/linux/if_link.h | 27 +-- include/linux/if_packet.h | 27 +-- include/linux/if_plip.h | 3 include/linux/if_pppol2tp.h | 3 include/linux/if_tunnel.h | 6 include/linux/igmp.h | 15 -- include/linux/in.h | 18 -- include/linux/in6.h | 9 - include/linux/inetdevice.h | 9 - include/linux/ip_vs.h | 3 include/linux/mroute.h | 18 -- include/linux/mroute6.h | 15 -- include/linux/neighbour.h | 18 -- include/linux/netdevice.h | 30 +--- include/linux/netfilter.h | 6 include/linux/netfilter/nf_conntrack_common.h | 6 include/linux/netfilter/nf_conntrack_ftp.h | 3 include/linux/netfilter/nf_conntrack_sctp.h | 3 include/linux/netfilter/nf_conntrack_tcp.h | 3 include/linux/netfilter/nfnetlink.h | 6 include/linux/netfilter/nfnetlink_compat.h | 3 include/linux/netfilter/x_tables.h | 45 ++---- include/linux/netfilter/xt_connbytes.h | 3 include/linux/netfilter/xt_esp.h | 3 include/linux/netfilter/xt_multiport.h | 9 - include/linux/netfilter/xt_policy.h | 18 -- include/linux/netfilter/xt_state.h | 3 include/linux/netfilter/xt_string.h | 3 include/linux/netfilter/xt_tcpudp.h | 6 include/linux/netfilter_arp/arp_tables.h | 21 -- include/linux/netfilter_bridge/ebt_802_3.h | 3 include/linux/netfilter_bridge/ebt_among.h | 9 - include/linux/netfilter_bridge/ebt_arpreply.h | 3 include/linux/netfilter_bridge/ebt_ip.h | 3 include/linux/netfilter_bridge/ebt_ip6.h | 3 include/linux/netfilter_bridge/ebt_limit.h | 3 include/linux/netfilter_bridge/ebt_log.h | 3 include/linux/netfilter_bridge/ebt_mark_m.h | 3 include/linux/netfilter_bridge/ebt_mark_t.h | 3 include/linux/netfilter_bridge/ebt_nat.h | 3 include/linux/netfilter_bridge/ebt_pkttype.h | 3 include/linux/netfilter_bridge/ebt_redirect.h | 3 include/linux/netfilter_bridge/ebt_stp.h | 6 include/linux/netfilter_bridge/ebtables.h | 39 +---- include/linux/netfilter_ipv4/ip_tables.h | 27 +-- include/linux/netfilter_ipv4/ipt_SAME.h | 3 include/linux/netfilter_ipv4/ipt_ah.h | 3 include/linux/netfilter_ipv6/ip6_tables.h | 27 +-- include/linux/netfilter_ipv6/ip6t_ah.h | 3 include/linux/netfilter_ipv6/ip6t_frag.h | 3 include/linux/netfilter_ipv6/ip6t_ipv6header.h | 3 include/linux/netfilter_ipv6/ip6t_mh.h | 3 include/linux/netfilter_ipv6/ip6t_opts.h | 3 include/linux/netfilter_ipv6/ip6t_rt.h | 3 include/linux/netlink.h | 24 +-- include/linux/pkt_cls.h | 84 +++-------- include/linux/pkt_sched.h | 111 +++++---------- include/linux/route.h | 3 include/linux/rtnetlink.h | 57 ++----- include/linux/skbuff.h | 3 include/linux/tc_act/tc_defact.h | 6 include/linux/tc_act/tc_gact.h | 9 - include/linux/tc_act/tc_ipt.h | 3 include/linux/tc_act/tc_mirred.h | 6 include/linux/tc_act/tc_nat.h | 6 include/linux/tc_act/tc_pedit.h | 9 - include/linux/tc_ematch/tc_em_cmp.h | 6 include/linux/tc_ematch/tc_em_meta.h | 15 -- include/linux/tc_ematch/tc_em_nbyte.h | 3 include/linux/tc_ematch/tc_em_text.h | 3 include/linux/tcp.h | 6 include/linux/xfrm.h | 27 +-- 87 files changed, 351 insertions(+), 694 deletions(-)
include/linux/dn.h +3 -6
@@ -71,14 +71,12 @@/* Structures */ -struct dn_naddr -{ +struct dn_naddr {__le16 a_len;__u8 a_addr[DN_MAXADDL ];/* Two bytes little endian */ }; -struct sockaddr_dn -{ +struct sockaddr_dn {__u16 sdn_family;__u8 sdn_flags;__u8 sdn_objnum;
@@ -101,8 +99,7 @@ struct optdata_dn {__u8 opt_data[16 ];/* User data */ }; -struct accessdata_dn -{ +struct accessdata_dn {__u8 acc_accl;__u8 acc_acc[DN_MAXACCL ];__u8 acc_passl;
include/linux/errqueue.h +2 -4
@@ -3,8 +3,7 @@#include <linux/types.h> -struct sock_extended_err -{ +struct sock_extended_err {__u32 ee_errno;__u8 ee_origin;__u8 ee_type;
@@ -31,8 +30,7 @@ struct sock_extended_err#define SKB_EXT_ERR (skb) ((struct sock_exterr_skb *) ((skb)->cb)) -struct sock_exterr_skb -{ +struct sock_exterr_skb {union {struct inet_skb_parm h4;#if defined(CONFIG_IPV6 ) || defined (CONFIG_IPV6_MODULE )
include/linux/fib_rules.h +3 -6
@@ -13,8 +13,7 @@/* try to find source address in routing lookups */ #define FIB_RULE_FIND_SADDR 0x00010000 -struct fib_rule_hdr -{ +struct fib_rule_hdr {__u8 family;__u8 dst_len;__u8 src_len;
@@ -28,8 +27,7 @@ struct fib_rule_hdr__u32 flags; }; -enum -{ +enum {FRA_UNSPEC ,FRA_DST ,/* destination address */ FRA_SRC ,/* source address */
@@ -52,8 +50,7 @@ enum#define FRA_MAX (__FRA_MAX - 1) -enum -{ +enum {FR_ACT_UNSPEC ,FR_ACT_TO_TBL ,/* Pass to fixed table */ FR_ACT_GOTO ,/* Jump to another rule */
include/linux/filter.h +2 -4
@@ -23,16 +23,14 @@* the BPF code definitions which need to match so you can share filters */ -struct sock_filter /* Filter block */ -{ +struct sock_filter {/* Filter block */ __u16 code;/* Actual filter code */ __u8 jt;/* Jump true */ __u8 jf;/* Jump false */ __u32 k;/* Generic multiuse field */ }; -struct sock_fprog /* Required for SO_ATTACH_FILTER. */ -{ +struct sock_fprog {/* Required for SO_ATTACH_FILTER. */ unsigned short len;/* Number of filter blocks */ struct sock_filter __user *filter; };
include/linux/gen_stats.h +5 -10
@@ -18,13 +18,11 @@ enum {* @bytes: number of seen bytes * @packets: number of seen packets */ -struct gnet_stats_basic -{ +struct gnet_stats_basic {__u64 bytes;__u32 packets; }; -struct gnet_stats_basic_packed -{ +struct gnet_stats_basic_packed {__u64 bytes;__u32 packets; } __attribute__ ((packed));
@@ -34,8 +32,7 @@ struct gnet_stats_basic_packed* @bps: current byte rate * @pps: current packet rate */ -struct gnet_stats_rate_est -{ +struct gnet_stats_rate_est {__u32 bps;__u32 pps; };
@@ -48,8 +45,7 @@ struct gnet_stats_rate_est* @requeues: number of requeues * @overlimits: number of enqueues over the limit */ -struct gnet_stats_queue -{ +struct gnet_stats_queue {__u32 qlen;__u32 backlog;__u32 drops;
@@ -62,8 +58,7 @@ struct gnet_stats_queue* @interval: sampling period * @ewma_log: the log of measurement window weight */ -struct gnet_estimator -{ +struct gnet_estimator {signed char interval;unsigned char ewma_log; };
include/linux/if.h +5 -10
@@ -125,8 +125,7 @@ enum {* being very small might be worth keeping for clean configuration. */ -struct ifmap -{ +struct ifmap {unsigned long mem_start;unsigned long mem_end;unsigned short base_addr;
@@ -136,8 +135,7 @@ struct ifmap/* 3 bytes spare */ }; -struct if_settings -{ +struct if_settings {unsigned int type;/* Type of physical device or protocol */ unsigned int size;/* Size of the data allocated by the caller */ union {
@@ -161,8 +159,7 @@ struct if_settings* remainder may be interface specific. */ -struct ifreq -{ +struct ifreq {#define IFHWADDRLEN 6union {
@@ -211,11 +208,9 @@ struct ifreq* must know all networks accessible). */ -struct ifconf -{ +struct ifconf {int ifc_len;/* size of buffer */ -union - { +union {char __user *ifcu_buf;struct ifreq __user *ifcu_req; } ifc_ifcu;
include/linux/if_addr.h +3 -6
@@ -4,8 +4,7 @@#include <linux/types.h> #include <linux/netlink.h> -struct ifaddrmsg -{ +struct ifaddrmsg {__u8 ifa_family;__u8 ifa_prefixlen;/* The prefix length */ __u8 ifa_flags;/* Flags */
@@ -20,8 +19,7 @@ struct ifaddrmsg* but for point-to-point IFA_ADDRESS is DESTINATION address, * local address is supplied in IFA_LOCAL attribute. */ -enum -{ +enum {IFA_UNSPEC ,IFA_ADDRESS ,IFA_LOCAL ,
@@ -47,8 +45,7 @@ enum#define IFA_F_TENTATIVE 0x40#define IFA_F_PERMANENT 0x80 -struct ifa_cacheinfo -{ +struct ifa_cacheinfo {__u32 ifa_prefered;__u32 ifa_valid;__u32 cstamp;/* created timestamp, hundredths of seconds */
include/linux/if_addrlabel.h +2 -4
@@ -12,8 +12,7 @@#include <linux/types.h> -struct ifaddrlblmsg -{ +struct ifaddrlblmsg {__u8 ifal_family;/* Address family */ __u8 __ifal_reserved;/* Reserved */ __u8 ifal_prefixlen;/* Prefix length */
@@ -22,8 +21,7 @@ struct ifaddrlblmsg__u32 ifal_seq;/* sequence number */ }; -enum -{ +enum {IFAL_ADDRESS =1 ,IFAL_LABEL =2 , __IFAL_MAX
include/linux/if_arcnet.h +6 -12
@@ -56,8 +56,7 @@/* * The RFC1201-specific components of an arcnet packet header. */ -struct arc_rfc1201 -{ +struct arc_rfc1201 {__u8 proto;/* protocol ID field - varies */ __u8 split_flag;/* for use with split packets */ __be16 sequence;/* sequence number */
@@ -69,8 +68,7 @@ struct arc_rfc1201/* * The RFC1051-specific components. */ -struct arc_rfc1051 -{ +struct arc_rfc1051 {__u8 proto;/* ARC_P_RFC1051_ARP/RFC1051_IP */ __u8 payload[0 ];/* 507 bytes */ };
@@ -81,8 +79,7 @@ struct arc_rfc1051* The ethernet-encap-specific components. We have a real ethernet header * and some data. */ -struct arc_eth_encap -{ +struct arc_eth_encap {__u8 proto;/* Always ARC_P_ETHER */ struct ethhdr eth;/* standard ethernet header (yuck!) */ __u8 payload[0 ];/* 493 bytes */
@@ -90,8 +87,7 @@ struct arc_eth_encap#define ETH_ENCAP_HDR_SIZE 14 -struct arc_cap -{ +struct arc_cap {__u8 proto;__u8 cookie[sizeof (int )];/* Actually NOT sent over the network */ union {
@@ -108,8 +104,7 @@ struct arc_cap* the _end_ of the 512-byte buffer. We hide this complexity inside the * driver. */ -struct arc_hardware -{ +struct arc_hardware {__u8 source,/* source ARCnet - filled in automagically */ dest,/* destination ARCnet - 0 for broadcast */ offset[2 ];/* offset bytes (some weird semantics) */
@@ -120,8 +115,7 @@ struct arc_hardware* This is an ARCnet frame header, as seen by the kernel (and userspace, * when you do a raw packet capture). */ -struct archdr -{ +struct archdr {/* hardware requirements */ struct arc_hardware hard;
include/linux/if_arp.h +1 -2
@@ -133,8 +133,7 @@ struct arpreq_old {* This structure defines an ethernet arp header. */ -struct arphdr -{ +struct arphdr {__be16 ar_hrd;/* format of hardware address */ __be16 ar_pro;/* format of protocol address */ unsigned char ar_hln;/* length of hardware address */
include/linux/if_bonding.h +1 -2
@@ -94,8 +94,7 @@ typedef struct ifbond {__s32 miimon; } ifbond; -typedef struct ifslave -{ +typedef struct ifslave { __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ char slave_name[IFNAMSIZ]; __s8 link;
include/linux/if_bridge.h +3 -6
@@ -49,8 +49,7 @@#define BR_STATE_FORWARDING 3#define BR_STATE_BLOCKING 4 -struct __bridge_info -{ +struct __bridge_info {__u64 designated_root;__u64 bridge_id;__u32 root_path_cost;
@@ -72,8 +71,7 @@ struct __bridge_info__u32 gc_timer_value; }; -struct __port_info -{ +struct __port_info {__u64 designated_root;__u64 designated_bridge;__u16 port_id;
@@ -89,8 +87,7 @@ struct __port_info__u32 hold_timer_value; }; -struct __fdb_entry -{ +struct __fdb_entry {__u8 mac_addr[6 ];__u8 port_no;__u8 is_local;
include/linux/if_ec.h +4 -8
@@ -5,14 +5,12 @@/* User visible stuff. Glibc provides its own but libc5 folk will use these */ -struct ec_addr -{ +struct ec_addr {unsigned char station;/* Station number. */ unsigned char net;/* Network number. */ }; -struct sockaddr_ec -{ +struct sockaddr_ec {unsigned short sec_family;unsigned char port;/* Port number. */ unsigned char cb;/* Control/flag byte. */
@@ -37,8 +35,7 @@ struct sockaddr_ec#define EC_HLEN 6/* This is what an Econet frame looks like on the wire. */ -struct ec_framehdr -{ +struct ec_framehdr {unsigned char dst_stn;unsigned char dst_net;unsigned char src_stn;
@@ -62,8 +59,7 @@ static inline struct econet_sock *ec_sk(const struct sock *sk)return (struct econet_sock *)sk; } -struct ec_device -{ +struct ec_device {unsigned char station, net;/* Econet protocol address */ };
include/linux/if_fddi.h +9 -13
@@ -63,36 +63,32 @@#define FDDI_UI_CMD 0x03/* Define 802.2 Type 1 header */ -struct fddi_8022_1_hdr - { +struct fddi_8022_1_hdr {__u8 dsap;/* destination service access point */ __u8 ssap;/* source service access point */ __u8 ctrl;/* control byte #1 */ - } __attribute__ ((packed)); +} __attribute__ ((packed));/* Define 802.2 Type 2 header */ -struct fddi_8022_2_hdr - { +struct fddi_8022_2_hdr {__u8 dsap;/* destination service access point */ __u8 ssap;/* source service access point */ __u8 ctrl_1;/* control byte #1 */ __u8 ctrl_2;/* control byte #2 */ - } __attribute__ ((packed)); +} __attribute__ ((packed));/* Define 802.2 SNAP header */ #define FDDI_K_OUI_LEN 3 -struct fddi_snap_hdr - { +struct fddi_snap_hdr {__u8 dsap;/* always 0xAA */ __u8 ssap;/* always 0xAA */ __u8 ctrl;/* always 0x03 */ __u8 oui[FDDI_K_OUI_LEN ];/* organizational universal id */ __be16 ethertype;/* packet type ID field */ - } __attribute__ ((packed)); +} __attribute__ ((packed));/* Define FDDI LLC frame header */ -struct fddihdr - { +struct fddihdr {__u8 fc;/* frame control */ __u8 daddr[FDDI_K_ALEN ];/* destination address */ __u8 saddr[FDDI_K_ALEN ];/* source address */
@@ -102,7 +98,7 @@ struct fddihdrstruct fddi_8022_2_hdr llc_8022_2;struct fddi_snap_hdr llc_snap; } hdr; - } __attribute__ ((packed)); +} __attribute__ ((packed));#ifdef __KERNEL__#include <linux/netdevice.h>
@@ -197,7 +193,7 @@ struct fddi_statistics {__u32 port_pc_withhold[2 ];__u32 port_ler_flag[2 ];__u32 port_hardware_present[2 ]; - }; +};#endif /* __KERNEL__ */ #endif /* _LINUX_IF_FDDI_H */
include/linux/if_hippi.h +5 -10
@@ -51,8 +51,7 @@* HIPPI statistics collection data. */ -struct hipnet_statistics -{ +struct hipnet_statistics {int rx_packets;/* total packets received */ int tx_packets;/* total packets transmitted */ int rx_errors;/* bad packets received */
@@ -77,8 +76,7 @@ struct hipnet_statistics }; -struct hippi_fp_hdr -{ +struct hippi_fp_hdr {#if 0 __u8 ulp;/* must contain 4 */ #if defined (__BIG_ENDIAN_BITFIELD)
@@ -108,8 +106,7 @@ struct hippi_fp_hdr__be32 d2_size; } __attribute__ ((packed)); -struct hippi_le_hdr -{ +struct hippi_le_hdr {#if defined (__BIG_ENDIAN_BITFIELD)__u8 fc:3 ;__u8 double_wide:1 ;
@@ -139,8 +136,7 @@ struct hippi_le_hdr* Looks like the dsap and ssap fields have been swapped by mistake in * RFC 2067 "IP over HIPPI". */ -struct hippi_snap_hdr -{ +struct hippi_snap_hdr {__u8 dsap;/* always 0xAA */ __u8 ssap;/* always 0xAA */ __u8 ctrl;/* always 0x03 */
@@ -148,8 +144,7 @@ struct hippi_snap_hdr__be16 ethertype;/* packet type ID field */ } __attribute__ ((packed)); -struct hippi_hdr -{ +struct hippi_hdr {struct hippi_fp_hdr fp;struct hippi_le_hdr le;struct hippi_snap_hdr snap;
include/linux/if_link.h +9 -18
@@ -5,8 +5,7 @@#include <linux/netlink.h> /* The struct should be in sync with struct net_device_stats */ -struct rtnl_link_stats -{ +struct rtnl_link_stats {__u32 rx_packets;/* total packets received */ __u32 tx_packets;/* total packets transmitted */ __u32 rx_bytes;/* total bytes received */
@@ -39,8 +38,7 @@ struct rtnl_link_stats };/* The struct should be in sync with struct ifmap */ -struct rtnl_link_ifmap -{ +struct rtnl_link_ifmap {__u64 mem_start;__u64 mem_end;__u64 base_addr;
@@ -49,8 +47,7 @@ struct rtnl_link_ifmap__u8 port; }; -enum -{ +enum {IFLA_UNSPEC ,IFLA_ADDRESS ,IFLA_BROADCAST ,
@@ -123,8 +120,7 @@ enum*/ /* Subtype attributes for IFLA_PROTINFO */ -enum -{ +enum {IFLA_INET6_UNSPEC ,IFLA_INET6_FLAGS ,/* link flags */ IFLA_INET6_CONF ,/* sysctl parameters */
@@ -137,16 +133,14 @@ enum#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) -struct ifla_cacheinfo -{ +struct ifla_cacheinfo {__u32 max_reasm_len;__u32 tstamp;/* ipv6InterfaceTable updated timestamp */ __u32 reachable_time;__u32 retrans_time; }; -enum -{ +enum {IFLA_INFO_UNSPEC ,IFLA_INFO_KIND ,IFLA_INFO_DATA ,
@@ -158,8 +152,7 @@ enum/* VLAN section */ -enum -{ +enum {IFLA_VLAN_UNSPEC ,IFLA_VLAN_ID ,IFLA_VLAN_FLAGS ,
@@ -175,8 +168,7 @@ struct ifla_vlan_flags {__u32 mask; }; -enum -{ +enum {IFLA_VLAN_QOS_UNSPEC ,IFLA_VLAN_QOS_MAPPING , __IFLA_VLAN_QOS_MAX
@@ -184,8 +176,7 @@ enum#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) -struct ifla_vlan_qos_mapping -{ +struct ifla_vlan_qos_mapping {__u32 from;__u32 to; };
include/linux/if_packet.h +9 -18
@@ -3,15 +3,13 @@#include <linux/types.h> -struct sockaddr_pkt -{ +struct sockaddr_pkt {unsigned short spkt_family;unsigned char spkt_device[14 ];__be16 spkt_protocol; }; -struct sockaddr_ll -{ +struct sockaddr_ll {unsigned short sll_family;__be16 sll_protocol;int sll_ifindex;
@@ -49,14 +47,12 @@ struct sockaddr_ll#define PACKET_TX_RING 13#define PACKET_LOSS 14 -struct tpacket_stats -{ +struct tpacket_stats {unsigned int tp_packets;unsigned int tp_drops; }; -struct tpacket_auxdata -{ +struct tpacket_auxdata {__u32 tp_status;__u32 tp_len;__u32 tp_snaplen;
@@ -78,8 +74,7 @@ struct tpacket_auxdata#define TP_STATUS_SENDING 0x2#define TP_STATUS_WRONG_FORMAT 0x4 -struct tpacket_hdr -{ +struct tpacket_hdr {unsigned long tp_status;unsigned int tp_len;unsigned int tp_snaplen;
@@ -93,8 +88,7 @@ struct tpacket_hdr#define TPACKET_ALIGN (x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) -struct tpacket2_hdr -{ +struct tpacket2_hdr {__u32 tp_status;__u32 tp_len;__u32 tp_snaplen;
@@ -107,8 +101,7 @@ struct tpacket2_hdr#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) -enum tpacket_versions -{ +enum tpacket_versions {TPACKET_V1 ,TPACKET_V2 , };
@@ -126,16 +119,14 @@ enum tpacket_versions- Pad to align to TPACKET_ALIGNMENT=16 */ -struct tpacket_req -{ +struct tpacket_req {unsigned int tp_block_size;/* Minimal size of contiguous block */ unsigned int tp_block_nr;/* Number of blocks */ unsigned int tp_frame_size;/* Size of frame */ unsigned int tp_frame_nr;/* Total number of frames */ }; -struct packet_mreq -{ +struct packet_mreq {int mr_ifindex;unsigned short mr_type;unsigned short mr_alen;
include/linux/if_plip.h +1 -2
@@ -15,8 +15,7 @@#define SIOCDEVPLIP SIOCDEVPRIVATE -struct plipconf -{ +struct plipconf {unsigned short pcmd;unsigned long nibble;unsigned long trigger;
include/linux/if_pppol2tp.h +1 -2
@@ -24,8 +24,7 @@/* Structure used to connect() the socket to a particular tunnel UDP * socket. */ -struct pppol2tp_addr -{ +struct pppol2tp_addr {__kernel_pid_t pid;/* pid that owns the fd. * 0 => current */ int fd;/* FD of UDP socket to use */
include/linux/if_tunnel.h +2 -4
@@ -30,8 +30,7 @@#define GRE_FLAGS __cpu_to_be16(0x00F8)#define GRE_VERSION __cpu_to_be16(0x0007) -struct ip_tunnel_parm -{ +struct ip_tunnel_parm {char name[IFNAMSIZ ];int link;__be16 i_flags;
@@ -63,8 +62,7 @@ struct ip_tunnel_6rd {__u16 relay_prefixlen; }; -enum -{ +enum {IFLA_GRE_UNSPEC ,IFLA_GRE_LINK ,IFLA_GRE_IFLAGS ,
include/linux/igmp.h +5 -10
@@ -27,8 +27,7 @@* Header in on cable format */ -struct igmphdr -{ +struct igmphdr {__u8 type;__u8 code;/* For newer IGMP */ __sum16 csum;
@@ -151,8 +150,7 @@ static inline struct igmpv3_query *extern int sysctl_igmp_max_memberships;extern int sysctl_igmp_max_msf; -struct ip_sf_socklist -{ +struct ip_sf_socklist {unsigned int sl_max;unsigned int sl_count;__be32 sl_addr[0 ];
@@ -167,16 +165,14 @@ struct ip_sf_socklistthis list never used in fast path code */ -struct ip_mc_socklist -{ +struct ip_mc_socklist {struct ip_mc_socklist *next;struct ip_mreqn multi;unsigned int sfmode;/* MCAST_{INCLUDE,EXCLUDE} */ struct ip_sf_socklist *sflist; }; -struct ip_sf_list -{ +struct ip_sf_list {struct ip_sf_list *sf_next;__be32 sf_inaddr;unsigned long sf_count[2 ];/* include/exclude counts */
@@ -185,8 +181,7 @@ struct ip_sf_listunsigned char sf_crcount;/* retrans. left to send */ }; -struct ip_mc_list -{ +struct ip_mc_list {struct in_device *interface;__be32 multiaddr;struct ip_sf_list *sources;
include/linux/in.h +6 -12
@@ -118,14 +118,12 @@ struct in_addr {/* Request struct for multicast socket ops */ -struct ip_mreq -{ +struct ip_mreq {struct in_addr imr_multiaddr;/* IP multicast address of group */ struct in_addr imr_interface;/* local IP address of interface */ }; -struct ip_mreqn -{ +struct ip_mreqn {struct in_addr imr_multiaddr;/* IP multicast address of group */ struct in_addr imr_address;/* local IP address of interface */ int imr_ifindex;/* Interface index */
@@ -149,21 +147,18 @@ struct ip_msfilter { (sizeof (struct ip_msfilter ) -sizeof (__u32) \ + (numsrc) * sizeof(__u32)) -struct group_req -{ +struct group_req {__u32 gr_interface;/* interface index */ struct __kernel_sockaddr_storage gr_group;/* group address */ }; -struct group_source_req -{ +struct group_source_req {__u32 gsr_interface;/* interface index */ struct __kernel_sockaddr_storage gsr_group;/* group address */ struct __kernel_sockaddr_storage gsr_source;/* source address */ }; -struct group_filter -{ +struct group_filter {__u32 gf_interface;/* interface index */ struct __kernel_sockaddr_storage gf_group;/* multicast address */ __u32 gf_fmode;/* filter mode */
@@ -175,8 +170,7 @@ struct group_filter (sizeof (struct group_filter ) -sizeof (struct __kernel_sockaddr_storage ) \ + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) -struct in_pktinfo -{ +struct in_pktinfo {int ipi_ifindex;struct in_addr ipi_spec_dst;struct in_addr ipi_addr;
include/linux/in6.h +3 -6
@@ -27,10 +27,8 @@* IPv6 address structure */ -struct in6_addr -{ -union - { +struct in6_addr { +union {__u8 u6_addr8[16 ];__be16 u6_addr16[8 ];__be32 u6_addr32[4 ];
@@ -75,8 +73,7 @@ struct ipv6_mreq {#define ipv6mr_acaddr ipv6mr_multiaddr -struct in6_flowlabel_req -{ +struct in6_flowlabel_req {struct in6_addr flr_dst;__be32 flr_label;__u8 flr_action;
include/linux/inetdevice.h +3 -6
@@ -10,15 +10,13 @@#include <linux/timer.h> #include <linux/sysctl.h> -struct ipv4_devconf -{ +struct ipv4_devconf {void *sysctl;int data[__NET_IPV4_CONF_MAX -1 ]; DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); }; -struct in_device -{ +struct in_device {struct net_device *dev;atomic_t refcnt;int dead;
@@ -110,8 +108,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)#define IN_DEV_ARP_IGNORE (in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)#define IN_DEV_ARP_NOTIFY (in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) -struct in_ifaddr -{ +struct in_ifaddr {struct in_ifaddr *ifa_next;struct in_device *ifa_dev;struct rcu_head rcu_head;
include/linux/ip_vs.h +1 -2
@@ -127,8 +127,7 @@ struct ip_vs_dest_user {/* * IPVS statistics object (for user space) */ -struct ip_vs_stats_user -{ +struct ip_vs_stats_user {__u32 conns;/* connections scheduled */ __u32 inpkts;/* incoming packets */ __u32 outpkts;/* outgoing packets */
include/linux/mroute.h +6 -12
@@ -76,8 +76,7 @@ struct vifctl {* Cache manipulation structures for mrouted and PIMd */ -struct mfcctl -{ +struct mfcctl {struct in_addr mfcc_origin;/* Origin of mcast */ struct in_addr mfcc_mcastgrp;/* Group in question */ vifi_t mfcc_parent;/* Where it arrived */
@@ -92,8 +91,7 @@ struct mfcctl* Group count retrieval for mrouted */ -struct sioc_sg_req -{ +struct sioc_sg_req {struct in_addr src;struct in_addr grp;unsigned long pktcnt;
@@ -105,8 +103,7 @@ struct sioc_sg_req* To get vif packet counts */ -struct sioc_vif_req -{ +struct sioc_vif_req {vifi_t vifi;/* Which iface */ unsigned long icount;/* In packets */ unsigned long ocount;/* Out packets */
@@ -119,8 +116,7 @@ struct sioc_vif_req* data. Magically happens to be like an IP packet as per the original */ -struct igmpmsg -{ +struct igmpmsg {__u32 unused1,unused2;unsigned char im_msgtype;/* What is this */ unsigned char im_mbz;/* Must be zero */
@@ -181,8 +177,7 @@ static inline int ip_mr_init(void) }#endif -struct vif_device -{ +struct vif_device {struct net_device *dev;/* Device we are using */ unsigned long bytes_in,bytes_out;unsigned long pkt_in,pkt_out;/* Statistics */
@@ -195,8 +190,7 @@ struct vif_device#define VIFF_STATIC 0x8000 -struct mfc_cache -{ +struct mfc_cache {struct mfc_cache *next;/* Next entry on cache line */ #ifdef CONFIG_NET_NS struct net *mfc_net;
include/linux/mroute6.h +5 -10
@@ -75,8 +75,7 @@ struct mif6ctl {* Cache manipulation structures for mrouted and PIMd */ -struct mf6cctl -{ +struct mf6cctl {struct sockaddr_in6 mf6cc_origin;/* Origin of mcast */ struct sockaddr_in6 mf6cc_mcastgrp;/* Group in question */ mifi_t mf6cc_parent;/* Where it arrived */
@@ -87,8 +86,7 @@ struct mf6cctl* Group count retrieval for pim6sd */ -struct sioc_sg_req6 -{ +struct sioc_sg_req6 {struct sockaddr_in6 src;struct sockaddr_in6 grp;unsigned long pktcnt;
@@ -100,8 +98,7 @@ struct sioc_sg_req6* To get vif packet counts */ -struct sioc_mif_req6 -{ +struct sioc_mif_req6 {mifi_t mifi;/* Which iface */ unsigned long icount;/* In packets */ unsigned long ocount;/* Out packets */
@@ -172,8 +169,7 @@ static inline void ip6_mr_cleanup(void) }#endif -struct mif_device -{ +struct mif_device {struct net_device *dev;/* Device we are using */ unsigned long bytes_in,bytes_out;unsigned long pkt_in,pkt_out;/* Statistics */
@@ -185,8 +181,7 @@ struct mif_device#define VIFF_STATIC 0x8000 -struct mfc6_cache -{ +struct mfc6_cache {struct mfc6_cache *next;/* Next entry on cache line */ #ifdef CONFIG_NET_NS struct net *mfc6_net;
include/linux/neighbour.h +6 -12
@@ -4,8 +4,7 @@#include <linux/types.h> #include <linux/netlink.h> -struct ndmsg -{ +struct ndmsg {__u8 ndm_family;__u8 ndm_pad1;__u16 ndm_pad2;
@@ -15,8 +14,7 @@ struct ndmsg__u8 ndm_type; }; -enum -{ +enum {NDA_UNSPEC ,NDA_DST ,NDA_LLADDR ,
@@ -56,8 +54,7 @@ enumNUD_PERMANENT is also cannot be deleted by garbage collectors. */ -struct nda_cacheinfo -{ +struct nda_cacheinfo {__u32 ndm_confirmed;__u32 ndm_used;__u32 ndm_updated;
@@ -89,8 +86,7 @@ struct nda_cacheinfo* device. ****/ -struct ndt_stats -{ +struct ndt_stats {__u64 ndts_allocs;__u64 ndts_destroys;__u64 ndts_hash_grows;
@@ -124,15 +120,13 @@ enum { };#define NDTPA_MAX (__NDTPA_MAX - 1) -struct ndtmsg -{ +struct ndtmsg {__u8 ndtm_family;__u8 ndtm_pad1;__u16 ndtm_pad2; }; -struct ndt_config -{ +struct ndt_config {__u16 ndtc_key_len;__u16 ndtc_entry_size;__u32 ndtc_entries;
include/linux/netdevice.h +11 -19
@@ -125,8 +125,7 @@ typedef enum netdev_tx netdev_tx_t;* with byte counters. */ -struct net_device_stats -{ +struct net_device_stats {unsigned long rx_packets;/* total packets received */ unsigned long tx_packets;/* total packets transmitted */ unsigned long rx_bytes;/* total bytes received */
@@ -179,8 +178,7 @@ struct neighbour;struct neigh_parms ;struct sk_buff ; -struct netif_rx_stats -{ +struct netif_rx_stats {unsigned total;unsigned dropped;unsigned time_squeeze;
@@ -189,8 +187,7 @@ struct netif_rx_stats DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); -struct dev_addr_list -{ +struct dev_addr_list {struct dev_addr_list *next;u8 da_addr[MAX_ADDR_LEN ];u8 da_addrlen;
@@ -227,8 +224,7 @@ struct netdev_hw_addr_list {int count; }; -struct hh_cache -{ +struct hh_cache {struct hh_cache *hh_next;/* Next entry */ atomic_t hh_refcnt;/* number of users */ /*
@@ -291,8 +287,7 @@ struct header_ops {* code. */ -enum netdev_state_t -{ +enum netdev_state_t { __LINK_STATE_START, __LINK_STATE_PRESENT, __LINK_STATE_NOCARRIER,
@@ -341,8 +336,7 @@ struct napi_struct {struct sk_buff *skb; }; -enum -{ +enum {NAPI_STATE_SCHED ,/* Poll is scheduled */ NAPI_STATE_DISABLE ,/* Disable pending */ NAPI_STATE_NPSVC ,/* Netpoll - don't dequeue from poll_list */
@@ -458,8 +452,7 @@ static inline void napi_synchronize(const struct napi_struct *n)# define napi_synchronize (n) barrier()#endif -enum netdev_queue_state_t -{ +enum netdev_queue_state_t { __QUEUE_STATE_XOFF, __QUEUE_STATE_FROZEN, };
@@ -653,8 +646,7 @@ struct net_device_ops {* moves out. */ -struct net_device -{ +struct net_device {/* * This is the first field of the "visible" part of this structure
@@ -1229,8 +1221,7 @@ static inline int unregister_gifconf(unsigned int family)* Incoming packets are placed on per-cpu queues so that * no locking is needed. */ -struct softnet_data -{ +struct softnet_data {struct Qdisc *output_queue;struct sk_buff_head input_pkt_queue;struct list_head poll_list;
@@ -1627,7 +1618,8 @@ static inline int netif_dormant(const struct net_device *dev)* * Check if carrier is operational */ -static inline int netif_oper_up (const struct net_device *dev) { +static inline int netif_oper_up (const struct net_device *dev) +{return (dev->operstate ==IF_OPER_UP || dev->operstate ==IF_OPER_UNKNOWN /* backward compat */ ); }
include/linux/netfilter.h +2 -4
@@ -93,8 +93,7 @@ typedef unsigned int nf_hookfn(unsigned int hooknum,const struct net_device *out, int (*okfn)(struct sk_buff *)); -struct nf_hook_ops -{ +struct nf_hook_ops {struct list_head list;/* User fills in from here down. */
@@ -106,8 +105,7 @@ struct nf_hook_opsint priority; }; -struct nf_sockopt_ops -{ +struct nf_sockopt_ops {struct list_head list;u_int8_t pf;
include/linux/netfilter/nf_conntrack_common.h +2 -4
@@ -3,8 +3,7 @@/* Connection state tracking for netfilter. This is separated from, but required by, the NAT layer; it can also be used by an iptables extension. */ -enum ip_conntrack_info -{ +enum ip_conntrack_info {/* Part of an established connection (either direction). */ IP_CT_ESTABLISHED ,
@@ -76,8 +75,7 @@ enum ip_conntrack_status { }; #ifdef __KERNEL__ -struct ip_conntrack_stat -{ +struct ip_conntrack_stat { unsigned int searched; unsigned int found; unsigned int new;
include/linux/netfilter/nf_conntrack_ftp.h +1 -2
@@ -3,8 +3,7 @@/* FTP tracking. */ /* This enum is exposed to userspace */ -enum nf_ct_ftp_type -{ +enum nf_ct_ftp_type {/* PORT command from client */ NF_CT_FTP_PORT ,/* PASV response from server */
include/linux/netfilter/nf_conntrack_sctp.h +1 -2
@@ -16,8 +16,7 @@ enum sctp_conntrack {SCTP_CONNTRACK_MAX }; -struct ip_ct_sctp -{ +struct ip_ct_sctp {enum sctp_conntrack state;__be32 vtag[IP_CT_DIR_MAX ];
include/linux/netfilter/nf_conntrack_tcp.h +1 -2
@@ -55,8 +55,7 @@ struct ip_ct_tcp_state {u_int8_t flags;/* per direction options */ }; -struct ip_ct_tcp -{ +struct ip_ct_tcp {struct ip_ct_tcp_state seen[2 ];/* connection parameters per direction */ u_int8_t state;/* state of the connection (enum tcp_conntrack) */ /* For detecting stale connections */
include/linux/netfilter/nfnetlink.h +2 -4
@@ -55,8 +55,7 @@ struct nfgenmsg {#include <linux/capability.h> #include <net/netlink.h> -struct nfnl_callback -{ +struct nfnl_callback {int (*call)(struct sock *nl,struct sk_buff *skb,const struct nlmsghdr *nlh,const struct nlattr *const cda[]);
@@ -64,8 +63,7 @@ struct nfnl_callbackconst u_int16_t attr_count;/* number of nlattr's */ }; -struct nfnetlink_subsystem -{ +struct nfnetlink_subsystem {const char *name;__u8 subsys_id;/* nfnetlink subsystem ID */ __u8 cb_count;/* number of callbacks */
include/linux/netfilter/nfnetlink_compat.h +1 -2
@@ -21,8 +21,7 @@* ! nfnetlink use the same attributes methods. - J. Schulist. */ -struct nfattr -{ +struct nfattr {__u16 nfa_len;__u16 nfa_type;/* we use 15 bits for the type, and the highest * bit to indicate whether the payload is nested */
include/linux/netfilter/x_tables.h +15 -30
133 lines not on this page · raw message
include/linux/netfilter/xt_connbytes.h +1 -2
@@ -15,8 +15,7 @@ enum xt_connbytes_direction { XT_CONNBYTES_DIR_BOTH, }; -struct xt_connbytes_info -{ +struct xt_connbytes_info {struct {aligned_u64 from;/* count to be matched */ aligned_u64 to;/* count to be matched */
include/linux/netfilter/xt_esp.h +1 -2
@@ -3,8 +3,7 @@#include <linux/types.h> -struct xt_esp -{ +struct xt_esp {__u32 spis[2 ];/* Security Parameter Index */ __u8 invflags;/* Inverse flags */ };
include/linux/netfilter/xt_multiport.h +3 -6
@@ -3,8 +3,7 @@#include <linux/types.h> -enum xt_multiport_flags -{ +enum xt_multiport_flags {XT_MULTIPORT_SOURCE ,XT_MULTIPORT_DESTINATION ,XT_MULTIPORT_EITHER
@@ -13,15 +12,13 @@ enum xt_multiport_flags#define XT_MULTI_PORTS 15/* Must fit inside union xt_matchinfo: 16 bytes */ -struct xt_multiport -{ +struct xt_multiport {__u8 flags;/* Type of comparison */ __u8 count;/* Number of ports */ __u16 ports[XT_MULTI_PORTS ];/* Ports */ }; -struct xt_multiport_v1 -{ +struct xt_multiport_v1 {__u8 flags;/* Type of comparison */ __u8 count;/* Number of ports */ __u16 ports[XT_MULTI_PORTS ];/* Ports */
include/linux/netfilter/xt_policy.h +6 -12
@@ -5,22 +5,19 @@#define XT_POLICY_MAX_ELEM 4 -enum xt_policy_flags -{ +enum xt_policy_flags {XT_POLICY_MATCH_IN =0x1 ,XT_POLICY_MATCH_OUT =0x2 ,XT_POLICY_MATCH_NONE =0x4 ,XT_POLICY_MATCH_STRICT =0x8 , }; -enum xt_policy_modes -{ +enum xt_policy_modes {XT_POLICY_MODE_TRANSPORT ,XT_POLICY_MODE_TUNNEL }; -struct xt_policy_spec -{ +struct xt_policy_spec {__u8 saddr:1 , daddr:1 , proto:1,
@@ -30,15 +27,13 @@ struct xt_policy_spec };#ifndef __KERNEL__ -union xt_policy_addr -{ +union xt_policy_addr {struct in_addr a4;struct in6_addr a6; };#endif -struct xt_policy_elem -{ +struct xt_policy_elem { union { #ifdef __KERNEL__ struct {
@@ -65,8 +60,7 @@ struct xt_policy_elemstruct xt_policy_spec invert; }; -struct xt_policy_info -{ +struct xt_policy_info {struct xt_policy_elem pol[XT_POLICY_MAX_ELEM ];__u16 flags;__u16 len;
include/linux/netfilter/xt_state.h +1 -2
@@ -6,8 +6,7 @@#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) -struct xt_state_info -{ +struct xt_state_info {unsigned int statemask; };#endif /*_XT_STATE_H*/
include/linux/netfilter/xt_string.h +1 -2
@@ -11,8 +11,7 @@ enum {XT_STRING_FLAG_IGNORECASE =0x02 }; -struct xt_string_info -{ +struct xt_string_info {__u16 from_offset;__u16 to_offset;char algo[XT_STRING_MAX_ALGO_NAME_SIZE ];
include/linux/netfilter/xt_tcpudp.h +2 -4
@@ -4,8 +4,7 @@#include <linux/types.h> /* TCP matching stuff */ -struct xt_tcp -{ +struct xt_tcp {__u16 spts[2 ];/* Source port range. */ __u16 dpts[2 ];/* Destination port range. */ __u8 option;/* TCP Option iff non-zero*/
@@ -22,8 +21,7 @@ struct xt_tcp#define XT_TCP_INV_MASK 0x0F/* All possible flags. */ /* UDP matching stuff */ -struct xt_udp -{ +struct xt_udp {__u16 spts[2 ];/* Source port range. */ __u16 dpts[2 ];/* Destination port range. */ __u8 invflags;/* Inverse flags */
include/linux/netfilter_arp/arp_tables.h +7 -14
@@ -132,8 +132,7 @@ struct arpt_entry#define ARPT_RETURN XT_RETURN/* The argument to ARPT_SO_GET_INFO */ -struct arpt_getinfo -{ +struct arpt_getinfo {/* Which table: caller fills this in. */ char name[ARPT_TABLE_MAXNAMELEN ];
@@ -155,8 +154,7 @@ struct arpt_getinfo };/* The argument to ARPT_SO_SET_REPLACE. */ -struct arpt_replace -{ +struct arpt_replace {/* Which table. */ char name[ARPT_TABLE_MAXNAMELEN ];
@@ -191,8 +189,7 @@ struct arpt_replace#define arpt_counters xt_counters/* The argument to ARPT_SO_GET_ENTRIES. */ -struct arpt_get_entries -{ +struct arpt_get_entries {/* Which table: user fills this in. */ char name[ARPT_TABLE_MAXNAMELEN ];
@@ -224,20 +221,17 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e#ifdef __KERNEL__/* Standard entry. */ -struct arpt_standard -{ +struct arpt_standard {struct arpt_entry entry;struct arpt_standard_target target; }; -struct arpt_error_target -{ +struct arpt_error_target {struct arpt_entry_target target;char errorname[ARPT_FUNCTION_MAXNAMELEN ]; }; -struct arpt_error -{ +struct arpt_error {struct arpt_entry entry;struct arpt_error_target target; };
@@ -279,8 +273,7 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, #ifdef CONFIG_COMPAT #include <net/compat.h> -struct compat_arpt_entry -{ +struct compat_arpt_entry { struct arpt_arp arp; u_int16_t target_offset; u_int16_t next_offset;
include/linux/netfilter_bridge/ebt_802_3.h +1 -2
@@ -58,8 +58,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) }#endif -struct ebt_802_3_info -{ +struct ebt_802_3_info {uint8_t sap;__be16 type;uint8_t bitmask;
include/linux/netfilter_bridge/ebt_among.h +3 -6
@@ -29,14 +29,12 @@* Yes, it is a memory overhead, but in 2003 AD, who cares? */ -struct ebt_mac_wormhash_tuple -{ +struct ebt_mac_wormhash_tuple {uint32_t cmp[2 ];__be32 ip; }; -struct ebt_mac_wormhash -{ +struct ebt_mac_wormhash {int table[257 ];int poolsize;struct ebt_mac_wormhash_tuple pool[0 ];
@@ -45,8 +43,7 @@ struct ebt_mac_wormhash#define ebt_mac_wormhash_size (x) ((x) ? sizeof(struct ebt_mac_wormhash) \ + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0) -struct ebt_among_info -{ +struct ebt_among_info {int wh_dst_ofs;int wh_src_ofs;int bitmask;
include/linux/netfilter_bridge/ebt_arpreply.h +1 -2
@@ -1,8 +1,7 @@#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H#define __LINUX_BRIDGE_EBT_ARPREPLY_H -struct ebt_arpreply_info -{ +struct ebt_arpreply_info {unsigned char mac[ETH_ALEN ];int target; };
include/linux/netfilter_bridge/ebt_ip.h +1 -2
@@ -26,8 +26,7 @@#define EBT_IP_MATCH "ip"/* the same values are used for the invflags */ -struct ebt_ip_info -{ +struct ebt_ip_info {__be32 saddr;__be32 daddr;__be32 smsk;
include/linux/netfilter_bridge/ebt_ip6.h +1 -2
@@ -23,8 +23,7 @@#define EBT_IP6_MATCH "ip6"/* the same values are used for the invflags */ -struct ebt_ip6_info -{ +struct ebt_ip6_info {struct in6_addr saddr;struct in6_addr daddr;struct in6_addr smsk;
include/linux/netfilter_bridge/ebt_limit.h +1 -2
@@ -9,8 +9,7 @@/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 seconds, or one every 59 hours. */ -struct ebt_limit_info -{ +struct ebt_limit_info {u_int32_t avg;/* Average secs between packets * scale */ u_int32_t burst;/* Period multiplier for upper limit. */
include/linux/netfilter_bridge/ebt_log.h +1 -2
@@ -9,8 +9,7 @@#define EBT_LOG_PREFIX_SIZE 30#define EBT_LOG_WATCHER "log" -struct ebt_log_info -{ +struct ebt_log_info {uint8_t loglevel;uint8_t prefix[EBT_LOG_PREFIX_SIZE ];uint32_t bitmask;
include/linux/netfilter_bridge/ebt_mark_m.h +1 -2
@@ -4,8 +4,7 @@#define EBT_MARK_AND 0x01#define EBT_MARK_OR 0x02#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR) -struct ebt_mark_m_info -{ +struct ebt_mark_m_info {unsigned long mark, mask;uint8_t invert;uint8_t bitmask;
include/linux/netfilter_bridge/ebt_mark_t.h +1 -2
@@ -13,8 +13,7 @@#define MARK_AND_VALUE (0xffffffd0)#define MARK_XOR_VALUE (0xffffffc0) -struct ebt_mark_t_info -{ +struct ebt_mark_t_info {unsigned long mark;/* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ int target;
include/linux/netfilter_bridge/ebt_nat.h +1 -2
@@ -2,8 +2,7 @@#define __LINUX_BRIDGE_EBT_NAT_H#define NAT_ARP_BIT (0x00000010) -struct ebt_nat_info -{ +struct ebt_nat_info {unsigned char mac[ETH_ALEN ];/* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ int target;
include/linux/netfilter_bridge/ebt_pkttype.h +1 -2
@@ -1,8 +1,7 @@#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H#define __LINUX_BRIDGE_EBT_PKTTYPE_H -struct ebt_pkttype_info -{ +struct ebt_pkttype_info {uint8_t pkt_type;uint8_t invert; };
include/linux/netfilter_bridge/ebt_redirect.h +1 -2
@@ -1,8 +1,7 @@#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H#define __LINUX_BRIDGE_EBT_REDIRECT_H -struct ebt_redirect_info -{ +struct ebt_redirect_info {/* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ int target; };
include/linux/netfilter_bridge/ebt_stp.h +2 -4
@@ -20,8 +20,7 @@#define EBT_STP_MATCH "stp" -struct ebt_stp_config_info -{ +struct ebt_stp_config_info {uint8_t flags;uint16_t root_priol, root_priou;char root_addr[6 ], root_addrmsk[6 ];
@@ -35,8 +34,7 @@ struct ebt_stp_config_infouint16_t forward_delayl, forward_delayu; }; -struct ebt_stp_info -{ +struct ebt_stp_info {uint8_t type;struct ebt_stp_config_info config;uint16_t bitmask;
include/linux/netfilter_bridge/ebtables.h +13 -26
@@ -34,14 +34,12 @@struct xt_match ;struct xt_target ; -struct ebt_counter -{ +struct ebt_counter {uint64_t pcnt;uint64_t bcnt; }; -struct ebt_replace -{ +struct ebt_replace {char name[EBT_TABLE_MAXNAMELEN ];unsigned int valid_hooks;/* nr of rules in the table */
@@ -57,8 +55,7 @@ struct ebt_replacechar __user *entries; }; -struct ebt_replace_kernel -{ +struct ebt_replace_kernel {char name[EBT_TABLE_MAXNAMELEN ];unsigned int valid_hooks;/* nr of rules in the table */
@@ -120,8 +117,7 @@ struct ebt_entries {#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) -struct ebt_entry_match -{ +struct ebt_entry_match {union {char name[EBT_FUNCTION_MAXNAMELEN ];struct xt_match *match;
@@ -131,8 +127,7 @@ struct ebt_entry_match unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); }; -struct ebt_entry_watcher -{ +struct ebt_entry_watcher {union {char name[EBT_FUNCTION_MAXNAMELEN ];struct xt_target *watcher;
@@ -142,8 +137,7 @@ struct ebt_entry_watcher unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); }; -struct ebt_entry_target -{ +struct ebt_entry_target {union {char name[EBT_FUNCTION_MAXNAMELEN ];struct xt_target *target;
@@ -154,8 +148,7 @@ struct ebt_entry_target };#define EBT_STANDARD_TARGET "standard" -struct ebt_standard_target -{ +struct ebt_standard_target {struct ebt_entry_target target;int verdict; };
@@ -206,8 +199,7 @@ struct ebt_entry {#define EBT_MATCH 0#define EBT_NOMATCH 1 -struct ebt_match -{ +struct ebt_match {struct list_head list;const char name[EBT_FUNCTION_MAXNAMELEN ]; bool (*match)(const struct sk_buff *skb, const struct net_device *in,
@@ -224,8 +216,7 @@ struct ebt_matchstruct module *me; }; -struct ebt_watcher -{ +struct ebt_watcher {struct list_head list;const char name[EBT_FUNCTION_MAXNAMELEN ]; unsigned int (*target)(struct sk_buff *skb,
@@ -242,8 +233,7 @@ struct ebt_watcherstruct module *me; }; -struct ebt_target -{ +struct ebt_target {struct list_head list;const char name[EBT_FUNCTION_MAXNAMELEN ];/* returns one of the standard EBT_* verdicts */
@@ -262,15 +252,13 @@ struct ebt_target };/* used for jumping from and into user defined chains (udc) */ -struct ebt_chainstack -{ +struct ebt_chainstack {struct ebt_entries *chaininfo;/* pointer to chain data */ struct ebt_entry *e;/* pointer to entry data */ unsigned int n;/* n'th entry */ }; -struct ebt_table_info -{ +struct ebt_table_info {/* total size of the entries */ unsigned int entries_size;unsigned int nentries;
@@ -282,8 +270,7 @@ struct ebt_table_infostruct ebt_counter counters[0 ]____cacheline_aligned ; }; -struct ebt_table -{ +struct ebt_table {struct list_head list;char name[EBT_TABLE_MAXNAMELEN ];struct ebt_replace_kernel *table;
include/linux/netfilter_ipv4/ip_tables.h +9 -18
@@ -76,8 +76,7 @@ struct ipt_ip {/* This structure defines each of the firewall rules. Consists of 3 parts which are 1) general IP header stuff 2) match specific stuff 3) the target to perform if the rule matches */ -struct ipt_entry -{ +struct ipt_entry {struct ipt_ip ip;/* Mark with fields that we care about. */
@@ -135,8 +134,7 @@ struct ipt_entry#define IPT_UDP_INV_MASK XT_UDP_INV_MASK/* ICMP matching stuff */ -struct ipt_icmp -{ +struct ipt_icmp {u_int8_t type;/* type to match */ u_int8_t code[2 ];/* range of code */ u_int8_t invflags;/* Inverse flags */
@@ -146,8 +144,7 @@ struct ipt_icmp#define IPT_ICMP_INV 0x01/* Invert the sense of type/code test */ /* The argument to IPT_SO_GET_INFO */ -struct ipt_getinfo -{ +struct ipt_getinfo {/* Which table: caller fills this in. */ char name[IPT_TABLE_MAXNAMELEN ];
@@ -169,8 +166,7 @@ struct ipt_getinfo };/* The argument to IPT_SO_SET_REPLACE. */ -struct ipt_replace -{ +struct ipt_replace {/* Which table. */ char name[IPT_TABLE_MAXNAMELEN ];
@@ -204,8 +200,7 @@ struct ipt_replace#define ipt_counters_info xt_counters_info/* The argument to IPT_SO_GET_ENTRIES. */ -struct ipt_get_entries -{ +struct ipt_get_entries {/* Which table: user fills this in. */ char name[IPT_TABLE_MAXNAMELEN ];
@@ -250,20 +245,17 @@ extern struct xt_table *ipt_register_table(struct net *net,extern void ipt_unregister_table (struct xt_table *table);/* Standard entry. */ -struct ipt_standard -{ +struct ipt_standard {struct ipt_entry entry;struct ipt_standard_target target; }; -struct ipt_error_target -{ +struct ipt_error_target {struct ipt_entry_target target;char errorname[IPT_FUNCTION_MAXNAMELEN ]; }; -struct ipt_error -{ +struct ipt_error {struct ipt_entry entry;struct ipt_error_target target; };
@@ -301,8 +293,7 @@ extern unsigned int ipt_do_table(struct sk_buff *skb, #ifdef CONFIG_COMPAT #include <net/compat.h> -struct compat_ipt_entry -{ +struct compat_ipt_entry { struct ipt_ip ip; compat_uint_t nfcache; u_int16_t target_offset;
include/linux/netfilter_ipv4/ipt_SAME.h +1 -2
@@ -5,8 +5,7 @@#define IPT_SAME_NODST 0x01 -struct ipt_same_info -{ +struct ipt_same_info {unsigned char info;u_int32_t rangesize;u_int32_t ipnum;
include/linux/netfilter_ipv4/ipt_ah.h +1 -2
@@ -1,8 +1,7 @@#ifndef _IPT_AH_H#define _IPT_AH_H -struct ipt_ah -{ +struct ipt_ah {u_int32_t spis[2 ];/* Security Parameter Index */ u_int8_t invflags;/* Inverse flags */ };
include/linux/netfilter_ipv6/ip6_tables.h +9 -18
@@ -88,8 +88,7 @@ struct ip6t_ip6 {/* This structure defines each of the firewall rules. Consists of 3 parts which are 1) general IP header stuff 2) match specific stuff 3) the target to perform if the rule matches */ -struct ip6t_entry -{ +struct ip6t_entry {struct ip6t_ip6 ipv6;/* Mark with fields that we care about. */
@@ -111,20 +110,17 @@ struct ip6t_entry };/* Standard entry */ -struct ip6t_standard -{ +struct ip6t_standard {struct ip6t_entry entry;struct ip6t_standard_target target; }; -struct ip6t_error_target -{ +struct ip6t_error_target {struct ip6t_entry_target target;char errorname[IP6T_FUNCTION_MAXNAMELEN ]; }; -struct ip6t_error -{ +struct ip6t_error {struct ip6t_entry entry;struct ip6t_error_target target; };
@@ -195,8 +191,7 @@ struct ip6t_error#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK/* ICMP matching stuff */ -struct ip6t_icmp -{ +struct ip6t_icmp {u_int8_t type;/* type to match */ u_int8_t code[2 ];/* range of code */ u_int8_t invflags;/* Inverse flags */
@@ -206,8 +201,7 @@ struct ip6t_icmp#define IP6T_ICMP_INV 0x01/* Invert the sense of type/code test */ /* The argument to IP6T_SO_GET_INFO */ -struct ip6t_getinfo -{ +struct ip6t_getinfo {/* Which table: caller fills this in. */ char name[IP6T_TABLE_MAXNAMELEN ];
@@ -229,8 +223,7 @@ struct ip6t_getinfo };/* The argument to IP6T_SO_SET_REPLACE. */ -struct ip6t_replace -{ +struct ip6t_replace {/* Which table. */ char name[IP6T_TABLE_MAXNAMELEN ];
@@ -264,8 +257,7 @@ struct ip6t_replace#define ip6t_counters_info xt_counters_info/* The argument to IP6T_SO_GET_ENTRIES. */ -struct ip6t_get_entries -{ +struct ip6t_get_entries {/* Which table: user fills this in. */ char name[IP6T_TABLE_MAXNAMELEN ];
@@ -330,8 +322,7 @@ extern int ip6_masked_addrcmp(const struct in6_addr *addr1, #ifdef CONFIG_COMPAT #include <net/compat.h> -struct compat_ip6t_entry -{ +struct compat_ip6t_entry { struct ip6t_ip6 ipv6; compat_uint_t nfcache; u_int16_t target_offset;
include/linux/netfilter_ipv6/ip6t_ah.h +1 -2
@@ -1,8 +1,7 @@ #ifndef _IP6T_AH_H #define _IP6T_AH_H -struct ip6t_ah -{ +struct ip6t_ah { u_int32_t spis[2]; /* Security Parameter Index */ u_int32_t hdrlen; /* Header Length */ u_int8_t hdrres; /* Test of the Reserved Filed */
include/linux/netfilter_ipv6/ip6t_frag.h +1 -2
@@ -1,8 +1,7 @@ #ifndef _IP6T_FRAG_H #define _IP6T_FRAG_H -struct ip6t_frag -{ +struct ip6t_frag { u_int32_t ids[2]; /* Security Parameter Index */ u_int32_t hdrlen; /* Header Length */ u_int8_t flags; /* */
include/linux/netfilter_ipv6/ip6t_ipv6header.h +1 -2
@@ -8,8 +8,7 @@ on whether they contain certain headers */ #ifndef __IPV6HEADER_H #define __IPV6HEADER_H -struct ip6t_ipv6header_info -{ +struct ip6t_ipv6header_info { u_int8_t matchflags; u_int8_t invflags; u_int8_t modeflag;
include/linux/netfilter_ipv6/ip6t_mh.h +1 -2
@@ -2,8 +2,7 @@#define _IP6T_MH_H/* MH matching stuff */ -struct ip6t_mh -{ +struct ip6t_mh {u_int8_t types[2 ];/* MH type range */ u_int8_t invflags;/* Inverse flags */ };
include/linux/netfilter_ipv6/ip6t_opts.h +1 -2
@@ -3,8 +3,7 @@#define IP6T_OPTS_OPTSNR 16 -struct ip6t_opts -{ +struct ip6t_opts {u_int32_t hdrlen;/* Header Length */ u_int8_t flags;/* */ u_int8_t invflags;/* Inverse flags */
include/linux/netfilter_ipv6/ip6t_rt.h +1 -2
@@ -5,8 +5,7 @@#define IP6T_RT_HOPS 16 -struct ip6t_rt -{ +struct ip6t_rt {u_int32_t rt_type;/* Routing Type */ u_int32_t segsleft[2 ];/* Segments Left */ u_int32_t hdrlen;/* Header Length */
include/linux/netlink.h +8 -16
@@ -29,16 +29,14 @@struct net ; -struct sockaddr_nl -{ +struct sockaddr_nl {sa_family_t nl_family;/* AF_NETLINK */ unsigned short nl_pad;/* zero */ __u32 nl_pid;/* port ID */ __u32 nl_groups;/* multicast groups mask */ }; -struct nlmsghdr -{ +struct nlmsghdr {__u32 nlmsg_len;/* Length of message including header */ __u16 nlmsg_type;/* Message content */ __u16 nlmsg_flags;/* Additional flags */
@@ -94,8 +92,7 @@ struct nlmsghdr#define NLMSG_MIN_TYPE 0x10/* < 0x10: reserved control messages */ -struct nlmsgerr -{ +struct nlmsgerr {int error;struct nlmsghdr msg; };
@@ -106,8 +103,7 @@ struct nlmsgerr#define NETLINK_BROADCAST_ERROR 4#define NETLINK_NO_ENOBUFS 5 -struct nl_pktinfo -{ +struct nl_pktinfo {__u32 group; };
@@ -127,8 +123,7 @@ enum {* <-------------- nlattr->nla_len --------------> */ -struct nlattr -{ +struct nlattr {__u16 nla_len;__u16 nla_type; };
@@ -161,8 +156,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)return (struct nlmsghdr *)skb->data; } -struct netlink_skb_parms -{ +struct netlink_skb_parms {struct ucred creds;/* Skb credentials */ __u32 pid;__u32 dst_group;
@@ -220,8 +214,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb);#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) -struct netlink_callback -{ +struct netlink_callback {struct sk_buff *skb;const struct nlmsghdr *nlh; int (*dump)(struct sk_buff * skb,
@@ -231,8 +224,7 @@ struct netlink_callbacklong args[6 ]; }; -struct netlink_notify -{ +struct netlink_notify {struct net *net;int pid;int protocol;
include/linux/pkt_cls.h +28 -56
242 lines not on this page · raw message
include/linux/pkt_sched.h +37 -74
324 lines not on this page · raw message
include/linux/route.h +1 -2
@@ -27,8 +27,7 @@#include <linux/compiler.h> /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ -struct rtentry -{ +struct rtentry {unsigned long rt_pad1;struct sockaddr rt_dst;/* target address */ struct sockaddr rt_gateway;/* gateway addr (RTF_GATEWAY) */
include/linux/rtnetlink.h +19 -38
171 lines not on this page · raw message
include/linux/skbuff.h +1 -2
@@ -491,8 +491,7 @@ extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, int len,int odd, struct sk_buff *skb), void *from, int length); -struct skb_seq_state -{ +struct skb_seq_state {__u32 lower_offset;__u32 upper_offset;__u32 frag_idx;
include/linux/tc_act/tc_defact.h +2 -4
@@ -3,13 +3,11 @@#include <linux/pkt_cls.h> -struct tc_defact -{ +struct tc_defact {tc_gen ; }; -enum -{ +enum {TCA_DEF_UNSPEC ,TCA_DEF_TM ,TCA_DEF_PARMS ,
include/linux/tc_act/tc_gact.h +3 -6
@@ -5,14 +5,12 @@#include <linux/pkt_cls.h> #define TCA_ACT_GACT 5 -struct tc_gact -{ +struct tc_gact {tc_gen ; }; -struct tc_gact_p -{ +struct tc_gact_p {#define PGACT_NONE 0#define PGACT_NETRAND 1#define PGACT_DETERM 2
@@ -22,8 +20,7 @@ struct tc_gact_pint paction; }; -enum -{ +enum {TCA_GACT_UNSPEC ,TCA_GACT_TM ,TCA_GACT_PARMS ,
include/linux/tc_act/tc_ipt.h +1 -2
@@ -5,8 +5,7 @@#define TCA_ACT_IPT 6 -enum -{ +enum {TCA_IPT_UNSPEC ,TCA_IPT_TABLE ,TCA_IPT_HOOK ,
include/linux/tc_act/tc_mirred.h +2 -4
@@ -10,15 +10,13 @@#define TCA_INGRESS_REDIR 3/* packet redirect to INGRESS*/ #define TCA_INGRESS_MIRROR 4/* mirror packet to INGRESS */ -struct tc_mirred -{ +struct tc_mirred {tc_gen ;int eaction;/* one of IN/EGRESS_MIRROR/REDIR */ __u32 ifindex;/* ifindex of egress port */ }; -enum -{ +enum {TCA_MIRRED_UNSPEC ,TCA_MIRRED_TM ,TCA_MIRRED_PARMS ,
include/linux/tc_act/tc_nat.h +2 -4
@@ -6,8 +6,7 @@#define TCA_ACT_NAT 9 -enum -{ +enum {TCA_NAT_UNSPEC ,TCA_NAT_PARMS ,TCA_NAT_TM ,
@@ -17,8 +16,7 @@ enum#define TCA_NAT_FLAG_EGRESS 1 -struct tc_nat -{ +struct tc_nat {tc_gen ;__be32 old_addr;__be32 new_addr;
include/linux/tc_act/tc_pedit.h +3 -6
@@ -6,8 +6,7 @@#define TCA_ACT_PEDIT 7 -enum -{ +enum {TCA_PEDIT_UNSPEC ,TCA_PEDIT_TM ,TCA_PEDIT_PARMS ,
@@ -15,8 +14,7 @@ enum };#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) -struct tc_pedit_key -{ +struct tc_pedit_key {__u32 mask;/* AND */ __u32 val;/*XOR */ __u32 off;/*offset */
@@ -25,8 +23,7 @@ struct tc_pedit_key__u32 shift; }; -struct tc_pedit_sel -{ +struct tc_pedit_sel {tc_gen ;unsigned char nkeys;unsigned char flags;
include/linux/tc_ematch/tc_em_cmp.h +2 -4
@@ -4,8 +4,7 @@#include <linux/types.h> #include <linux/pkt_cls.h> -struct tcf_em_cmp -{ +struct tcf_em_cmp {__u32 val;__u32 mask;__u16 off;
@@ -15,8 +14,7 @@ struct tcf_em_cmp __u8 opnd:4; }; -enum -{ +enum {TCF_EM_ALIGN_U8 =1 ,TCF_EM_ALIGN_U16 =2 ,TCF_EM_ALIGN_U32 =4
include/linux/tc_ematch/tc_em_meta.h +5 -10
@@ -4,8 +4,7 @@#include <linux/types.h> #include <linux/pkt_cls.h> -enum -{ +enum {TCA_EM_META_UNSPEC ,TCA_EM_META_HDR ,TCA_EM_META_LVALUE ,
@@ -14,8 +13,7 @@ enum };#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) -struct tcf_meta_val -{ +struct tcf_meta_val {__u16 kind;__u8 shift;__u8 op;
@@ -26,16 +24,14 @@ struct tcf_meta_val#define TCF_META_ID_MASK 0x7ff#define TCF_META_ID (kind) ((kind) & TCF_META_ID_MASK) -enum -{ +enum {TCF_META_TYPE_VAR ,TCF_META_TYPE_INT , __TCF_META_TYPE_MAX };#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) -enum -{ +enum {TCF_META_ID_VALUE ,TCF_META_ID_RANDOM ,TCF_META_ID_LOADAVG_0 ,
@@ -87,8 +83,7 @@ enum };#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) -struct tcf_meta_hdr -{ +struct tcf_meta_hdr {struct tcf_meta_val left;struct tcf_meta_val right; };
include/linux/tc_ematch/tc_em_nbyte.h +1 -2
@@ -4,8 +4,7 @@#include <linux/types.h> #include <linux/pkt_cls.h> -struct tcf_em_nbyte -{ +struct tcf_em_nbyte {__u16 off;__u16 len:12 ;__u8 layer:4 ;
include/linux/tc_ematch/tc_em_text.h +1 -2
@@ -6,8 +6,7 @@#define TC_EM_TEXT_ALGOSIZ 16 -struct tcf_em_text -{ +struct tcf_em_text {char algo[TC_EM_TEXT_ALGOSIZ ];__u16 from_offset;__u16 to_offset;
include/linux/tcp.h +2 -4
@@ -102,8 +102,7 @@ enum {#define TCPI_OPT_WSCALE 4#define TCPI_OPT_ECN 8 -enum tcp_ca_state -{ +enum tcp_ca_state { TCP_CA_Open =0 ,#define TCPF_CA_Open (1<<TCP_CA_Open) TCP_CA_Disorder = 1,
@@ -116,8 +115,7 @@ enum tcp_ca_state#define TCPF_CA_Loss (1<<TCP_CA_Loss) }; -struct tcp_info -{ +struct tcp_info {__u8 tcpi_state;__u8 tcpi_ca_state;__u8 tcpi_retransmits;
include/linux/xfrm.h +9 -18
@@ -10,8 +10,7 @@/* Structure to encapsulate addresses. I do not want to use * "standard" structure. My apologies. */ -typedef union -{ +typedef union {__be32 a4;__be32 a6[4 ]; }xfrm_address_t ;
@@ -20,8 +19,7 @@ typedef union* the state by (spi,daddr,ah/esp) or to store information about * spi, protocol and tunnel address on output. */ -struct xfrm_id -{ +struct xfrm_id {xfrm_address_t daddr;__be32 spi;__u8 proto;
@@ -45,8 +43,7 @@ struct xfrm_sec_ctx {/* Selector, used as selector both on policy rules (SPD) and SAs. */ -struct xfrm_selector -{ +struct xfrm_selector {xfrm_address_t daddr;xfrm_address_t saddr;__be16 dport;
@@ -63,8 +60,7 @@ struct xfrm_selector#define XFRM_INF (~(__u64)0)
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH net-next-2.6] net: cleanup include/linux
From: Eric Dumazet <[email protected]>
Date: Wed, 04 Nov 2009 18:48:11 +0100
Quoted 5 lines
[PATCH net-next-2.6] net: cleanup
include/linuxThis cleanup patch puts struct/union/enum opening braces, in first line to ease grep games.
Quoted 8 lines
struct something
{becomes :
struct something {
Signed-off-by Eric Dumazet <[email protected]>
Applied, thanks.
From: [email protected] (Eric W. Biederman)
Date: Tue, 03 Nov 2009 01:03:02 -0800
Quoted 11 lines
There is no good reason to not support userspace specifying the network namespace during device creation, and it makes it easier to create a network device and pass it to a child network namespace with a well known name.
We have to be careful to ensure that the target network namespace for the new device exists through the life of the call. To keep that logic clear I have factored out the network namespace grabbing logic into
rtnl_link_get_net.
Quoted 5 lines
In addtion we need to continue to pass the source network namespace to the rtnl_link_ops.newlink method so that we can find the base device source network namespace.
Signed-off-by Eric W. Biederman <[email protected]>
Applied to net-next-2.6, thanks!