Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | #ifndef _UAPI_LINUX_SOCKET_H |
| 3 | #define _UAPI_LINUX_SOCKET_H |
| 4 | |
| 5 | /* |
| 6 | * Desired design of maximum size and alignment (see RFC2553) |
| 7 | */ |
| 8 | #define _K_SS_MAXSIZE 128 /* Implementation specific max size */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 9 | |
| 10 | typedef unsigned short __kernel_sa_family_t; |
| 11 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 12 | /* |
| 13 | * The definition uses anonymous union and struct in order to control the |
| 14 | * default alignment. |
| 15 | */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 16 | struct __kernel_sockaddr_storage { |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 17 | union { |
| 18 | struct { |
| 19 | __kernel_sa_family_t ss_family; /* address family */ |
| 20 | /* Following field(s) are implementation specific */ |
| 21 | char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | /* space to achieve desired size, */ |
| 23 | /* _SS_MAXSIZE value minus size of ss_family */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 24 | }; |
| 25 | void *__align; /* implementation specific desired alignment */ |
| 26 | }; |
| 27 | }; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 28 | |
| 29 | #endif /* _UAPI_LINUX_SOCKET_H */ |