headers, net: Use __kernel_sa_family_t in more definitions shared with userland
authorBen Hutchings <ben@decadent.org.uk>
Wed, 24 Aug 2011 18:43:55 +0000 (18:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Aug 2011 16:02:50 +0000 (12:02 -0400)
Complete the work started with commit
6602a4baf4d1a73cc4685a39ef859e1c5ddf654c ('net: Make userland include
of netlink.h more sane').

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
include/linux/atalk.h
include/linux/ax25.h
include/linux/caif/caif_socket.h
include/linux/can.h
include/linux/if_pppox.h
include/linux/in.h
include/linux/ipx.h
include/linux/irda.h
include/linux/l2tp.h
include/linux/llc.h
include/linux/netlink.h
include/linux/phonet.h
include/linux/rose.h
include/linux/un.h
include/linux/x25.h

index d34c187..f57c368 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
 #include <linux/types.h>
 #include <asm/byteorder.h>
+#include <linux/socket.h>
 
 /*
  * AppleTalk networking structures
 
 /*
  * AppleTalk networking structures
@@ -28,7 +29,7 @@ struct atalk_addr {
 };
 
 struct sockaddr_at {
 };
 
 struct sockaddr_at {
-       sa_family_t       sat_family;
+       __kernel_sa_family_t sat_family;
        __u8              sat_port;
        struct atalk_addr sat_addr;
        char              sat_zero[8];
        __u8              sat_port;
        struct atalk_addr sat_addr;
        char              sat_zero[8];
index 56c11f0..74c89a4 100644 (file)
@@ -47,7 +47,7 @@ typedef struct {
 } ax25_address;
 
 struct sockaddr_ax25 {
 } ax25_address;
 
 struct sockaddr_ax25 {
-       sa_family_t     sax25_family;
+       __kernel_sa_family_t sax25_family;
        ax25_address    sax25_call;
        int             sax25_ndigis;
        /* Digipeater ax25_address sets follow */
        ax25_address    sax25_call;
        int             sax25_ndigis;
        /* Digipeater ax25_address sets follow */
index d9cb19b..3f3bac6 100644 (file)
@@ -9,12 +9,7 @@
 #define _LINUX_CAIF_SOCKET_H
 
 #include <linux/types.h>
 #define _LINUX_CAIF_SOCKET_H
 
 #include <linux/types.h>
-
-#ifdef __KERNEL__
 #include <linux/socket.h>
 #include <linux/socket.h>
-#else
-#include <sys/socket.h>
-#endif
 
 /**
  * enum caif_link_selector -    Physical Link Selection.
 
 /**
  * enum caif_link_selector -    Physical Link Selection.
@@ -144,7 +139,7 @@ enum caif_debug_service {
  * CAIF Channel. It defines the service to connect to on the modem.
  */
 struct sockaddr_caif {
  * CAIF Channel. It defines the service to connect to on the modem.
  */
 struct sockaddr_caif {
-       sa_family_t  family;
+       __kernel_sa_family_t  family;
        union {
                struct {
                        __u8  type;             /* type: enum caif_at_type */
        union {
                struct {
                        __u8  type;             /* type: enum caif_at_type */
index d183333..bb047dc 100644 (file)
@@ -78,7 +78,7 @@ struct can_frame {
  * @can_addr:    protocol specific address information
  */
 struct sockaddr_can {
  * @can_addr:    protocol specific address information
  */
 struct sockaddr_can {
-       sa_family_t can_family;
+       __kernel_sa_family_t can_family;
        int         can_ifindex;
        union {
                /* transport protocol class address information (e.g. ISOTP) */
        int         can_ifindex;
        union {
                /* transport protocol class address information (e.g. ISOTP) */
index 60e5558..b5f927f 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
+#include <linux/socket.h>
 #include <linux/if_ether.h>
 #ifdef  __KERNEL__
 #include <linux/if.h>
 #include <linux/if_ether.h>
 #ifdef  __KERNEL__
 #include <linux/if.h>
@@ -63,7 +64,7 @@ struct pptp_addr {
 #define PX_MAX_PROTO   3
 
 struct sockaddr_pppox {
 #define PX_MAX_PROTO   3
 
 struct sockaddr_pppox {
-       sa_family_t     sa_family;            /* address family, AF_PPPOX */
+       __kernel_sa_family_t sa_family;       /* address family, AF_PPPOX */
        unsigned int    sa_protocol;          /* protocol identifier */
        union {
                struct pppoe_addr  pppoe;
        unsigned int    sa_protocol;          /* protocol identifier */
        union {
                struct pppoe_addr  pppoe;
@@ -77,7 +78,7 @@ struct sockaddr_pppox {
  * type instead.
  */
 struct sockaddr_pppol2tp {
  * type instead.
  */
 struct sockaddr_pppol2tp {
-       sa_family_t     sa_family;      /* address family, AF_PPPOX */
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
        unsigned int    sa_protocol;    /* protocol identifier */
        struct pppol2tp_addr pppol2tp;
 } __attribute__((packed));
        unsigned int    sa_protocol;    /* protocol identifier */
        struct pppol2tp_addr pppol2tp;
 } __attribute__((packed));
@@ -86,7 +87,7 @@ struct sockaddr_pppol2tp {
  * bits. So we need a different sockaddr structure.
  */
 struct sockaddr_pppol2tpv3 {
  * bits. So we need a different sockaddr structure.
  */
 struct sockaddr_pppol2tpv3 {
-       sa_family_t     sa_family;      /* address family, AF_PPPOX */
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
        unsigned int    sa_protocol;    /* protocol identifier */
        struct pppol2tpv3_addr pppol2tp;
 } __attribute__((packed));
        unsigned int    sa_protocol;    /* protocol identifier */
        struct pppol2tpv3_addr pppol2tp;
 } __attribute__((packed));
index beeb6de..01129c0 100644 (file)
@@ -182,7 +182,7 @@ struct in_pktinfo {
 /* Structure describing an Internet (IP) socket address. */
 #define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
 struct sockaddr_in {
 /* Structure describing an Internet (IP) socket address. */
 #define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
 struct sockaddr_in {
-  sa_family_t          sin_family;     /* Address family               */
+  __kernel_sa_family_t sin_family;     /* Address family               */
   __be16               sin_port;       /* Port number                  */
   struct in_addr       sin_addr;       /* Internet address             */
 
   __be16               sin_port;       /* Port number                  */
   struct in_addr       sin_addr;       /* Internet address             */
 
index aabb1d2..3d48014 100644 (file)
@@ -7,7 +7,7 @@
 #define IPX_MTU                576
 
 struct sockaddr_ipx {
 #define IPX_MTU                576
 
 struct sockaddr_ipx {
-       sa_family_t     sipx_family;
+       __kernel_sa_family_t sipx_family;
        __be16          sipx_port;
        __be32          sipx_network;
        unsigned char   sipx_node[IPX_NODE_LEN];
        __be16          sipx_port;
        __be32          sipx_network;
        unsigned char   sipx_node[IPX_NODE_LEN];
index 00bdad0..a014c32 100644 (file)
 #define KERNEL_IRDA_H
 
 #include <linux/types.h>
 #define KERNEL_IRDA_H
 
 #include <linux/types.h>
+#include <linux/socket.h>
 
 
-/* Please do *not* add any #include in this file, this file is
- * included as-is in user space.
- * Please fix the calling file to properly included needed files before
- * this one, or preferably to include <net/irda/irda.h> instead.
- * Jean II */
+/* Note that this file is shared with user space. */
 
 /* Hint bit positions for first hint byte */
 #define HINT_PNP         0x01
 
 /* Hint bit positions for first hint byte */
 #define HINT_PNP         0x01
@@ -125,7 +122,7 @@ enum {
 #define LSAP_ANY              0xff
 
 struct sockaddr_irda {
 #define LSAP_ANY              0xff
 
 struct sockaddr_irda {
-       sa_family_t sir_family;   /* AF_IRDA */
+       __kernel_sa_family_t sir_family; /* AF_IRDA */
        __u8        sir_lsap_sel; /* LSAP selector */
        __u32       sir_addr;     /* Device address */
        char        sir_name[25]; /* Usually <service>:IrDA:TinyTP */
        __u8        sir_lsap_sel; /* LSAP selector */
        __u32       sir_addr;     /* Device address */
        char        sir_name[25]; /* Usually <service>:IrDA:TinyTP */
index 4bdb31d..e77d7f9 100644 (file)
@@ -8,8 +8,8 @@
 #define _LINUX_L2TP_H_
 
 #include <linux/types.h>
 #define _LINUX_L2TP_H_
 
 #include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/socket.h>
 #include <linux/socket.h>
+#ifdef __KERNEL__
 #include <linux/in.h>
 #else
 #include <netinet/in.h>
 #include <linux/in.h>
 #else
 #include <netinet/in.h>
 #define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
 struct sockaddr_l2tpip {
        /* The first fields must match struct sockaddr_in */
 #define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
 struct sockaddr_l2tpip {
        /* The first fields must match struct sockaddr_in */
-       sa_family_t     l2tp_family;    /* AF_INET */
+       __kernel_sa_family_t l2tp_family; /* AF_INET */
        __be16          l2tp_unused;    /* INET port number (unused) */
        struct in_addr  l2tp_addr;      /* Internet address */
 
        __u32           l2tp_conn_id;   /* Connection ID of tunnel */
 
        /* Pad to size of `struct sockaddr'. */
        __be16          l2tp_unused;    /* INET port number (unused) */
        struct in_addr  l2tp_addr;      /* Internet address */
 
        __u32           l2tp_conn_id;   /* Connection ID of tunnel */
 
        /* Pad to size of `struct sockaddr'. */
-       unsigned char   __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) -
+       unsigned char   __pad[sizeof(struct sockaddr) -
+                             sizeof(__kernel_sa_family_t) -
                              sizeof(__be16) - sizeof(struct in_addr) -
                              sizeof(__u32)];
 };
                              sizeof(__be16) - sizeof(struct in_addr) -
                              sizeof(__u32)];
 };
index ad7074b..a2418ae 100644 (file)
  *
  * See the GNU General Public License for more details.
  */
  *
  * See the GNU General Public License for more details.
  */
+
+#include <linux/socket.h>
+
 #define __LLC_SOCK_SIZE__ 16   /* sizeof(sockaddr_llc), word align. */
 struct sockaddr_llc {
 #define __LLC_SOCK_SIZE__ 16   /* sizeof(sockaddr_llc), word align. */
 struct sockaddr_llc {
-       sa_family_t     sllc_family;    /* AF_LLC */
-       sa_family_t     sllc_arphrd;    /* ARPHRD_ETHER */
+       __kernel_sa_family_t sllc_family; /* AF_LLC */
+       __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
        unsigned char   sllc_test;
        unsigned char   sllc_xid;
        unsigned char   sllc_ua;        /* UA data, only for SOCK_STREAM. */
        unsigned char   sllc_sap;
        unsigned char   sllc_mac[IFHWADDRLEN];
        unsigned char   sllc_test;
        unsigned char   sllc_xid;
        unsigned char   sllc_ua;        /* UA data, only for SOCK_STREAM. */
        unsigned char   sllc_sap;
        unsigned char   sllc_mac[IFHWADDRLEN];
-       unsigned char   __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
+       unsigned char   __pad[__LLC_SOCK_SIZE__ -
+                             sizeof(__kernel_sa_family_t) * 2 -
                              sizeof(unsigned char) * 4 - IFHWADDRLEN];
 };
 
                              sizeof(unsigned char) * 4 - IFHWADDRLEN];
 };
 
index 180540a..8180cd9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LINUX_NETLINK_H
 #define __LINUX_NETLINK_H
 
 #ifndef __LINUX_NETLINK_H
 #define __LINUX_NETLINK_H
 
-#include <linux/socket.h> /* for sa_family_t */
+#include <linux/socket.h> /* for __kernel_sa_family_t */
 #include <linux/types.h>
 
 #define NETLINK_ROUTE          0       /* Routing/device hook                          */
 #include <linux/types.h>
 
 #define NETLINK_ROUTE          0       /* Routing/device hook                          */
index 6fb1384..f53a416 100644 (file)
@@ -24,6 +24,7 @@
 #define LINUX_PHONET_H
 
 #include <linux/types.h>
 #define LINUX_PHONET_H
 
 #include <linux/types.h>
+#include <linux/socket.h>
 
 /* Automatic protocol selection */
 #define PN_PROTO_TRANSPORT     0
 
 /* Automatic protocol selection */
 #define PN_PROTO_TRANSPORT     0
@@ -96,11 +97,11 @@ struct phonetmsg {
 
 /* Phonet socket address structure */
 struct sockaddr_pn {
 
 /* Phonet socket address structure */
 struct sockaddr_pn {
-       sa_family_t spn_family;
+       __kernel_sa_family_t spn_family;
        __u8 spn_obj;
        __u8 spn_dev;
        __u8 spn_resource;
        __u8 spn_obj;
        __u8 spn_dev;
        __u8 spn_resource;
-       __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
+       __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
 } __attribute__((packed));
 
 /* Well known address */
 } __attribute__((packed));
 
 /* Well known address */
index e8289cd..1fcfe95 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef        ROSE_KERNEL_H
 #define        ROSE_KERNEL_H
 
 #ifndef        ROSE_KERNEL_H
 #define        ROSE_KERNEL_H
 
+#include <linux/socket.h>
 #include <linux/ax25.h>
 
 #define ROSE_MTU       251
 #include <linux/ax25.h>
 
 #define ROSE_MTU       251
@@ -46,7 +47,7 @@ typedef struct {
 } rose_address;
 
 struct sockaddr_rose {
 } rose_address;
 
 struct sockaddr_rose {
-       sa_family_t     srose_family;
+       __kernel_sa_family_t srose_family;
        rose_address    srose_addr;
        ax25_address    srose_call;
        int             srose_ndigis;
        rose_address    srose_addr;
        ax25_address    srose_call;
        int             srose_ndigis;
@@ -54,7 +55,7 @@ struct sockaddr_rose {
 };
 
 struct full_sockaddr_rose {
 };
 
 struct full_sockaddr_rose {
-       sa_family_t     srose_family;
+       __kernel_sa_family_t srose_family;
        rose_address    srose_addr;
        ax25_address    srose_call;
        unsigned int    srose_ndigis;
        rose_address    srose_addr;
        ax25_address    srose_call;
        unsigned int    srose_ndigis;
index 45561c5..3ed3e46 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef _LINUX_UN_H
 #define _LINUX_UN_H
 
 #ifndef _LINUX_UN_H
 #define _LINUX_UN_H
 
+#include <linux/socket.h>
+
 #define UNIX_PATH_MAX  108
 
 struct sockaddr_un {
 #define UNIX_PATH_MAX  108
 
 struct sockaddr_un {
-       sa_family_t sun_family; /* AF_UNIX */
+       __kernel_sa_family_t sun_family; /* AF_UNIX */
        char sun_path[UNIX_PATH_MAX];   /* pathname */
 };
 
        char sun_path[UNIX_PATH_MAX];   /* pathname */
 };
 
index 6450a7f..810cce6 100644 (file)
@@ -12,6 +12,7 @@
 #define        X25_KERNEL_H
 
 #include <linux/types.h>
 #define        X25_KERNEL_H
 
 #include <linux/types.h>
+#include <linux/socket.h>
 
 #define        SIOCX25GSUBSCRIP        (SIOCPROTOPRIVATE + 0)
 #define        SIOCX25SSUBSCRIP        (SIOCPROTOPRIVATE + 1)
 
 #define        SIOCX25GSUBSCRIP        (SIOCPROTOPRIVATE + 0)
 #define        SIOCX25SSUBSCRIP        (SIOCPROTOPRIVATE + 1)
@@ -57,7 +58,7 @@ struct x25_address {
  *     Linux X.25 Address structure, used for bind, and connect mostly.
  */
 struct sockaddr_x25 {
  *     Linux X.25 Address structure, used for bind, and connect mostly.
  */
 struct sockaddr_x25 {
-       sa_family_t        sx25_family;         /* Must be AF_X25 */
+       __kernel_sa_family_t sx25_family;       /* Must be AF_X25 */
        struct x25_address sx25_addr;           /* X.121 Address */
 };
 
        struct x25_address sx25_addr;           /* X.121 Address */
 };