Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

headers, net: Use __kernel_sa_family_t in more definitions shared with userland

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>

authored by

Ben Hutchings and committed by
David S. Miller
bcb949b8 d4b172d2

+37 -33
+2 -1
include/linux/atalk.h
··· 3 3 4 4 #include <linux/types.h> 5 5 #include <asm/byteorder.h> 6 + #include <linux/socket.h> 6 7 7 8 /* 8 9 * AppleTalk networking structures ··· 29 28 }; 30 29 31 30 struct sockaddr_at { 32 - sa_family_t sat_family; 31 + __kernel_sa_family_t sat_family; 33 32 __u8 sat_port; 34 33 struct atalk_addr sat_addr; 35 34 char sat_zero[8];
+1 -1
include/linux/ax25.h
··· 47 47 } ax25_address; 48 48 49 49 struct sockaddr_ax25 { 50 - sa_family_t sax25_family; 50 + __kernel_sa_family_t sax25_family; 51 51 ax25_address sax25_call; 52 52 int sax25_ndigis; 53 53 /* Digipeater ax25_address sets follow */
+1 -6
include/linux/caif/caif_socket.h
··· 9 9 #define _LINUX_CAIF_SOCKET_H 10 10 11 11 #include <linux/types.h> 12 - 13 - #ifdef __KERNEL__ 14 12 #include <linux/socket.h> 15 - #else 16 - #include <sys/socket.h> 17 - #endif 18 13 19 14 /** 20 15 * enum caif_link_selector - Physical Link Selection. ··· 139 144 * CAIF Channel. It defines the service to connect to on the modem. 140 145 */ 141 146 struct sockaddr_caif { 142 - sa_family_t family; 147 + __kernel_sa_family_t family; 143 148 union { 144 149 struct { 145 150 __u8 type; /* type: enum caif_at_type */
+1 -1
include/linux/can.h
··· 78 78 * @can_addr: protocol specific address information 79 79 */ 80 80 struct sockaddr_can { 81 - sa_family_t can_family; 81 + __kernel_sa_family_t can_family; 82 82 int can_ifindex; 83 83 union { 84 84 /* transport protocol class address information (e.g. ISOTP) */
+4 -3
include/linux/if_pppox.h
··· 20 20 #include <linux/types.h> 21 21 #include <asm/byteorder.h> 22 22 23 + #include <linux/socket.h> 23 24 #include <linux/if_ether.h> 24 25 #ifdef __KERNEL__ 25 26 #include <linux/if.h> ··· 64 63 #define PX_MAX_PROTO 3 65 64 66 65 struct sockaddr_pppox { 67 - sa_family_t sa_family; /* address family, AF_PPPOX */ 66 + __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ 68 67 unsigned int sa_protocol; /* protocol identifier */ 69 68 union { 70 69 struct pppoe_addr pppoe; ··· 78 77 * type instead. 79 78 */ 80 79 struct sockaddr_pppol2tp { 81 - sa_family_t sa_family; /* address family, AF_PPPOX */ 80 + __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ 82 81 unsigned int sa_protocol; /* protocol identifier */ 83 82 struct pppol2tp_addr pppol2tp; 84 83 } __attribute__((packed)); ··· 87 86 * bits. So we need a different sockaddr structure. 88 87 */ 89 88 struct sockaddr_pppol2tpv3 { 90 - sa_family_t sa_family; /* address family, AF_PPPOX */ 89 + __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ 91 90 unsigned int sa_protocol; /* protocol identifier */ 92 91 struct pppol2tpv3_addr pppol2tp; 93 92 } __attribute__((packed));
+1 -1
include/linux/in.h
··· 182 182 /* Structure describing an Internet (IP) socket address. */ 183 183 #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 184 184 struct sockaddr_in { 185 - sa_family_t sin_family; /* Address family */ 185 + __kernel_sa_family_t sin_family; /* Address family */ 186 186 __be16 sin_port; /* Port number */ 187 187 struct in_addr sin_addr; /* Internet address */ 188 188
+1 -1
include/linux/ipx.h
··· 7 7 #define IPX_MTU 576 8 8 9 9 struct sockaddr_ipx { 10 - sa_family_t sipx_family; 10 + __kernel_sa_family_t sipx_family; 11 11 __be16 sipx_port; 12 12 __be32 sipx_network; 13 13 unsigned char sipx_node[IPX_NODE_LEN];
+3 -6
include/linux/irda.h
··· 26 26 #define KERNEL_IRDA_H 27 27 28 28 #include <linux/types.h> 29 + #include <linux/socket.h> 29 30 30 - /* Please do *not* add any #include in this file, this file is 31 - * included as-is in user space. 32 - * Please fix the calling file to properly included needed files before 33 - * this one, or preferably to include <net/irda/irda.h> instead. 34 - * Jean II */ 31 + /* Note that this file is shared with user space. */ 35 32 36 33 /* Hint bit positions for first hint byte */ 37 34 #define HINT_PNP 0x01 ··· 122 125 #define LSAP_ANY 0xff 123 126 124 127 struct sockaddr_irda { 125 - sa_family_t sir_family; /* AF_IRDA */ 128 + __kernel_sa_family_t sir_family; /* AF_IRDA */ 126 129 __u8 sir_lsap_sel; /* LSAP selector */ 127 130 __u32 sir_addr; /* Device address */ 128 131 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
+4 -3
include/linux/l2tp.h
··· 8 8 #define _LINUX_L2TP_H_ 9 9 10 10 #include <linux/types.h> 11 - #ifdef __KERNEL__ 12 11 #include <linux/socket.h> 12 + #ifdef __KERNEL__ 13 13 #include <linux/in.h> 14 14 #else 15 15 #include <netinet/in.h> ··· 26 26 #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 27 27 struct sockaddr_l2tpip { 28 28 /* The first fields must match struct sockaddr_in */ 29 - sa_family_t l2tp_family; /* AF_INET */ 29 + __kernel_sa_family_t l2tp_family; /* AF_INET */ 30 30 __be16 l2tp_unused; /* INET port number (unused) */ 31 31 struct in_addr l2tp_addr; /* Internet address */ 32 32 33 33 __u32 l2tp_conn_id; /* Connection ID of tunnel */ 34 34 35 35 /* Pad to size of `struct sockaddr'. */ 36 - unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - 36 + unsigned char __pad[sizeof(struct sockaddr) - 37 + sizeof(__kernel_sa_family_t) - 37 38 sizeof(__be16) - sizeof(struct in_addr) - 38 39 sizeof(__u32)]; 39 40 };
+7 -3
include/linux/llc.h
··· 12 12 * 13 13 * See the GNU General Public License for more details. 14 14 */ 15 + 16 + #include <linux/socket.h> 17 + 15 18 #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ 16 19 struct sockaddr_llc { 17 - sa_family_t sllc_family; /* AF_LLC */ 18 - sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ 20 + __kernel_sa_family_t sllc_family; /* AF_LLC */ 21 + __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ 19 22 unsigned char sllc_test; 20 23 unsigned char sllc_xid; 21 24 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ 22 25 unsigned char sllc_sap; 23 26 unsigned char sllc_mac[IFHWADDRLEN]; 24 - unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 - 27 + unsigned char __pad[__LLC_SOCK_SIZE__ - 28 + sizeof(__kernel_sa_family_t) * 2 - 25 29 sizeof(unsigned char) * 4 - IFHWADDRLEN]; 26 30 }; 27 31
+1 -1
include/linux/netlink.h
··· 1 1 #ifndef __LINUX_NETLINK_H 2 2 #define __LINUX_NETLINK_H 3 3 4 - #include <linux/socket.h> /* for sa_family_t */ 4 + #include <linux/socket.h> /* for __kernel_sa_family_t */ 5 5 #include <linux/types.h> 6 6 7 7 #define NETLINK_ROUTE 0 /* Routing/device hook */
+3 -2
include/linux/phonet.h
··· 24 24 #define LINUX_PHONET_H 25 25 26 26 #include <linux/types.h> 27 + #include <linux/socket.h> 27 28 28 29 /* Automatic protocol selection */ 29 30 #define PN_PROTO_TRANSPORT 0 ··· 97 96 98 97 /* Phonet socket address structure */ 99 98 struct sockaddr_pn { 100 - sa_family_t spn_family; 99 + __kernel_sa_family_t spn_family; 101 100 __u8 spn_obj; 102 101 __u8 spn_dev; 103 102 __u8 spn_resource; 104 - __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; 103 + __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3]; 105 104 } __attribute__((packed)); 106 105 107 106 /* Well known address */
+3 -2
include/linux/rose.h
··· 7 7 #ifndef ROSE_KERNEL_H 8 8 #define ROSE_KERNEL_H 9 9 10 + #include <linux/socket.h> 10 11 #include <linux/ax25.h> 11 12 12 13 #define ROSE_MTU 251 ··· 47 46 } rose_address; 48 47 49 48 struct sockaddr_rose { 50 - sa_family_t srose_family; 49 + __kernel_sa_family_t srose_family; 51 50 rose_address srose_addr; 52 51 ax25_address srose_call; 53 52 int srose_ndigis; ··· 55 54 }; 56 55 57 56 struct full_sockaddr_rose { 58 - sa_family_t srose_family; 57 + __kernel_sa_family_t srose_family; 59 58 rose_address srose_addr; 60 59 ax25_address srose_call; 61 60 unsigned int srose_ndigis;
+3 -1
include/linux/un.h
··· 1 1 #ifndef _LINUX_UN_H 2 2 #define _LINUX_UN_H 3 3 4 + #include <linux/socket.h> 5 + 4 6 #define UNIX_PATH_MAX 108 5 7 6 8 struct sockaddr_un { 7 - sa_family_t sun_family; /* AF_UNIX */ 9 + __kernel_sa_family_t sun_family; /* AF_UNIX */ 8 10 char sun_path[UNIX_PATH_MAX]; /* pathname */ 9 11 }; 10 12
+2 -1
include/linux/x25.h
··· 12 12 #define X25_KERNEL_H 13 13 14 14 #include <linux/types.h> 15 + #include <linux/socket.h> 15 16 16 17 #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) 17 18 #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) ··· 58 57 * Linux X.25 Address structure, used for bind, and connect mostly. 59 58 */ 60 59 struct sockaddr_x25 { 61 - sa_family_t sx25_family; /* Must be AF_X25 */ 60 + __kernel_sa_family_t sx25_family; /* Must be AF_X25 */ 62 61 struct x25_address sx25_addr; /* X.121 Address */ 63 62 }; 64 63