Commit fd2c3ef7 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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 {
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b7673a0
......@@ -8,8 +8,7 @@
struct crypto_ahash;
struct ah_data
{
struct ah_data {
int icv_full_len;
int icv_trunc_len;
......
......@@ -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];
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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_rule
struct 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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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_ifaddr
int 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_socklist
struct 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;
......
......@@ -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 */
......
......@@ -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,
......
......@@ -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_config
struct 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;
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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_tunnel
unsigned 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;
......
......@@ -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;
};
......
......@@ -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];
......
......@@ -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_parms
int 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_statistics
preempt_enable(); \
} while (0)
struct neighbour
{
struct neighbour {
struct neighbour *next;
struct neigh_table *tbl;
struct neigh_parms *parms;
......@@ -122,8 +119,7 @@ struct neighbour
u8 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_ops
int (*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;
......
......@@ -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 */
......
......@@ -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;
};
......
......@@ -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).
......
......@@ -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 */
......
......@@ -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;