2 * libwebsockets - small server side websockets and web server implementation
3 * SPDX-License-Identifier: LGPL-2.1-only
5 * Copyright (C) 2019 Akira Tsukamoto <akira.tsukamoto@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation:
10 * version 2.1 of the License.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * included from libwebsockets.h
28 /* 128-bit IP6 address */
32 uint16_t u6_addr16[8];
33 uint32_t u6_addr32[4];
37 #define _SS_MAXSIZE 128U
38 #define _SS_ALIGNSIZE (sizeof(int64_t))
39 #define _SS_PAD1SIZE (_SS_ALIGNSIZE - \
41 #define _SS_PAD2SIZE (_SS_MAXSIZE - \
42 sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
44 struct sockaddr_storage {
45 sa_family_t ss_family; /* address family */
46 char __ss_pad1[_SS_PAD1SIZE];
47 int64_t __ss_align; /* force desired struct alignment */
48 char __ss_pad2[_SS_PAD2SIZE];
51 #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
53 sa_family_t sa_family; /* address family */
54 uint8_t sa_data[__SOCK_SIZE__ /* address value */
55 - sizeof(sa_family_t)];
60 sa_family_t sin_family;
62 struct in_addr sin_addr;
63 uint8_t sin_zero[__SOCK_SIZE__ /* padding until 16 bytes */
66 - sizeof(struct in_addr)];
70 sa_family_t sin6_family; /* AF_INET6 */
71 in_port_t sin6_port; /* Transport layer port # */
72 uint32_t sin6_flowinfo; /* IP6 flow information */
73 struct in6_addr sin6_addr; /* IP6 address */
74 uint32_t sin6_scope_id; /* scope zone index */
77 #endif /* __LWS_OPTEE_H */