Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl> |
| 3 | * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl> |
| 4 | * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com> |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 5 | * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 6 | * All rights reserved. |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions |
| 10 | * are met: |
| 11 | * 1. Redistributions of source code must retain the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer. |
| 13 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. The name of the author may not be used to endorse or promote products |
| 17 | * derived from this software without specific prior written permission. |
| 18 | * |
| 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 29 | */ |
| 30 | |
| 31 | #include "defs.h" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 32 | #include <sys/stat.h> |
| 33 | #include <sys/socket.h> |
| 34 | #include <sys/un.h> |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 35 | #if defined(HAVE_SIN6_SCOPE_ID_LINUX) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 36 | # define in6_addr in6_addr_libc |
| 37 | # define ipv6_mreq ipv6_mreq_libc |
| 38 | # define sockaddr_in6 sockaddr_in6_libc |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 39 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 40 | #include <netinet/in.h> |
Wichert Akkerman | 8c7122c | 2001-02-16 19:59:55 +0000 | [diff] [blame] | 41 | #ifdef HAVE_NETINET_TCP_H |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 42 | # include <netinet/tcp.h> |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 43 | #endif |
Wichert Akkerman | 8c7122c | 2001-02-16 19:59:55 +0000 | [diff] [blame] | 44 | #ifdef HAVE_NETINET_UDP_H |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 45 | # include <netinet/udp.h> |
Wichert Akkerman | 8c7122c | 2001-02-16 19:59:55 +0000 | [diff] [blame] | 46 | #endif |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 47 | #ifdef HAVE_NETINET_SCTP_H |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 48 | # include <netinet/sctp.h> |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 49 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 50 | #include <arpa/inet.h> |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 51 | #include <net/if.h> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 52 | #include <asm/types.h> |
Denys Vlasenko | 99aa181 | 2013-02-08 18:49:06 +0100 | [diff] [blame] | 53 | #if defined(__GLIBC__) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 54 | # include <netipx/ipx.h> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 55 | #else |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 56 | # include <linux/ipx.h> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 57 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 58 | |
Denys Vlasenko | 99aa181 | 2013-02-08 18:49:06 +0100 | [diff] [blame] | 59 | #if defined(__GLIBC__) && defined(HAVE_SIN6_SCOPE_ID_LINUX) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 60 | # if defined(HAVE_LINUX_IN6_H) |
| 61 | # if defined(HAVE_SIN6_SCOPE_ID_LINUX) |
| 62 | # undef in6_addr |
| 63 | # undef ipv6_mreq |
| 64 | # undef sockaddr_in6 |
| 65 | # define in6_addr in6_addr_kernel |
| 66 | # define ipv6_mreq ipv6_mreq_kernel |
| 67 | # define sockaddr_in6 sockaddr_in6_kernel |
| 68 | # endif |
| 69 | # include <linux/in6.h> |
| 70 | # if defined(HAVE_SIN6_SCOPE_ID_LINUX) |
| 71 | # undef in6_addr |
| 72 | # undef ipv6_mreq |
| 73 | # undef sockaddr_in6 |
| 74 | # define in6_addr in6_addr_libc |
| 75 | # define ipv6_mreq ipv6_mreq_libc |
| 76 | # define sockaddr_in6 sockaddr_in6_kernel |
| 77 | # endif |
| 78 | # endif |
Wichert Akkerman | 2f473da | 1999-11-01 19:53:31 +0000 | [diff] [blame] | 79 | #endif |
Wichert Akkerman | 505e176 | 1999-11-01 19:39:08 +0000 | [diff] [blame] | 80 | |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 81 | #if defined(HAVE_SYS_UIO_H) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 82 | # include <sys/uio.h> |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 83 | #endif |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 84 | #if defined(HAVE_LINUX_NETLINK_H) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 85 | # include <linux/netlink.h> |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 86 | #endif |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 87 | #if defined(HAVE_LINUX_IF_PACKET_H) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 88 | # include <linux/if_packet.h> |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 89 | #endif |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 90 | #if defined(HAVE_LINUX_ICMP_H) |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 91 | # include <linux/icmp.h> |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 92 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 93 | #ifndef PF_UNSPEC |
Denys Vlasenko | a6d91de | 2012-03-16 12:02:22 +0100 | [diff] [blame] | 94 | # define PF_UNSPEC AF_UNSPEC |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 95 | #endif |
| 96 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 97 | static const struct xlat domains[] = { |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 98 | #ifdef PF_UNSPEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 99 | XLAT(PF_UNSPEC), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 100 | #endif |
| 101 | #ifdef PF_LOCAL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 102 | XLAT(PF_LOCAL), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 103 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 104 | #ifdef PF_UNIX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 105 | XLAT(PF_UNIX), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 106 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 107 | #ifdef PF_INET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 108 | XLAT(PF_INET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 109 | #endif |
| 110 | #ifdef PF_AX25 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 111 | XLAT(PF_AX25), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 112 | #endif |
| 113 | #ifdef PF_IPX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 114 | XLAT(PF_IPX), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 115 | #endif |
| 116 | #ifdef PF_APPLETALK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 117 | XLAT(PF_APPLETALK), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 118 | #endif |
| 119 | #ifdef PF_NETROM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 120 | XLAT(PF_NETROM), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 121 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 122 | #ifdef PF_BRIDGE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 123 | XLAT(PF_BRIDGE), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 124 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 125 | #ifdef PF_ATMPVC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 126 | XLAT(PF_ATMPVC), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 127 | #endif |
| 128 | #ifdef PF_X25 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 129 | XLAT(PF_X25), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 130 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 131 | #ifdef PF_INET6 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 132 | XLAT(PF_INET6), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 133 | #endif |
| 134 | #ifdef PF_ROSE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 135 | XLAT(PF_ROSE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 136 | #endif |
| 137 | #ifdef PF_DECnet |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 138 | XLAT(PF_DECnet), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 139 | #endif |
| 140 | #ifdef PF_NETBEUI |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 141 | XLAT(PF_NETBEUI), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 142 | #endif |
| 143 | #ifdef PF_SECURITY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 144 | XLAT(PF_SECURITY), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 145 | #endif |
| 146 | #ifdef PF_KEY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 147 | XLAT(PF_KEY), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 148 | #endif |
| 149 | #ifdef PF_NETLINK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 150 | XLAT(PF_NETLINK), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 151 | #endif |
| 152 | #ifdef PF_ROUTE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 153 | XLAT(PF_ROUTE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 154 | #endif |
| 155 | #ifdef PF_PACKET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 156 | XLAT(PF_PACKET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 157 | #endif |
| 158 | #ifdef PF_ASH |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 159 | XLAT(PF_ASH), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 160 | #endif |
| 161 | #ifdef PF_ECONET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 162 | XLAT(PF_ECONET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 163 | #endif |
| 164 | #ifdef PF_ATMSVC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 165 | XLAT(PF_ATMSVC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 166 | #endif |
| 167 | #ifdef PF_RDS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 168 | XLAT(PF_RDS), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 169 | #endif |
| 170 | #ifdef PF_SNA |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 171 | XLAT(PF_SNA), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 172 | #endif |
| 173 | #ifdef PF_IRDA |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 174 | XLAT(PF_IRDA), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 175 | #endif |
| 176 | #ifdef PF_PPPOX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 177 | XLAT(PF_PPPOX), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 178 | #endif |
| 179 | #ifdef PF_WANPIPE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 180 | XLAT(PF_WANPIPE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 181 | #endif |
| 182 | #ifdef PF_LLC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 183 | XLAT(PF_LLC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 184 | #endif |
| 185 | #ifdef PF_CAN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 186 | XLAT(PF_CAN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 187 | #endif |
| 188 | #ifdef PF_TIPC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 189 | XLAT(PF_TIPC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 190 | #endif |
| 191 | #ifdef PF_BLUETOOTH |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 192 | XLAT(PF_BLUETOOTH), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 193 | #endif |
| 194 | #ifdef PF_IUCV |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 195 | XLAT(PF_IUCV), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 196 | #endif |
| 197 | #ifdef PF_RXRPC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 198 | XLAT(PF_RXRPC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 199 | #endif |
| 200 | #ifdef PF_ISDN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 201 | XLAT(PF_ISDN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 202 | #endif |
| 203 | #ifdef PF_PHONET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 204 | XLAT(PF_PHONET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 205 | #endif |
| 206 | #ifdef PF_IEEE802154 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 207 | XLAT(PF_IEEE802154), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 208 | #endif |
| 209 | #ifdef PF_CAIF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 210 | XLAT(PF_CAIF), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 211 | #endif |
| 212 | #ifdef PF_ALG |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 213 | XLAT(PF_ALG), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 214 | #endif |
| 215 | #ifdef PF_NFC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 216 | XLAT(PF_NFC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 217 | #endif |
| 218 | #ifdef PF_VSOCK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 219 | XLAT(PF_VSOCK), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 220 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 221 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 222 | }; |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 223 | const struct xlat addrfams[] = { |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 224 | #ifdef AF_UNSPEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 225 | XLAT(AF_UNSPEC), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 226 | #endif |
| 227 | #ifdef AF_LOCAL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 228 | XLAT(AF_LOCAL), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 229 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 230 | #ifdef AF_UNIX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 231 | XLAT(AF_UNIX), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 232 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 233 | #ifdef AF_INET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 234 | XLAT(AF_INET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 235 | #endif |
| 236 | #ifdef AF_AX25 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 237 | XLAT(AF_AX25), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 238 | #endif |
| 239 | #ifdef AF_IPX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 240 | XLAT(AF_IPX), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 241 | #endif |
| 242 | #ifdef AF_APPLETALK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 243 | XLAT(AF_APPLETALK), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 244 | #endif |
| 245 | #ifdef AF_NETROM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 246 | XLAT(AF_NETROM), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 247 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 248 | #ifdef AF_BRIDGE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 249 | XLAT(AF_BRIDGE), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 250 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 251 | #ifdef AF_ATMPVC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 252 | XLAT(AF_ATMPVC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 253 | #endif |
| 254 | #ifdef AF_X25 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 255 | XLAT(AF_X25), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 256 | #endif |
| 257 | #ifdef AF_INET6 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 258 | XLAT(AF_INET6), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 259 | #endif |
| 260 | #ifdef AF_ROSE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 261 | XLAT(AF_ROSE), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 262 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 263 | #ifdef AF_DECnet |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 264 | XLAT(AF_DECnet), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 265 | #endif |
| 266 | #ifdef AF_NETBEUI |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 267 | XLAT(AF_NETBEUI), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 268 | #endif |
| 269 | #ifdef AF_SECURITY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 270 | XLAT(AF_SECURITY), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 271 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 272 | #ifdef AF_KEY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 273 | XLAT(AF_KEY), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 274 | #endif |
| 275 | #ifdef AF_NETLINK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 276 | XLAT(AF_NETLINK), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 277 | #endif |
| 278 | #ifdef AF_ROUTE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 279 | XLAT(AF_ROUTE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 280 | #endif |
| 281 | #ifdef AF_PACKET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 282 | XLAT(AF_PACKET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 283 | #endif |
| 284 | #ifdef AF_ASH |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 285 | XLAT(AF_ASH), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 286 | #endif |
| 287 | #ifdef AF_ECONET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 288 | XLAT(AF_ECONET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 289 | #endif |
| 290 | #ifdef AF_ATMSVC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 291 | XLAT(AF_ATMSVC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 292 | #endif |
| 293 | #ifdef AF_RDS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 294 | XLAT(AF_RDS), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 295 | #endif |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 296 | #ifdef AF_SNA |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 297 | XLAT(AF_SNA), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 298 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 299 | #ifdef AF_IRDA |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 300 | XLAT(AF_IRDA), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 301 | #endif |
| 302 | #ifdef AF_PPPOX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 303 | XLAT(AF_PPPOX), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 304 | #endif |
| 305 | #ifdef AF_WANPIPE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 306 | XLAT(AF_WANPIPE), |
Roland McGrath | 5a8146a | 2004-06-04 02:24:14 +0000 | [diff] [blame] | 307 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 308 | #ifdef AF_LLC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 309 | XLAT(AF_LLC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 310 | #endif |
| 311 | #ifdef AF_CAN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 312 | XLAT(AF_CAN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 313 | #endif |
| 314 | #ifdef AF_TIPC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 315 | XLAT(AF_TIPC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 316 | #endif |
| 317 | #ifdef AF_BLUETOOTH |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 318 | XLAT(AF_BLUETOOTH), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 319 | #endif |
| 320 | #ifdef AF_IUCV |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 321 | XLAT(AF_IUCV), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 322 | #endif |
| 323 | #ifdef AF_RXRPC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 324 | XLAT(AF_RXRPC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 325 | #endif |
| 326 | #ifdef AF_ISDN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 327 | XLAT(AF_ISDN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 328 | #endif |
| 329 | #ifdef AF_PHONET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 330 | XLAT(AF_PHONET), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 331 | #endif |
| 332 | #ifdef AF_IEEE802154 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 333 | XLAT(AF_IEEE802154), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 334 | #endif |
| 335 | #ifdef AF_CAIF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 336 | XLAT(AF_CAIF), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 337 | #endif |
| 338 | #ifdef AF_ALG |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 339 | XLAT(AF_ALG), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 340 | #endif |
| 341 | #ifdef AF_NFC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 342 | XLAT(AF_NFC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 343 | #endif |
| 344 | #ifdef AF_VSOCK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 345 | XLAT(AF_VSOCK), |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 346 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 347 | XLAT_END |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 348 | }; |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 349 | static const struct xlat socktypes[] = { |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 350 | XLAT(SOCK_STREAM), |
| 351 | XLAT(SOCK_DGRAM), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 352 | #ifdef SOCK_RAW |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 353 | XLAT(SOCK_RAW), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 354 | #endif |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 355 | #ifdef SOCK_RDM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 356 | XLAT(SOCK_RDM), |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 357 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 358 | #ifdef SOCK_SEQPACKET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 359 | XLAT(SOCK_SEQPACKET), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 360 | #endif |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 361 | #ifdef SOCK_DCCP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 362 | XLAT(SOCK_DCCP), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 363 | #endif |
| 364 | #ifdef SOCK_PACKET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 365 | XLAT(SOCK_PACKET), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 366 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 367 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 368 | }; |
Dmitry V. Levin | d475c06 | 2011-03-03 01:02:41 +0000 | [diff] [blame] | 369 | static const struct xlat sock_type_flags[] = { |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 370 | #ifdef SOCK_CLOEXEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 371 | XLAT(SOCK_CLOEXEC), |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 372 | #endif |
| 373 | #ifdef SOCK_NONBLOCK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 374 | XLAT(SOCK_NONBLOCK), |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 375 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 376 | XLAT_END |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 377 | }; |
| 378 | #ifndef SOCK_TYPE_MASK |
| 379 | # define SOCK_TYPE_MASK 0xf |
| 380 | #endif |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 381 | static const struct xlat socketlayers[] = { |
John Hughes | 1e4cb34 | 2001-03-06 09:25:46 +0000 | [diff] [blame] | 382 | #if defined(SOL_IP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 383 | XLAT(SOL_IP), |
John Hughes | 1e4cb34 | 2001-03-06 09:25:46 +0000 | [diff] [blame] | 384 | #endif |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 385 | #if defined(SOL_ICMP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 386 | XLAT(SOL_ICMP), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 387 | #endif |
John Hughes | 1e4cb34 | 2001-03-06 09:25:46 +0000 | [diff] [blame] | 388 | #if defined(SOL_TCP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 389 | XLAT(SOL_TCP), |
John Hughes | 1e4cb34 | 2001-03-06 09:25:46 +0000 | [diff] [blame] | 390 | #endif |
| 391 | #if defined(SOL_UDP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 392 | XLAT(SOL_UDP), |
John Hughes | 1e4cb34 | 2001-03-06 09:25:46 +0000 | [diff] [blame] | 393 | #endif |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 394 | #if defined(SOL_IPV6) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 395 | XLAT(SOL_IPV6), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 396 | #endif |
| 397 | #if defined(SOL_ICMPV6) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 398 | XLAT(SOL_ICMPV6), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 399 | #endif |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 400 | #if defined(SOL_SCTP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 401 | XLAT(SOL_SCTP), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 402 | #endif |
| 403 | #if defined(SOL_UDPLITE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 404 | XLAT(SOL_UDPLITE), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 405 | #endif |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 406 | #if defined(SOL_RAW) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 407 | XLAT(SOL_RAW), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 408 | #endif |
| 409 | #if defined(SOL_IPX) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 410 | XLAT(SOL_IPX), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 411 | #endif |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 412 | #if defined(SOL_AX25) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 413 | XLAT(SOL_AX25), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 414 | #endif |
| 415 | #if defined(SOL_ATALK) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 416 | XLAT(SOL_ATALK), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 417 | #endif |
| 418 | #if defined(SOL_NETROM) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 419 | XLAT(SOL_NETROM), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 420 | #endif |
| 421 | #if defined(SOL_ROSE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 422 | XLAT(SOL_ROSE), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 423 | #endif |
| 424 | #if defined(SOL_DECNET) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 425 | XLAT(SOL_DECNET), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 426 | #endif |
| 427 | #if defined(SOL_X25) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 428 | XLAT(SOL_X25), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 429 | #endif |
| 430 | #if defined(SOL_PACKET) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 431 | XLAT(SOL_PACKET), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 432 | #endif |
| 433 | #if defined(SOL_ATM) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 434 | XLAT(SOL_ATM), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 435 | #endif |
| 436 | #if defined(SOL_AAL) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 437 | XLAT(SOL_AAL), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 438 | #endif |
| 439 | #if defined(SOL_IRDA) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 440 | XLAT(SOL_IRDA), |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 441 | #endif |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 442 | #if defined(SOL_NETBEUI) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 443 | XLAT(SOL_NETBEUI), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 444 | #endif |
| 445 | #if defined(SOL_LLC) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 446 | XLAT(SOL_LLC), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 447 | #endif |
| 448 | #if defined(SOL_DCCP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 449 | XLAT(SOL_DCCP), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 450 | #endif |
| 451 | #if defined(SOL_NETLINK) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 452 | XLAT(SOL_NETLINK), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 453 | #endif |
| 454 | #if defined(SOL_TIPC) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 455 | XLAT(SOL_TIPC), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 456 | #endif |
| 457 | #if defined(SOL_RXRPC) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 458 | XLAT(SOL_RXRPC), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 459 | #endif |
| 460 | #if defined(SOL_PPPOL2TP) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 461 | XLAT(SOL_PPPOL2TP), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 462 | #endif |
| 463 | #if defined(SOL_BLUETOOTH) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 464 | XLAT(SOL_BLUETOOTH), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 465 | #endif |
| 466 | #if defined(SOL_PNPIPE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 467 | XLAT(SOL_PNPIPE), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 468 | #endif |
| 469 | #if defined(SOL_RDS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 470 | XLAT(SOL_RDS), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 471 | #endif |
| 472 | #if defined(SOL_IUVC) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 473 | XLAT(SOL_IUCV), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 474 | #endif |
| 475 | #if defined(SOL_CAIF) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 476 | XLAT(SOL_CAIF), |
Holger Hans Peter Freyther | ce9e0f4 | 2011-01-14 11:08:11 +0100 | [diff] [blame] | 477 | #endif |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 478 | XLAT(SOL_SOCKET), /* Never used! */ |
Dmitry V. Levin | d475c06 | 2011-03-03 01:02:41 +0000 | [diff] [blame] | 479 | /* The SOL_* array should remain not NULL-terminated. */ |
Wichert Akkerman | efdecac | 2000-11-26 03:59:21 +0000 | [diff] [blame] | 480 | }; |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 481 | /*** WARNING: DANGER WILL ROBINSON: NOTE "socketlayers" array above |
Masatake YAMATO | 2394a3d | 2014-03-11 23:37:37 +0900 | [diff] [blame] | 482 | falls into "inet_protocols" array below!!!! This is intended!!! ***/ |
| 483 | static const struct xlat inet_protocols[] = { |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 484 | XLAT(IPPROTO_IP), |
| 485 | XLAT(IPPROTO_ICMP), |
| 486 | XLAT(IPPROTO_TCP), |
| 487 | XLAT(IPPROTO_UDP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 488 | #ifdef IPPROTO_IGMP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 489 | XLAT(IPPROTO_IGMP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 490 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 491 | #ifdef IPPROTO_GGP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 492 | XLAT(IPPROTO_GGP), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 493 | #endif |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 494 | #ifdef IPPROTO_IPIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 495 | XLAT(IPPROTO_IPIP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 496 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 497 | #ifdef IPPROTO_EGP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 498 | XLAT(IPPROTO_EGP), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 499 | #endif |
| 500 | #ifdef IPPROTO_PUP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 501 | XLAT(IPPROTO_PUP), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 502 | #endif |
| 503 | #ifdef IPPROTO_IDP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 504 | XLAT(IPPROTO_IDP), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 505 | #endif |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 506 | #ifdef IPPROTO_TP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 507 | XLAT(IPPROTO_TP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 508 | #endif |
| 509 | #ifdef IPPROTO_DCCP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 510 | XLAT(IPPROTO_DCCP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 511 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 512 | #ifdef IPPROTO_IPV6 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 513 | XLAT(IPPROTO_IPV6), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 514 | #endif |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 515 | #ifdef IPPROTO_ROUTING |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 516 | XLAT(IPPROTO_ROUTING), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 517 | #endif |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 518 | #ifdef IPPROTO_FRAGMENT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 519 | XLAT(IPPROTO_FRAGMENT), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 520 | #endif |
| 521 | #ifdef IPPROTO_RSVP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 522 | XLAT(IPPROTO_RSVP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 523 | #endif |
| 524 | #ifdef IPPROTO_GRE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 525 | XLAT(IPPROTO_GRE), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 526 | #endif |
| 527 | #ifdef IPPROTO_ESP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 528 | XLAT(IPPROTO_ESP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 529 | #endif |
| 530 | #ifdef IPPROTO_AH |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 531 | XLAT(IPPROTO_AH), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 532 | #endif |
| 533 | #ifdef IPPROTO_ICMPV6 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 534 | XLAT(IPPROTO_ICMPV6), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 535 | #endif |
| 536 | #ifdef IPPROTO_NONE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 537 | XLAT(IPPROTO_NONE), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 538 | #endif |
| 539 | #ifdef IPPROTO_DSTOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 540 | XLAT(IPPROTO_DSTOPTS), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 541 | #endif |
| 542 | #ifdef IPPROTO_HELLO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 543 | XLAT(IPPROTO_HELLO), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 544 | #endif |
| 545 | #ifdef IPPROTO_ND |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 546 | XLAT(IPPROTO_ND), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 547 | #endif |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 548 | #ifdef IPPROTO_MTP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 549 | XLAT(IPPROTO_MTP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 550 | #endif |
| 551 | #ifdef IPPROTO_ENCAP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 552 | XLAT(IPPROTO_ENCAP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 553 | #endif |
| 554 | #ifdef IPPROTO_PIM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 555 | XLAT(IPPROTO_PIM), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 556 | #endif |
| 557 | #ifdef IPPROTO_COMP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 558 | XLAT(IPPROTO_COMP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 559 | #endif |
| 560 | #ifdef IPPROTO_SCTP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 561 | XLAT(IPPROTO_SCTP), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 562 | #endif |
| 563 | #ifdef IPPROTO_UDPLITE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 564 | XLAT(IPPROTO_UDPLITE), |
Dmitry V. Levin | d48c6b9 | 2011-01-10 01:14:38 +0000 | [diff] [blame] | 565 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 566 | #ifdef IPPROTO_RAW |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 567 | XLAT(IPPROTO_RAW), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 568 | #endif |
| 569 | #ifdef IPPROTO_MAX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 570 | XLAT(IPPROTO_MAX), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 571 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 572 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 573 | }; |
Masatake YAMATO | 2394a3d | 2014-03-11 23:37:37 +0900 | [diff] [blame] | 574 | |
| 575 | #ifdef PF_NETLINK |
| 576 | static const struct xlat netlink_protocols[] = { |
| 577 | #ifdef NETLINK_ROUTE |
| 578 | XLAT(NETLINK_ROUTE), |
| 579 | #endif |
| 580 | #ifdef NETLINK_UNUSED |
| 581 | XLAT(NETLINK_UNUSED), |
| 582 | #endif |
| 583 | #ifdef NETLINK_USERSOCK |
| 584 | XLAT(NETLINK_USERSOCK), |
| 585 | #endif |
| 586 | #ifdef NETLINK_FIREWALL |
| 587 | XLAT(NETLINK_FIREWALL), |
| 588 | #endif |
| 589 | #ifdef NETLINK_SOCK_DIAG |
| 590 | XLAT(NETLINK_SOCK_DIAG), |
| 591 | #endif |
| 592 | #ifdef NETLINK_NFLOG |
| 593 | XLAT(NETLINK_NFLOG), |
| 594 | #endif |
| 595 | #ifdef NETLINK_XFRM |
| 596 | XLAT(NETLINK_XFRM), |
| 597 | #endif |
| 598 | #ifdef NETLINK_SELINUX |
| 599 | XLAT(NETLINK_SELINUX), |
| 600 | #endif |
| 601 | #ifdef NETLINK_ISCSI |
| 602 | XLAT(NETLINK_ISCSI), |
| 603 | #endif |
| 604 | #ifdef NETLINK_AUDIT |
| 605 | XLAT(NETLINK_AUDIT), |
| 606 | #endif |
| 607 | #ifdef NETLINK_FIB_LOOKUP |
| 608 | XLAT(NETLINK_FIB_LOOKUP), |
| 609 | #endif |
| 610 | #ifdef NETLINK_CONNECTOR |
| 611 | XLAT(NETLINK_CONNECTOR), |
| 612 | #endif |
| 613 | #ifdef NETLINK_NETFILTER |
| 614 | XLAT(NETLINK_NETFILTER), |
| 615 | #endif |
| 616 | #ifdef NETLINK_IP6_FW |
| 617 | XLAT(NETLINK_IP6_FW), |
| 618 | #endif |
| 619 | #ifdef NETLINK_DNRTMSG |
| 620 | XLAT(NETLINK_DNRTMSG), |
| 621 | #endif |
| 622 | #ifdef NETLINK_KOBJECT_UEVENT |
| 623 | XLAT(NETLINK_KOBJECT_UEVENT), |
| 624 | #endif |
| 625 | #ifdef NETLINK_GENERIC |
| 626 | XLAT(NETLINK_GENERIC), |
| 627 | #endif |
| 628 | #ifdef NETLINK_SCSITRANSPORT |
| 629 | XLAT(NETLINK_SCSITRANSPORT), |
| 630 | #endif |
| 631 | #ifdef NETLINK_ECRYPTFS |
| 632 | XLAT(NETLINK_ECRYPTFS), |
| 633 | #endif |
| 634 | #ifdef NETLINK_RDMA |
| 635 | XLAT(NETLINK_RDMA), |
| 636 | #endif |
| 637 | #ifdef NETLINK_CRYPTO |
| 638 | XLAT(NETLINK_CRYPTO), |
| 639 | #endif |
| 640 | XLAT_END |
| 641 | }; |
| 642 | #endif |
| 643 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 644 | static const struct xlat msg_flags[] = { |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 645 | XLAT(MSG_OOB), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 646 | #ifdef MSG_PEEK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 647 | XLAT(MSG_PEEK), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 648 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 649 | #ifdef MSG_DONTROUTE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 650 | XLAT(MSG_DONTROUTE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 651 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 652 | #ifdef MSG_CTRUNC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 653 | XLAT(MSG_CTRUNC), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 654 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 655 | #ifdef MSG_PROBE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 656 | XLAT(MSG_PROBE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 657 | #endif |
| 658 | #ifdef MSG_TRUNC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 659 | XLAT(MSG_TRUNC), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 660 | #endif |
| 661 | #ifdef MSG_DONTWAIT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 662 | XLAT(MSG_DONTWAIT), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 663 | #endif |
| 664 | #ifdef MSG_EOR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 665 | XLAT(MSG_EOR), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 666 | #endif |
| 667 | #ifdef MSG_WAITALL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 668 | XLAT(MSG_WAITALL), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 669 | #endif |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 670 | #ifdef MSG_FIN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 671 | XLAT(MSG_FIN), |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 672 | #endif |
| 673 | #ifdef MSG_SYN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 674 | XLAT(MSG_SYN), |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 675 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 676 | #ifdef MSG_CONFIRM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 677 | XLAT(MSG_CONFIRM), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 678 | #endif |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 679 | #ifdef MSG_RST |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 680 | XLAT(MSG_RST), |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 681 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 682 | #ifdef MSG_ERRQUEUE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 683 | XLAT(MSG_ERRQUEUE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 684 | #endif |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 685 | #ifdef MSG_NOSIGNAL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 686 | XLAT(MSG_NOSIGNAL), |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 687 | #endif |
| 688 | #ifdef MSG_MORE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 689 | XLAT(MSG_MORE), |
Roland McGrath | 05e5e79 | 2004-04-14 02:53:54 +0000 | [diff] [blame] | 690 | #endif |
Dmitry V. Levin | 3df080a | 2012-03-13 01:26:26 +0000 | [diff] [blame] | 691 | #ifdef MSG_WAITFORONE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 692 | XLAT(MSG_WAITFORONE), |
Dmitry V. Levin | 3df080a | 2012-03-13 01:26:26 +0000 | [diff] [blame] | 693 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 694 | #ifdef MSG_EOF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 695 | XLAT(MSG_EOF), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 696 | #endif |
| 697 | #ifdef MSG_FASTOPEN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 698 | XLAT(MSG_FASTOPEN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 699 | #endif |
Roland McGrath | 71d3d66 | 2007-08-07 01:00:26 +0000 | [diff] [blame] | 700 | #ifdef MSG_CMSG_CLOEXEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 701 | XLAT(MSG_CMSG_CLOEXEC), |
Roland McGrath | 71d3d66 | 2007-08-07 01:00:26 +0000 | [diff] [blame] | 702 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 703 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 704 | }; |
| 705 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 706 | static const struct xlat sockoptions[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 707 | #ifdef SO_ACCEPTCONN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 708 | XLAT(SO_ACCEPTCONN), |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 709 | #endif |
| 710 | #ifdef SO_ALLRAW |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 711 | XLAT(SO_ALLRAW), |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 712 | #endif |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 713 | #ifdef SO_ATTACH_FILTER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 714 | XLAT(SO_ATTACH_FILTER), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 715 | #endif |
| 716 | #ifdef SO_BINDTODEVICE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 717 | XLAT(SO_BINDTODEVICE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 718 | #endif |
| 719 | #ifdef SO_BROADCAST |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 720 | XLAT(SO_BROADCAST), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 721 | #endif |
| 722 | #ifdef SO_BSDCOMPAT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 723 | XLAT(SO_BSDCOMPAT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 724 | #endif |
| 725 | #ifdef SO_DEBUG |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 726 | XLAT(SO_DEBUG), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 727 | #endif |
| 728 | #ifdef SO_DETACH_FILTER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 729 | XLAT(SO_DETACH_FILTER), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 730 | #endif |
| 731 | #ifdef SO_DONTROUTE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 732 | XLAT(SO_DONTROUTE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 733 | #endif |
| 734 | #ifdef SO_ERROR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 735 | XLAT(SO_ERROR), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 736 | #endif |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 737 | #ifdef SO_ICS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 738 | XLAT(SO_ICS), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 739 | #endif |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 740 | #ifdef SO_IMASOCKET |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 741 | XLAT(SO_IMASOCKET), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 742 | #endif |
| 743 | #ifdef SO_KEEPALIVE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 744 | XLAT(SO_KEEPALIVE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 745 | #endif |
| 746 | #ifdef SO_LINGER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 747 | XLAT(SO_LINGER), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 748 | #endif |
| 749 | #ifdef SO_LISTENING |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 750 | XLAT(SO_LISTENING), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 751 | #endif |
| 752 | #ifdef SO_MGMT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 753 | XLAT(SO_MGMT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 754 | #endif |
| 755 | #ifdef SO_NO_CHECK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 756 | XLAT(SO_NO_CHECK), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 757 | #endif |
| 758 | #ifdef SO_OOBINLINE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 759 | XLAT(SO_OOBINLINE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 760 | #endif |
| 761 | #ifdef SO_ORDREL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 762 | XLAT(SO_ORDREL), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 763 | #endif |
| 764 | #ifdef SO_PARALLELSVR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 765 | XLAT(SO_PARALLELSVR), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 766 | #endif |
| 767 | #ifdef SO_PASSCRED |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 768 | XLAT(SO_PASSCRED), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 769 | #endif |
| 770 | #ifdef SO_PEERCRED |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 771 | XLAT(SO_PEERCRED), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 772 | #endif |
| 773 | #ifdef SO_PEERNAME |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 774 | XLAT(SO_PEERNAME), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 775 | #endif |
| 776 | #ifdef SO_PEERSEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 777 | XLAT(SO_PEERSEC), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 778 | #endif |
| 779 | #ifdef SO_PRIORITY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 780 | XLAT(SO_PRIORITY), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 781 | #endif |
| 782 | #ifdef SO_PROTOTYPE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 783 | XLAT(SO_PROTOTYPE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 784 | #endif |
| 785 | #ifdef SO_RCVBUF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 786 | XLAT(SO_RCVBUF), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 787 | #endif |
| 788 | #ifdef SO_RCVLOWAT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 789 | XLAT(SO_RCVLOWAT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 790 | #endif |
| 791 | #ifdef SO_RCVTIMEO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 792 | XLAT(SO_RCVTIMEO), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 793 | #endif |
| 794 | #ifdef SO_RDWR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 795 | XLAT(SO_RDWR), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 796 | #endif |
| 797 | #ifdef SO_REUSEADDR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 798 | XLAT(SO_REUSEADDR), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 799 | #endif |
| 800 | #ifdef SO_REUSEPORT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 801 | XLAT(SO_REUSEPORT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 802 | #endif |
| 803 | #ifdef SO_SECURITY_AUTHENTICATION |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 804 | XLAT(SO_SECURITY_AUTHENTICATION), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 805 | #endif |
| 806 | #ifdef SO_SECURITY_ENCRYPTION_NETWORK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 807 | XLAT(SO_SECURITY_ENCRYPTION_NETWORK), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 808 | #endif |
| 809 | #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 810 | XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 811 | #endif |
| 812 | #ifdef SO_SEMA |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 813 | XLAT(SO_SEMA), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 814 | #endif |
| 815 | #ifdef SO_SNDBUF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 816 | XLAT(SO_SNDBUF), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 817 | #endif |
| 818 | #ifdef SO_SNDLOWAT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 819 | XLAT(SO_SNDLOWAT), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 820 | #endif |
| 821 | #ifdef SO_SNDTIMEO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 822 | XLAT(SO_SNDTIMEO), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 823 | #endif |
| 824 | #ifdef SO_TIMESTAMP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 825 | XLAT(SO_TIMESTAMP), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 826 | #endif |
| 827 | #ifdef SO_TYPE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 828 | XLAT(SO_TYPE), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 829 | #endif |
| 830 | #ifdef SO_USELOOPBACK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 831 | XLAT(SO_USELOOPBACK), |
Roland McGrath | 1bf4373 | 2004-08-31 07:16:14 +0000 | [diff] [blame] | 832 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 833 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 834 | }; |
| 835 | |
Denys Vlasenko | c36c352 | 2012-02-25 02:47:15 +0100 | [diff] [blame] | 836 | #if !defined(SOL_IP) && defined(IPPROTO_IP) |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 837 | #define SOL_IP IPPROTO_IP |
| 838 | #endif |
| 839 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 840 | #ifdef SOL_IP |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 841 | static const struct xlat sockipoptions[] = { |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 842 | #ifdef IP_TOS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 843 | XLAT(IP_TOS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 844 | #endif |
| 845 | #ifdef IP_TTL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 846 | XLAT(IP_TTL), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 847 | #endif |
| 848 | #ifdef IP_HDRINCL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 849 | XLAT(IP_HDRINCL), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 850 | #endif |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 851 | #ifdef IP_OPTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 852 | XLAT(IP_OPTIONS), |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 853 | #endif |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 854 | #ifdef IP_ROUTER_ALERT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 855 | XLAT(IP_ROUTER_ALERT), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 856 | #endif |
| 857 | #ifdef IP_RECVOPTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 858 | XLAT(IP_RECVOPTIONS), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 859 | #endif |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 860 | #ifdef IP_RECVOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 861 | XLAT(IP_RECVOPTS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 862 | #endif |
| 863 | #ifdef IP_RECVRETOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 864 | XLAT(IP_RECVRETOPTS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 865 | #endif |
| 866 | #ifdef IP_RECVDSTADDR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 867 | XLAT(IP_RECVDSTADDR), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 868 | #endif |
| 869 | #ifdef IP_RETOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 870 | XLAT(IP_RETOPTS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 871 | #endif |
| 872 | #ifdef IP_PKTINFO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 873 | XLAT(IP_PKTINFO), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 874 | #endif |
| 875 | #ifdef IP_PKTOPTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 876 | XLAT(IP_PKTOPTIONS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 877 | #endif |
| 878 | #ifdef IP_MTU_DISCOVER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 879 | XLAT(IP_MTU_DISCOVER), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 880 | #endif |
| 881 | #ifdef IP_RECVERR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 882 | XLAT(IP_RECVERR), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 883 | #endif |
| 884 | #ifdef IP_RECVTTL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 885 | XLAT(IP_RECVTTL), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 886 | #endif |
| 887 | #ifdef IP_RECVTOS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 888 | XLAT(IP_RECVTOS), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 889 | #endif |
| 890 | #ifdef IP_MTU |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 891 | XLAT(IP_MTU), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 892 | #endif |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 893 | #ifdef IP_MULTICAST_IF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 894 | XLAT(IP_MULTICAST_IF), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 895 | #endif |
| 896 | #ifdef IP_MULTICAST_TTL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 897 | XLAT(IP_MULTICAST_TTL), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 898 | #endif |
| 899 | #ifdef IP_MULTICAST_LOOP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 900 | XLAT(IP_MULTICAST_LOOP), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 901 | #endif |
| 902 | #ifdef IP_ADD_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 903 | XLAT(IP_ADD_MEMBERSHIP), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 904 | #endif |
| 905 | #ifdef IP_DROP_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 906 | XLAT(IP_DROP_MEMBERSHIP), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 907 | #endif |
| 908 | #ifdef IP_BROADCAST_IF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 909 | XLAT(IP_BROADCAST_IF), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 910 | #endif |
| 911 | #ifdef IP_RECVIFINDEX |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 912 | XLAT(IP_RECVIFINDEX), |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 913 | #endif |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 914 | #ifdef IP_MSFILTER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 915 | XLAT(IP_MSFILTER), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 916 | #endif |
| 917 | #ifdef MCAST_MSFILTER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 918 | XLAT(MCAST_MSFILTER), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 919 | #endif |
| 920 | #ifdef IP_FREEBIND |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 921 | XLAT(IP_FREEBIND), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 922 | #endif |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 923 | #ifdef IP_IPSEC_POLICY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 924 | XLAT(IP_IPSEC_POLICY), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 925 | #endif |
| 926 | #ifdef IP_XFRM_POLICY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 927 | XLAT(IP_XFRM_POLICY), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 928 | #endif |
| 929 | #ifdef IP_PASSSEC |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 930 | XLAT(IP_PASSSEC), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 931 | #endif |
| 932 | #ifdef IP_TRANSPARENT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 933 | XLAT(IP_TRANSPARENT), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 934 | #endif |
| 935 | #ifdef IP_ORIGDSTADDR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 936 | XLAT(IP_ORIGDSTADDR), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 937 | #endif |
| 938 | #ifdef IP_RECVORIGDSTADDR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 939 | XLAT(IP_RECVORIGDSTADDR), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 940 | #endif |
| 941 | #ifdef IP_MINTTL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 942 | XLAT(IP_MINTTL), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 943 | #endif |
| 944 | #ifdef IP_NODEFRAG |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 945 | XLAT(IP_NODEFRAG), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 946 | #endif |
| 947 | #ifdef IP_UNBLOCK_SOURCE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 948 | XLAT(IP_UNBLOCK_SOURCE), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 949 | #endif |
| 950 | #ifdef IP_BLOCK_SOURCE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 951 | XLAT(IP_BLOCK_SOURCE), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 952 | #endif |
| 953 | #ifdef IP_ADD_SOURCE_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 954 | XLAT(IP_ADD_SOURCE_MEMBERSHIP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 955 | #endif |
| 956 | #ifdef IP_DROP_SOURCE_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 957 | XLAT(IP_DROP_SOURCE_MEMBERSHIP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 958 | #endif |
| 959 | #ifdef MCAST_JOIN_GROUP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 960 | XLAT(MCAST_JOIN_GROUP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 961 | #endif |
| 962 | #ifdef MCAST_BLOCK_SOURCE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 963 | XLAT(MCAST_BLOCK_SOURCE), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 964 | #endif |
| 965 | #ifdef MCAST_UNBLOCK_SOURCE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 966 | XLAT(MCAST_UNBLOCK_SOURCE), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 967 | #endif |
| 968 | #ifdef MCAST_LEAVE_GROUP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 969 | XLAT(MCAST_LEAVE_GROUP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 970 | #endif |
| 971 | #ifdef MCAST_JOIN_SOURCE_GROUP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 972 | XLAT(MCAST_JOIN_SOURCE_GROUP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 973 | #endif |
| 974 | #ifdef MCAST_LEAVE_SOURCE_GROUP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 975 | XLAT(MCAST_LEAVE_SOURCE_GROUP), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 976 | #endif |
| 977 | #ifdef IP_MULTICAST_ALL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 978 | XLAT(IP_MULTICAST_ALL), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 979 | #endif |
| 980 | #ifdef IP_UNICAST_IF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 981 | XLAT(IP_UNICAST_IF), |
Mike Frysinger | aa4633c | 2014-01-30 18:53:43 -0500 | [diff] [blame] | 982 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 983 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 984 | }; |
| 985 | #endif /* SOL_IP */ |
| 986 | |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 987 | #ifdef SOL_IPV6 |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 988 | static const struct xlat sockipv6options[] = { |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 989 | #ifdef IPV6_ADDRFORM |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 990 | XLAT(IPV6_ADDRFORM), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 991 | #endif |
| 992 | #ifdef MCAST_FILTER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 993 | XLAT(MCAST_FILTER), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 994 | #endif |
| 995 | #ifdef IPV6_PKTOPTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 996 | XLAT(IPV6_PKTOPTIONS), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 997 | #endif |
| 998 | #ifdef IPV6_MTU |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 999 | XLAT(IPV6_MTU), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1000 | #endif |
| 1001 | #ifdef IPV6_V6ONLY |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1002 | XLAT(IPV6_V6ONLY), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1003 | #endif |
| 1004 | #ifdef IPV6_PKTINFO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1005 | XLAT(IPV6_PKTINFO), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1006 | #endif |
| 1007 | #ifdef IPV6_HOPLIMIT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1008 | XLAT(IPV6_HOPLIMIT), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1009 | #endif |
| 1010 | #ifdef IPV6_RTHDR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1011 | XLAT(IPV6_RTHDR), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1012 | #endif |
| 1013 | #ifdef IPV6_HOPOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1014 | XLAT(IPV6_HOPOPTS), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1015 | #endif |
| 1016 | #ifdef IPV6_DSTOPTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1017 | XLAT(IPV6_DSTOPTS), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1018 | #endif |
| 1019 | #ifdef IPV6_FLOWINFO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1020 | XLAT(IPV6_FLOWINFO), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1021 | #endif |
| 1022 | #ifdef IPV6_UNICAST_HOPS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1023 | XLAT(IPV6_UNICAST_HOPS), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1024 | #endif |
| 1025 | #ifdef IPV6_MULTICAST_HOPS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1026 | XLAT(IPV6_MULTICAST_HOPS), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1027 | #endif |
| 1028 | #ifdef IPV6_MULTICAST_LOOP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1029 | XLAT(IPV6_MULTICAST_LOOP), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1030 | #endif |
| 1031 | #ifdef IPV6_MULTICAST_IF |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1032 | XLAT(IPV6_MULTICAST_IF), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1033 | #endif |
| 1034 | #ifdef IPV6_MTU_DISCOVER |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1035 | XLAT(IPV6_MTU_DISCOVER), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1036 | #endif |
| 1037 | #ifdef IPV6_RECVERR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1038 | XLAT(IPV6_RECVERR), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1039 | #endif |
| 1040 | #ifdef IPV6_FLOWINFO_SEND |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1041 | XLAT(IPV6_FLOWINFO_SEND), |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1042 | #endif |
Roland McGrath | c0b9e37 | 2005-07-04 23:33:38 +0000 | [diff] [blame] | 1043 | #ifdef IPV6_ADD_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1044 | XLAT(IPV6_ADD_MEMBERSHIP), |
Roland McGrath | c0b9e37 | 2005-07-04 23:33:38 +0000 | [diff] [blame] | 1045 | #endif |
| 1046 | #ifdef IPV6_DROP_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1047 | XLAT(IPV6_DROP_MEMBERSHIP), |
Roland McGrath | c0b9e37 | 2005-07-04 23:33:38 +0000 | [diff] [blame] | 1048 | #endif |
| 1049 | #ifdef IPV6_ROUTER_ALERT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1050 | XLAT(IPV6_ROUTER_ALERT), |
Roland McGrath | c0b9e37 | 2005-07-04 23:33:38 +0000 | [diff] [blame] | 1051 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1052 | XLAT_END |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 1053 | }; |
| 1054 | #endif /* SOL_IPV6 */ |
| 1055 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1056 | #ifdef SOL_IPX |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1057 | static const struct xlat sockipxoptions[] = { |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1058 | XLAT(IPX_TYPE), |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1059 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1060 | }; |
| 1061 | #endif /* SOL_IPX */ |
| 1062 | |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1063 | #ifdef SOL_RAW |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1064 | static const struct xlat sockrawoptions[] = { |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1065 | #if defined(ICMP_FILTER) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1066 | XLAT(ICMP_FILTER), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1067 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1068 | XLAT_END |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1069 | }; |
| 1070 | #endif /* SOL_RAW */ |
| 1071 | |
| 1072 | #ifdef SOL_PACKET |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1073 | static const struct xlat sockpacketoptions[] = { |
Roland McGrath | c294b8f | 2007-11-01 21:37:33 +0000 | [diff] [blame] | 1074 | #ifdef PACKET_ADD_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1075 | XLAT(PACKET_ADD_MEMBERSHIP), |
Roland McGrath | c294b8f | 2007-11-01 21:37:33 +0000 | [diff] [blame] | 1076 | #endif |
| 1077 | #ifdef PACKET_DROP_MEMBERSHIP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1078 | XLAT(PACKET_DROP_MEMBERSHIP), |
Roland McGrath | c294b8f | 2007-11-01 21:37:33 +0000 | [diff] [blame] | 1079 | #endif |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1080 | #if defined(PACKET_RECV_OUTPUT) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1081 | XLAT(PACKET_RECV_OUTPUT), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1082 | #endif |
| 1083 | #if defined(PACKET_RX_RING) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1084 | XLAT(PACKET_RX_RING), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1085 | #endif |
| 1086 | #if defined(PACKET_STATISTICS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1087 | XLAT(PACKET_STATISTICS), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1088 | #endif |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1089 | #if defined(PACKET_COPY_THRESH) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1090 | XLAT(PACKET_COPY_THRESH), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1091 | #endif |
| 1092 | #if defined(PACKET_AUXDATA) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1093 | XLAT(PACKET_AUXDATA), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1094 | #endif |
| 1095 | #if defined(PACKET_ORIGDEV) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1096 | XLAT(PACKET_ORIGDEV), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1097 | #endif |
| 1098 | #if defined(PACKET_VERSION) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1099 | XLAT(PACKET_VERSION), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1100 | #endif |
| 1101 | #if defined(PACKET_HDRLEN) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1102 | XLAT(PACKET_HDRLEN), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1103 | #endif |
| 1104 | #if defined(PACKET_RESERVE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1105 | XLAT(PACKET_RESERVE), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1106 | #endif |
| 1107 | #if defined(PACKET_TX_RING) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1108 | XLAT(PACKET_TX_RING), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1109 | #endif |
| 1110 | #if defined(PACKET_LOSS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1111 | XLAT(PACKET_LOSS), |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 1112 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1113 | XLAT_END |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1114 | }; |
| 1115 | #endif /* SOL_PACKET */ |
| 1116 | |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1117 | #ifdef SOL_SCTP |
| 1118 | static const struct xlat socksctpoptions[] = { |
| 1119 | #if defined(SCTP_RTOINFO) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1120 | XLAT(SCTP_RTOINFO), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1121 | #endif |
| 1122 | #if defined(SCTP_ASSOCINFO) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1123 | XLAT(SCTP_ASSOCINFO), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1124 | #endif |
| 1125 | #if defined(SCTP_INITMSG) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1126 | XLAT(SCTP_INITMSG), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1127 | #endif |
| 1128 | #if defined(SCTP_NODELAY) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1129 | XLAT(SCTP_NODELAY), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1130 | #endif |
| 1131 | #if defined(SCTP_AUTOCLOSE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1132 | XLAT(SCTP_AUTOCLOSE), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1133 | #endif |
| 1134 | #if defined(SCTP_SET_PEER_PRIMARY_ADDR) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1135 | XLAT(SCTP_SET_PEER_PRIMARY_ADDR), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1136 | #endif |
| 1137 | #if defined(SCTP_PRIMARY_ADDR) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1138 | XLAT(SCTP_PRIMARY_ADDR), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1139 | #endif |
| 1140 | #if defined(SCTP_ADAPTATION_LAYER) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1141 | XLAT(SCTP_ADAPTATION_LAYER), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1142 | #endif |
| 1143 | #if defined(SCTP_DISABLE_FRAGMENTS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1144 | XLAT(SCTP_DISABLE_FRAGMENTS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1145 | #endif |
| 1146 | #if defined(SCTP_PEER_ADDR_PARAMS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1147 | XLAT(SCTP_PEER_ADDR_PARAMS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1148 | #endif |
| 1149 | #if defined(SCTP_DEFAULT_SEND_PARAM) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1150 | XLAT(SCTP_DEFAULT_SEND_PARAM), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1151 | #endif |
| 1152 | #if defined(SCTP_EVENTS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1153 | XLAT(SCTP_EVENTS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1154 | #endif |
| 1155 | #if defined(SCTP_I_WANT_MAPPED_V4_ADDR) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1156 | XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1157 | #endif |
| 1158 | #if defined(SCTP_MAXSEG) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1159 | XLAT(SCTP_MAXSEG), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1160 | #endif |
| 1161 | #if defined(SCTP_STATUS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1162 | XLAT(SCTP_STATUS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1163 | #endif |
| 1164 | #if defined(SCTP_GET_PEER_ADDR_INFO) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1165 | XLAT(SCTP_GET_PEER_ADDR_INFO), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1166 | #endif |
| 1167 | #if defined(SCTP_DELAYED_ACK) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1168 | XLAT(SCTP_DELAYED_ACK), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1169 | #endif |
| 1170 | #if defined(SCTP_CONTEXT) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1171 | XLAT(SCTP_CONTEXT), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1172 | #endif |
| 1173 | #if defined(SCTP_FRAGMENT_INTERLEAVE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1174 | XLAT(SCTP_FRAGMENT_INTERLEAVE), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1175 | #endif |
| 1176 | #if defined(SCTP_PARTIAL_DELIVERY_POINT) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1177 | XLAT(SCTP_PARTIAL_DELIVERY_POINT), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1178 | #endif |
| 1179 | #if defined(SCTP_MAX_BURST) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1180 | XLAT(SCTP_MAX_BURST), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1181 | #endif |
| 1182 | #if defined(SCTP_AUTH_CHUNK) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1183 | XLAT(SCTP_AUTH_CHUNK), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1184 | #endif |
| 1185 | #if defined(SCTP_HMAC_IDENT) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1186 | XLAT(SCTP_HMAC_IDENT), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1187 | #endif |
| 1188 | #if defined(SCTP_AUTH_KEY) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1189 | XLAT(SCTP_AUTH_KEY), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1190 | #endif |
| 1191 | #if defined(SCTP_AUTH_ACTIVE_KEY) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1192 | XLAT(SCTP_AUTH_ACTIVE_KEY), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1193 | #endif |
| 1194 | #if defined(SCTP_AUTH_DELETE_KEY) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1195 | XLAT(SCTP_AUTH_DELETE_KEY), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1196 | #endif |
| 1197 | #if defined(SCTP_PEER_AUTH_CHUNKS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1198 | XLAT(SCTP_PEER_AUTH_CHUNKS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1199 | #endif |
| 1200 | #if defined(SCTP_LOCAL_AUTH_CHUNKS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1201 | XLAT(SCTP_LOCAL_AUTH_CHUNKS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1202 | #endif |
| 1203 | #if defined(SCTP_GET_ASSOC_NUMBER) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1204 | XLAT(SCTP_GET_ASSOC_NUMBER), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1205 | #endif |
| 1206 | |
| 1207 | /* linux specific things */ |
| 1208 | #if defined(SCTP_SOCKOPT_BINDX_ADD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1209 | XLAT(SCTP_SOCKOPT_BINDX_ADD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1210 | #endif |
| 1211 | #if defined(SCTP_SOCKOPT_BINDX_REM) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1212 | XLAT(SCTP_SOCKOPT_BINDX_REM), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1213 | #endif |
| 1214 | #if defined(SCTP_SOCKOPT_PEELOFF) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1215 | XLAT(SCTP_SOCKOPT_PEELOFF), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1216 | #endif |
| 1217 | #if defined(SCTP_GET_PEER_ADDRS_NUM_OLD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1218 | XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1219 | #endif |
| 1220 | #if defined(SCTP_GET_PEER_ADDRS_OLD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1221 | XLAT(SCTP_GET_PEER_ADDRS_OLD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1222 | #endif |
| 1223 | #if defined(SCTP_GET_LOCAL_ADDRS_NUM_OLD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1224 | XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1225 | #endif |
| 1226 | #if defined(SCTP_GET_LOCAL_ADDRS_OLD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1227 | XLAT(SCTP_GET_LOCAL_ADDRS_OLD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1228 | #endif |
| 1229 | #if defined(SCTP_SOCKOPT_CONNECTX_OLD) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1230 | XLAT(SCTP_SOCKOPT_CONNECTX_OLD), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1231 | #endif |
| 1232 | #if defined(SCTP_GET_PEER_ADDRS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1233 | XLAT(SCTP_GET_PEER_ADDRS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1234 | #endif |
| 1235 | #if defined(SCTP_GET_LOCAL_ADDRS) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1236 | XLAT(SCTP_GET_LOCAL_ADDRS), |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1237 | #endif |
| 1238 | |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1239 | XLAT_END |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 1240 | }; |
| 1241 | #endif |
| 1242 | |
Denys Vlasenko | c36c352 | 2012-02-25 02:47:15 +0100 | [diff] [blame] | 1243 | #if !defined(SOL_TCP) && defined(IPPROTO_TCP) |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 1244 | #define SOL_TCP IPPROTO_TCP |
| 1245 | #endif |
| 1246 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1247 | #ifdef SOL_TCP |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1248 | static const struct xlat socktcpoptions[] = { |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1249 | XLAT(TCP_NODELAY), |
| 1250 | XLAT(TCP_MAXSEG), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1251 | #ifdef TCP_CORK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1252 | XLAT(TCP_CORK), |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1253 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1254 | #ifdef TCP_KEEPIDLE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1255 | XLAT(TCP_KEEPIDLE), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1256 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1257 | #ifdef TCP_KEEPINTVL |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1258 | XLAT(TCP_KEEPINTVL), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1259 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1260 | #ifdef TCP_KEEPCNT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1261 | XLAT(TCP_KEEPCNT), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1262 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1263 | #ifdef TCP_SYNCNT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1264 | XLAT(TCP_SYNCNT), |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 1265 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1266 | #ifdef TCP_LINGER2 |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1267 | XLAT(TCP_LINGER2), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1268 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1269 | #ifdef TCP_DEFER_ACCEPT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1270 | XLAT(TCP_DEFER_ACCEPT), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1271 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1272 | #ifdef TCP_WINDOW_CLAMP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1273 | XLAT(TCP_WINDOW_CLAMP), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1274 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1275 | #ifdef TCP_INFO |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1276 | XLAT(TCP_INFO), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1277 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1278 | #ifdef TCP_QUICKACK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1279 | XLAT(TCP_QUICKACK), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1280 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1281 | #ifdef TCP_CONGESTION |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1282 | XLAT(TCP_CONGESTION), |
Wichert Akkerman | 8b8ff7c | 2001-12-27 22:27:30 +0000 | [diff] [blame] | 1283 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1284 | #ifdef TCP_MD5SIG |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1285 | XLAT(TCP_MD5SIG), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1286 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1287 | #ifdef TCP_COOKIE_TRANSACTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1288 | XLAT(TCP_COOKIE_TRANSACTIONS), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1289 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1290 | #ifdef TCP_THIN_LINEAR_TIMEOUTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1291 | XLAT(TCP_THIN_LINEAR_TIMEOUTS), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1292 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1293 | #ifdef TCP_THIN_DUPACK |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1294 | XLAT(TCP_THIN_DUPACK), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1295 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1296 | #ifdef TCP_USER_TIMEOUT |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1297 | XLAT(TCP_USER_TIMEOUT), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1298 | #endif |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1299 | #ifdef TCP_REPAIR |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1300 | XLAT(TCP_REPAIR), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1301 | #endif |
| 1302 | #ifdef TCP_REPAIR_QUEUE |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1303 | XLAT(TCP_REPAIR_QUEUE), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1304 | #endif |
| 1305 | #ifdef TCP_QUEUE_SEQ |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1306 | XLAT(TCP_QUEUE_SEQ), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1307 | #endif |
| 1308 | #ifdef TCP_REPAIR_OPTIONS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1309 | XLAT(TCP_REPAIR_OPTIONS), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1310 | #endif |
| 1311 | #ifdef TCP_FASTOPEN |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1312 | XLAT(TCP_FASTOPEN), |
Dmitry V. Levin | ea0d2a6 | 2013-05-16 22:19:30 +0000 | [diff] [blame] | 1313 | #endif |
| 1314 | #ifdef TCP_TIMESTAMP |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1315 | XLAT(TCP_TIMESTAMP), |
Dmitry V. Levin | b05fc54 | 2011-12-01 21:06:00 +0000 | [diff] [blame] | 1316 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1317 | XLAT_END |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1318 | }; |
| 1319 | #endif /* SOL_TCP */ |
| 1320 | |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1321 | #ifdef SOL_RAW |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1322 | static const struct xlat icmpfilterflags[] = { |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1323 | #if defined(ICMP_ECHOREPLY) |
| 1324 | { (1<<ICMP_ECHOREPLY), "ICMP_ECHOREPLY" }, |
| 1325 | #endif |
| 1326 | #if defined(ICMP_DEST_UNREACH) |
| 1327 | { (1<<ICMP_DEST_UNREACH), "ICMP_DEST_UNREACH" }, |
| 1328 | #endif |
| 1329 | #if defined(ICMP_SOURCE_QUENCH) |
| 1330 | { (1<<ICMP_SOURCE_QUENCH), "ICMP_SOURCE_QUENCH" }, |
| 1331 | #endif |
| 1332 | #if defined(ICMP_REDIRECT) |
| 1333 | { (1<<ICMP_REDIRECT), "ICMP_REDIRECT" }, |
| 1334 | #endif |
| 1335 | #if defined(ICMP_ECHO) |
| 1336 | { (1<<ICMP_ECHO), "ICMP_ECHO" }, |
| 1337 | #endif |
| 1338 | #if defined(ICMP_TIME_EXCEEDED) |
| 1339 | { (1<<ICMP_TIME_EXCEEDED), "ICMP_TIME_EXCEEDED" }, |
| 1340 | #endif |
| 1341 | #if defined(ICMP_PARAMETERPROB) |
| 1342 | { (1<<ICMP_PARAMETERPROB), "ICMP_PARAMETERPROB" }, |
| 1343 | #endif |
| 1344 | #if defined(ICMP_TIMESTAMP) |
| 1345 | { (1<<ICMP_TIMESTAMP), "ICMP_TIMESTAMP" }, |
| 1346 | #endif |
| 1347 | #if defined(ICMP_TIMESTAMPREPLY) |
| 1348 | { (1<<ICMP_TIMESTAMPREPLY), "ICMP_TIMESTAMPREPLY" }, |
| 1349 | #endif |
| 1350 | #if defined(ICMP_INFO_REQUEST) |
| 1351 | { (1<<ICMP_INFO_REQUEST), "ICMP_INFO_REQUEST" }, |
| 1352 | #endif |
| 1353 | #if defined(ICMP_INFO_REPLY) |
| 1354 | { (1<<ICMP_INFO_REPLY), "ICMP_INFO_REPLY" }, |
| 1355 | #endif |
| 1356 | #if defined(ICMP_ADDRESS) |
| 1357 | { (1<<ICMP_ADDRESS), "ICMP_ADDRESS" }, |
| 1358 | #endif |
| 1359 | #if defined(ICMP_ADDRESSREPLY) |
| 1360 | { (1<<ICMP_ADDRESSREPLY), "ICMP_ADDRESSREPLY" }, |
| 1361 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1362 | XLAT_END |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 1363 | }; |
| 1364 | #endif /* SOL_RAW */ |
| 1365 | |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1366 | #if defined(AF_PACKET) /* from e.g. linux/if_packet.h */ |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1367 | static const struct xlat af_packet_types[] = { |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1368 | #if defined(PACKET_HOST) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1369 | XLAT(PACKET_HOST), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1370 | #endif |
| 1371 | #if defined(PACKET_BROADCAST) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1372 | XLAT(PACKET_BROADCAST), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1373 | #endif |
| 1374 | #if defined(PACKET_MULTICAST) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1375 | XLAT(PACKET_MULTICAST), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1376 | #endif |
| 1377 | #if defined(PACKET_OTHERHOST) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1378 | XLAT(PACKET_OTHERHOST), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1379 | #endif |
| 1380 | #if defined(PACKET_OUTGOING) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1381 | XLAT(PACKET_OUTGOING), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1382 | #endif |
| 1383 | #if defined(PACKET_LOOPBACK) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1384 | XLAT(PACKET_LOOPBACK), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1385 | #endif |
| 1386 | #if defined(PACKET_FASTROUTE) |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1387 | XLAT(PACKET_FASTROUTE), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1388 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1389 | XLAT_END |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1390 | }; |
| 1391 | #endif /* defined(AF_PACKET) */ |
| 1392 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1393 | void |
Dmitry V. Levin | b6c32f4 | 2007-10-08 23:31:19 +0000 | [diff] [blame] | 1394 | printsock(struct tcb *tcp, long addr, int addrlen) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1395 | { |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1396 | union { |
| 1397 | char pad[128]; |
| 1398 | struct sockaddr sa; |
| 1399 | struct sockaddr_in sin; |
| 1400 | struct sockaddr_un sau; |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1401 | #ifdef HAVE_INET_NTOP |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1402 | struct sockaddr_in6 sa6; |
| 1403 | #endif |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 1404 | #if defined(AF_IPX) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1405 | struct sockaddr_ipx sipx; |
| 1406 | #endif |
| 1407 | #ifdef AF_PACKET |
| 1408 | struct sockaddr_ll ll; |
| 1409 | #endif |
| 1410 | #ifdef AF_NETLINK |
| 1411 | struct sockaddr_nl nl; |
| 1412 | #endif |
| 1413 | } addrbuf; |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1414 | char string_addr[100]; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1415 | |
| 1416 | if (addr == 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1417 | tprints("NULL"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1418 | return; |
| 1419 | } |
| 1420 | if (!verbose(tcp)) { |
| 1421 | tprintf("%#lx", addr); |
| 1422 | return; |
| 1423 | } |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1424 | |
Dmitry V. Levin | b6c32f4 | 2007-10-08 23:31:19 +0000 | [diff] [blame] | 1425 | if (addrlen < 2 || addrlen > sizeof(addrbuf)) |
| 1426 | addrlen = sizeof(addrbuf); |
| 1427 | |
| 1428 | memset(&addrbuf, 0, sizeof(addrbuf)); |
| 1429 | if (umoven(tcp, addr, addrlen, addrbuf.pad) < 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1430 | tprints("{...}"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1431 | return; |
| 1432 | } |
Dmitry V. Levin | b6c32f4 | 2007-10-08 23:31:19 +0000 | [diff] [blame] | 1433 | addrbuf.pad[sizeof(addrbuf.pad) - 1] = '\0'; |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1434 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1435 | tprints("{sa_family="); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1436 | printxval(addrfams, addrbuf.sa.sa_family, "AF_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1437 | tprints(", "); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1438 | |
| 1439 | switch (addrbuf.sa.sa_family) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1440 | case AF_UNIX: |
Dmitry V. Levin | b6c32f4 | 2007-10-08 23:31:19 +0000 | [diff] [blame] | 1441 | if (addrlen == 2) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1442 | tprints("NULL"); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1443 | } else if (addrbuf.sau.sun_path[0]) { |
Dmitry V. Levin | c86340e | 2012-02-22 00:23:52 +0000 | [diff] [blame] | 1444 | tprints("sun_path="); |
Dmitry V. Levin | 16fbe97 | 2007-10-13 21:03:17 +0000 | [diff] [blame] | 1445 | printpathn(tcp, addr + 2, strlen(addrbuf.sau.sun_path)); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1446 | } else { |
Dmitry V. Levin | c86340e | 2012-02-22 00:23:52 +0000 | [diff] [blame] | 1447 | tprints("sun_path=@"); |
Dmitry V. Levin | 16fbe97 | 2007-10-13 21:03:17 +0000 | [diff] [blame] | 1448 | printpathn(tcp, addr + 3, strlen(addrbuf.sau.sun_path + 1)); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1449 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1450 | break; |
| 1451 | case AF_INET: |
John Hughes | 1fcb1d6 | 2001-09-18 15:56:53 +0000 | [diff] [blame] | 1452 | tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1453 | ntohs(addrbuf.sin.sin_port), inet_ntoa(addrbuf.sin.sin_addr)); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1454 | break; |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1455 | #ifdef HAVE_INET_NTOP |
| 1456 | case AF_INET6: |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1457 | inet_ntop(AF_INET6, &addrbuf.sa6.sin6_addr, string_addr, sizeof(string_addr)); |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 1458 | tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=%u", |
| 1459 | ntohs(addrbuf.sa6.sin6_port), string_addr, |
| 1460 | addrbuf.sa6.sin6_flowinfo); |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 1461 | #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 1462 | { |
| 1463 | #if defined(HAVE_IF_INDEXTONAME) && defined(IN6_IS_ADDR_LINKLOCAL) && defined(IN6_IS_ADDR_MC_LINKLOCAL) |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1464 | int numericscope = 0; |
| 1465 | if (IN6_IS_ADDR_LINKLOCAL(&addrbuf.sa6.sin6_addr) |
| 1466 | || IN6_IS_ADDR_MC_LINKLOCAL(&addrbuf.sa6.sin6_addr)) { |
| 1467 | char scopebuf[IFNAMSIZ + 1]; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 1468 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1469 | if (if_indextoname(addrbuf.sa6.sin6_scope_id, scopebuf) == NULL) |
| 1470 | numericscope++; |
| 1471 | else |
| 1472 | tprintf(", sin6_scope_id=if_nametoindex(\"%s\")", scopebuf); |
| 1473 | } else |
| 1474 | numericscope++; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 1475 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1476 | if (numericscope) |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 1477 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1478 | tprintf(", sin6_scope_id=%u", addrbuf.sa6.sin6_scope_id); |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 1479 | } |
| 1480 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1481 | break; |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1482 | #endif |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 1483 | #if defined(AF_IPX) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1484 | case AF_IPX: |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1485 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1486 | int i; |
John Hughes | 1fcb1d6 | 2001-09-18 15:56:53 +0000 | [diff] [blame] | 1487 | tprintf("sipx_port=htons(%u), ", |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1488 | ntohs(addrbuf.sipx.sipx_port)); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1489 | /* Yes, I know, this does not look too |
| 1490 | * strace-ish, but otherwise the IPX |
| 1491 | * addresses just look monstrous... |
| 1492 | * Anyways, feel free if you don't like |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 1493 | * this way.. :) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1494 | */ |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1495 | tprintf("%08lx:", (unsigned long)ntohl(addrbuf.sipx.sipx_network)); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1496 | for (i = 0; i < IPX_NODE_LEN; i++) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1497 | tprintf("%02x", addrbuf.sipx.sipx_node[i]); |
| 1498 | tprintf("/[%02x]", addrbuf.sipx.sipx_type); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1499 | } |
| 1500 | break; |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 1501 | #endif /* AF_IPX */ |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1502 | #ifdef AF_PACKET |
| 1503 | case AF_PACKET: |
| 1504 | { |
| 1505 | int i; |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1506 | tprintf("proto=%#04x, if%d, pkttype=", |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1507 | ntohs(addrbuf.ll.sll_protocol), |
Wichert Akkerman | b0c598f | 2002-04-01 12:48:06 +0000 | [diff] [blame] | 1508 | addrbuf.ll.sll_ifindex); |
| 1509 | printxval(af_packet_types, addrbuf.ll.sll_pkttype, "?"); |
| 1510 | tprintf(", addr(%d)={%d, ", |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1511 | addrbuf.ll.sll_halen, |
| 1512 | addrbuf.ll.sll_hatype); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1513 | for (i = 0; i < addrbuf.ll.sll_halen; i++) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1514 | tprintf("%02x", addrbuf.ll.sll_addr[i]); |
| 1515 | } |
| 1516 | break; |
| 1517 | |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 1518 | #endif /* AF_PACKET */ |
Roland McGrath | 36ef1bc | 2003-11-06 23:41:23 +0000 | [diff] [blame] | 1519 | #ifdef AF_NETLINK |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1520 | case AF_NETLINK: |
| 1521 | tprintf("pid=%d, groups=%08x", addrbuf.nl.nl_pid, addrbuf.nl.nl_groups); |
| 1522 | break; |
| 1523 | #endif /* AF_NETLINK */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1524 | /* AF_AX25 AF_APPLETALK AF_NETROM AF_BRIDGE AF_AAL5 |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1525 | AF_X25 AF_ROSE etc. still need to be done */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1526 | |
| 1527 | default: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1528 | tprints("sa_data="); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1529 | printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data, |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1530 | sizeof addrbuf.sa.sa_data); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1531 | break; |
| 1532 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1533 | tprints("}"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1534 | } |
| 1535 | |
| 1536 | #if HAVE_SENDMSG |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1537 | static const struct xlat scmvals[] = { |
| 1538 | #ifdef SCM_RIGHTS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1539 | XLAT(SCM_RIGHTS), |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1540 | #endif |
| 1541 | #ifdef SCM_CREDENTIALS |
Dmitry V. Levin | bce0cc6 | 2014-02-05 01:33:50 +0000 | [diff] [blame] | 1542 | XLAT(SCM_CREDENTIALS), |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1543 | #endif |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 1544 | XLAT_END |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1545 | }; |
| 1546 | |
| 1547 | static void |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 1548 | printcmsghdr(struct tcb *tcp, unsigned long addr, unsigned long len) |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1549 | { |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1550 | struct cmsghdr *cmsg = len < sizeof(struct cmsghdr) ? |
| 1551 | NULL : malloc(len); |
| 1552 | if (cmsg == NULL || umoven(tcp, addr, len, (char *) cmsg) < 0) { |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1553 | tprintf(", msg_control=%#lx", addr); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1554 | free(cmsg); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1555 | return; |
| 1556 | } |
| 1557 | |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 1558 | tprintf(", {cmsg_len=%u, cmsg_level=", (unsigned) cmsg->cmsg_len); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1559 | printxval(socketlayers, cmsg->cmsg_level, "SOL_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1560 | tprints(", cmsg_type="); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1561 | |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1562 | if (cmsg->cmsg_level == SOL_SOCKET) { |
| 1563 | unsigned long cmsg_len; |
Roland McGrath | 96ad7b8 | 2005-02-02 03:11:32 +0000 | [diff] [blame] | 1564 | |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1565 | printxval(scmvals, cmsg->cmsg_type, "SCM_???"); |
| 1566 | cmsg_len = (len < cmsg->cmsg_len) ? len : cmsg->cmsg_len; |
| 1567 | |
| 1568 | if (cmsg->cmsg_type == SCM_RIGHTS |
| 1569 | && CMSG_LEN(sizeof(int)) <= cmsg_len) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1570 | int *fds = (int *) CMSG_DATA(cmsg); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1571 | int first = 1; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1572 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1573 | tprints(", {"); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1574 | while ((char *) fds < ((char *) cmsg + cmsg_len)) { |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1575 | if (!first) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1576 | tprints(", "); |
Dmitry V. Levin | f23b097 | 2014-05-29 21:35:34 +0000 | [diff] [blame] | 1577 | printfd(tcp, *fds++); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1578 | first = 0; |
| 1579 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1580 | tprints("}}"); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1581 | free(cmsg); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1582 | return; |
| 1583 | } |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1584 | if (cmsg->cmsg_type == SCM_CREDENTIALS |
| 1585 | && CMSG_LEN(sizeof(struct ucred)) <= cmsg_len) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1586 | struct ucred *uc = (struct ucred *) CMSG_DATA(cmsg); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1587 | |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1588 | tprintf("{pid=%ld, uid=%ld, gid=%ld}}", |
| 1589 | (long)uc->pid, (long)uc->uid, (long)uc->gid); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1590 | free(cmsg); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1591 | return; |
| 1592 | } |
| 1593 | } |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1594 | free(cmsg); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1595 | tprints(", ...}"); |
Roland McGrath | 5077082 | 2004-10-06 22:11:51 +0000 | [diff] [blame] | 1596 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1597 | |
| 1598 | static void |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 1599 | do_msghdr(struct tcb *tcp, struct msghdr *msg, unsigned long data_size) |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1600 | { |
| 1601 | tprintf("{msg_name(%d)=", msg->msg_namelen); |
| 1602 | printsock(tcp, (long)msg->msg_name, msg->msg_namelen); |
| 1603 | |
| 1604 | tprintf(", msg_iov(%lu)=", (unsigned long)msg->msg_iovlen); |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 1605 | tprint_iov_upto(tcp, (unsigned long)msg->msg_iovlen, |
| 1606 | (unsigned long)msg->msg_iov, 1, data_size); |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1607 | |
| 1608 | #ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL |
| 1609 | tprintf(", msg_controllen=%lu", (unsigned long)msg->msg_controllen); |
| 1610 | if (msg->msg_controllen) |
| 1611 | printcmsghdr(tcp, (unsigned long) msg->msg_control, |
| 1612 | msg->msg_controllen); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1613 | tprints(", msg_flags="); |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1614 | printflags(msg_flags, msg->msg_flags, "MSG_???"); |
| 1615 | #else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */ |
| 1616 | tprintf("msg_accrights=%#lx, msg_accrightslen=%u", |
| 1617 | (unsigned long) msg->msg_accrights, msg->msg_accrightslen); |
| 1618 | #endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */ |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1619 | tprints("}"); |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1620 | } |
| 1621 | |
Denys Vlasenko | 3e759d4 | 2013-02-12 11:57:48 +0100 | [diff] [blame] | 1622 | struct msghdr32 { |
| 1623 | uint32_t /* void* */ msg_name; |
| 1624 | uint32_t /* socklen_t */msg_namelen; |
| 1625 | uint32_t /* iovec* */ msg_iov; |
| 1626 | uint32_t /* size_t */ msg_iovlen; |
| 1627 | uint32_t /* void* */ msg_control; |
| 1628 | uint32_t /* size_t */ msg_controllen; |
| 1629 | uint32_t /* int */ msg_flags; |
| 1630 | }; |
| 1631 | struct mmsghdr32 { |
| 1632 | struct msghdr32 msg_hdr; |
| 1633 | uint32_t /* unsigned */ msg_len; |
| 1634 | }; |
| 1635 | |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1636 | static void |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 1637 | printmsghdr(struct tcb *tcp, long addr, unsigned long data_size) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1638 | { |
| 1639 | struct msghdr msg; |
| 1640 | |
Denys Vlasenko | 3e759d4 | 2013-02-12 11:57:48 +0100 | [diff] [blame] | 1641 | #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 |
| 1642 | if (current_wordsize == 4) { |
| 1643 | struct msghdr32 msg32; |
| 1644 | |
| 1645 | if (umove(tcp, addr, &msg32) < 0) { |
| 1646 | tprintf("%#lx", addr); |
| 1647 | return; |
| 1648 | } |
| 1649 | msg.msg_name = (void*)(long)msg32.msg_name; |
| 1650 | msg.msg_namelen = msg32.msg_namelen; |
| 1651 | msg.msg_iov = (void*)(long)msg32.msg_iov; |
| 1652 | msg.msg_iovlen = msg32.msg_iovlen; |
| 1653 | msg.msg_control = (void*)(long)msg32.msg_control; |
| 1654 | msg.msg_controllen = msg32.msg_controllen; |
| 1655 | msg.msg_flags = msg32.msg_flags; |
| 1656 | } else |
| 1657 | #endif |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 1658 | if (umove(tcp, addr, &msg) < 0) { |
| 1659 | tprintf("%#lx", addr); |
| 1660 | return; |
| 1661 | } |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 1662 | do_msghdr(tcp, &msg, data_size); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1663 | } |
| 1664 | |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1665 | static void |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 1666 | printmmsghdr(struct tcb *tcp, long addr, unsigned int idx, unsigned long msg_len) |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1667 | { |
| 1668 | struct mmsghdr { |
| 1669 | struct msghdr msg_hdr; |
| 1670 | unsigned msg_len; |
| 1671 | } mmsg; |
| 1672 | |
Denys Vlasenko | 3e759d4 | 2013-02-12 11:57:48 +0100 | [diff] [blame] | 1673 | #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 |
| 1674 | if (current_wordsize == 4) { |
| 1675 | struct mmsghdr32 mmsg32; |
| 1676 | |
| 1677 | addr += sizeof(mmsg32) * idx; |
| 1678 | if (umove(tcp, addr, &mmsg32) < 0) { |
| 1679 | tprintf("%#lx", addr); |
| 1680 | return; |
| 1681 | } |
| 1682 | mmsg.msg_hdr.msg_name = (void*)(long)mmsg32.msg_hdr.msg_name; |
| 1683 | mmsg.msg_hdr.msg_namelen = mmsg32.msg_hdr.msg_namelen; |
| 1684 | mmsg.msg_hdr.msg_iov = (void*)(long)mmsg32.msg_hdr.msg_iov; |
| 1685 | mmsg.msg_hdr.msg_iovlen = mmsg32.msg_hdr.msg_iovlen; |
| 1686 | mmsg.msg_hdr.msg_control = (void*)(long)mmsg32.msg_hdr.msg_control; |
| 1687 | mmsg.msg_hdr.msg_controllen = mmsg32.msg_hdr.msg_controllen; |
| 1688 | mmsg.msg_hdr.msg_flags = mmsg32.msg_hdr.msg_flags; |
| 1689 | mmsg.msg_len = mmsg32.msg_len; |
| 1690 | } else |
| 1691 | #endif |
| 1692 | { |
| 1693 | addr += sizeof(mmsg) * idx; |
| 1694 | if (umove(tcp, addr, &mmsg) < 0) { |
| 1695 | tprintf("%#lx", addr); |
| 1696 | return; |
| 1697 | } |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1698 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1699 | tprints("{"); |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 1700 | do_msghdr(tcp, &mmsg.msg_hdr, msg_len ? msg_len : mmsg.msg_len); |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1701 | tprintf(", %u}", mmsg.msg_len); |
| 1702 | } |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 1703 | |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1704 | static void |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 1705 | decode_mmsg(struct tcb *tcp, unsigned long msg_len) |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1706 | { |
| 1707 | /* mmsgvec */ |
| 1708 | if (syserror(tcp)) { |
| 1709 | tprintf("%#lx", tcp->u_arg[1]); |
| 1710 | } else { |
| 1711 | unsigned int len = tcp->u_rval; |
| 1712 | unsigned int i; |
| 1713 | |
| 1714 | tprints("{"); |
| 1715 | for (i = 0; i < len; ++i) { |
| 1716 | if (i) |
| 1717 | tprints(", "); |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 1718 | printmmsghdr(tcp, tcp->u_arg[1], i, msg_len); |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1719 | } |
| 1720 | tprints("}"); |
| 1721 | } |
| 1722 | /* vlen */ |
| 1723 | tprintf(", %u, ", (unsigned int) tcp->u_arg[2]); |
| 1724 | /* flags */ |
| 1725 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
| 1726 | } |
| 1727 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1728 | #endif /* HAVE_SENDMSG */ |
| 1729 | |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 1730 | /* |
| 1731 | * low bits of the socket type define real socket type, |
| 1732 | * other bits are socket type flags. |
| 1733 | */ |
| 1734 | static void |
| 1735 | tprint_sock_type(struct tcb *tcp, int flags) |
| 1736 | { |
| 1737 | const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK); |
| 1738 | |
Denys Vlasenko | 7b609d5 | 2011-06-22 14:32:43 +0200 | [diff] [blame] | 1739 | if (str) { |
Denys Vlasenko | 5940e65 | 2011-09-01 09:55:05 +0200 | [diff] [blame] | 1740 | tprints(str); |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 1741 | flags &= ~SOCK_TYPE_MASK; |
| 1742 | if (!flags) |
| 1743 | return; |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1744 | tprints("|"); |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 1745 | } |
| 1746 | printflags(sock_type_flags, flags, "SOCK_???"); |
| 1747 | } |
| 1748 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1749 | int |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 1750 | sys_socket(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1751 | { |
| 1752 | if (entering(tcp)) { |
| 1753 | printxval(domains, tcp->u_arg[0], "PF_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1754 | tprints(", "); |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 1755 | tprint_sock_type(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1756 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1757 | switch (tcp->u_arg[0]) { |
| 1758 | case PF_INET: |
Roland McGrath | 8758e54 | 2003-06-23 23:39:59 +0000 | [diff] [blame] | 1759 | #ifdef PF_INET6 |
| 1760 | case PF_INET6: |
| 1761 | #endif |
Masatake YAMATO | 2394a3d | 2014-03-11 23:37:37 +0900 | [diff] [blame] | 1762 | printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1763 | break; |
| 1764 | #ifdef PF_IPX |
| 1765 | case PF_IPX: |
| 1766 | /* BTW: I don't believe this.. */ |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1767 | tprints("["); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1768 | printxval(domains, tcp->u_arg[2], "PF_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1769 | tprints("]"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1770 | break; |
| 1771 | #endif /* PF_IPX */ |
Masatake YAMATO | 2394a3d | 2014-03-11 23:37:37 +0900 | [diff] [blame] | 1772 | #ifdef PF_NETLINK |
| 1773 | case PF_NETLINK: |
| 1774 | printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); |
| 1775 | break; |
| 1776 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1777 | default: |
| 1778 | tprintf("%lu", tcp->u_arg[2]); |
| 1779 | break; |
| 1780 | } |
| 1781 | } |
| 1782 | return 0; |
| 1783 | } |
| 1784 | |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 1785 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1786 | sys_bind(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1787 | { |
| 1788 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1789 | printfd(tcp, tcp->u_arg[0]); |
| 1790 | tprints(", "); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1791 | printsock(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1792 | tprintf(", %lu", tcp->u_arg[2]); |
| 1793 | } |
| 1794 | return 0; |
| 1795 | } |
| 1796 | |
| 1797 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1798 | sys_connect(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1799 | { |
| 1800 | return sys_bind(tcp); |
| 1801 | } |
| 1802 | |
| 1803 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1804 | sys_listen(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1805 | { |
| 1806 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1807 | printfd(tcp, tcp->u_arg[0]); |
| 1808 | tprints(", "); |
| 1809 | tprintf("%lu", tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1810 | } |
| 1811 | return 0; |
| 1812 | } |
| 1813 | |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1814 | static int |
| 1815 | do_accept(struct tcb *tcp, int flags_arg) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1816 | { |
| 1817 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1818 | printfd(tcp, tcp->u_arg[0]); |
| 1819 | tprints(", "); |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1820 | return 0; |
| 1821 | } |
| 1822 | if (!tcp->u_arg[2]) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1823 | tprintf("%#lx, NULL", tcp->u_arg[1]); |
| 1824 | else { |
Dmitry V. Levin | 2fc6615 | 2009-01-01 22:47:51 +0000 | [diff] [blame] | 1825 | int len; |
| 1826 | if (tcp->u_arg[1] == 0 || syserror(tcp) |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1827 | || umove(tcp, tcp->u_arg[2], &len) < 0) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1828 | tprintf("%#lx", tcp->u_arg[1]); |
| 1829 | } else { |
Dmitry V. Levin | 2fc6615 | 2009-01-01 22:47:51 +0000 | [diff] [blame] | 1830 | printsock(tcp, tcp->u_arg[1], len); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1831 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1832 | tprints(", "); |
Dmitry V. Levin | 2fc6615 | 2009-01-01 22:47:51 +0000 | [diff] [blame] | 1833 | printnum_int(tcp, tcp->u_arg[2], "%u"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1834 | } |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1835 | if (flags_arg >= 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1836 | tprints(", "); |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1837 | printflags(sock_type_flags, tcp->u_arg[flags_arg], |
| 1838 | "SOCK_???"); |
| 1839 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1840 | return 0; |
| 1841 | } |
| 1842 | |
| 1843 | int |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1844 | sys_accept(struct tcb *tcp) |
| 1845 | { |
| 1846 | return do_accept(tcp, -1); |
| 1847 | } |
| 1848 | |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1849 | int |
| 1850 | sys_accept4(struct tcb *tcp) |
| 1851 | { |
| 1852 | return do_accept(tcp, 3); |
| 1853 | } |
Paolo Bonzini | 705ff10 | 2009-08-14 12:34:05 +0200 | [diff] [blame] | 1854 | |
| 1855 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1856 | sys_send(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1857 | { |
| 1858 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1859 | printfd(tcp, tcp->u_arg[0]); |
| 1860 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1861 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 1862 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 1863 | /* flags */ |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1864 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1865 | } |
| 1866 | return 0; |
| 1867 | } |
| 1868 | |
| 1869 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1870 | sys_sendto(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1871 | { |
| 1872 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1873 | printfd(tcp, tcp->u_arg[0]); |
| 1874 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1875 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 1876 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 1877 | /* flags */ |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1878 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1879 | /* to address */ |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1880 | tprints(", "); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1881 | printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1882 | /* to length */ |
| 1883 | tprintf(", %lu", tcp->u_arg[5]); |
| 1884 | } |
| 1885 | return 0; |
| 1886 | } |
| 1887 | |
| 1888 | #ifdef HAVE_SENDMSG |
| 1889 | |
| 1890 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1891 | sys_sendmsg(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1892 | { |
| 1893 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1894 | printfd(tcp, tcp->u_arg[0]); |
| 1895 | tprints(", "); |
Dmitry V. Levin | 043b5f8 | 2012-05-01 20:30:02 +0000 | [diff] [blame] | 1896 | printmsghdr(tcp, tcp->u_arg[1], (unsigned long) -1L); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1897 | /* flags */ |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1898 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1899 | printflags(msg_flags, tcp->u_arg[2], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1900 | } |
| 1901 | return 0; |
| 1902 | } |
| 1903 | |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1904 | int |
| 1905 | sys_sendmmsg(struct tcb *tcp) |
| 1906 | { |
| 1907 | if (entering(tcp)) { |
| 1908 | /* sockfd */ |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1909 | printfd(tcp, tcp->u_arg[0]); |
| 1910 | tprints(", "); |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1911 | if (!verbose(tcp)) { |
| 1912 | tprintf("%#lx, %u, ", |
| 1913 | tcp->u_arg[1], (unsigned int) tcp->u_arg[2]); |
| 1914 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
| 1915 | } |
| 1916 | } else { |
| 1917 | if (verbose(tcp)) |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 1918 | decode_mmsg(tcp, (unsigned long) -1L); |
Dmitry V. Levin | 7af9f35 | 2012-03-11 23:59:29 +0000 | [diff] [blame] | 1919 | } |
| 1920 | return 0; |
| 1921 | } |
| 1922 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1923 | #endif /* HAVE_SENDMSG */ |
| 1924 | |
| 1925 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1926 | sys_recv(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1927 | { |
| 1928 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1929 | printfd(tcp, tcp->u_arg[0]); |
| 1930 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1931 | } else { |
| 1932 | if (syserror(tcp)) |
| 1933 | tprintf("%#lx", tcp->u_arg[1]); |
| 1934 | else |
| 1935 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
| 1936 | |
| 1937 | tprintf(", %lu, ", tcp->u_arg[2]); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1938 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1939 | } |
| 1940 | return 0; |
| 1941 | } |
| 1942 | |
| 1943 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1944 | sys_recvfrom(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1945 | { |
| 1946 | int fromlen; |
| 1947 | |
| 1948 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1949 | printfd(tcp, tcp->u_arg[0]); |
| 1950 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1951 | } else { |
| 1952 | if (syserror(tcp)) { |
| 1953 | tprintf("%#lx, %lu, %lu, %#lx, %#lx", |
| 1954 | tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3], |
| 1955 | tcp->u_arg[4], tcp->u_arg[5]); |
| 1956 | return 0; |
| 1957 | } |
| 1958 | /* buf */ |
| 1959 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
| 1960 | /* len */ |
| 1961 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 1962 | /* flags */ |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1963 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1964 | /* from address, len */ |
| 1965 | if (!tcp->u_arg[4] || !tcp->u_arg[5]) { |
| 1966 | if (tcp->u_arg[4] == 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1967 | tprints(", NULL"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1968 | else |
| 1969 | tprintf(", %#lx", tcp->u_arg[4]); |
| 1970 | if (tcp->u_arg[5] == 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1971 | tprints(", NULL"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1972 | else |
| 1973 | tprintf(", %#lx", tcp->u_arg[5]); |
| 1974 | return 0; |
| 1975 | } |
| 1976 | if (umove(tcp, tcp->u_arg[5], &fromlen) < 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1977 | tprints(", {...}, [?]"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1978 | return 0; |
| 1979 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1980 | tprints(", "); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 1981 | printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1982 | /* from length */ |
| 1983 | tprintf(", [%u]", fromlen); |
| 1984 | } |
| 1985 | return 0; |
| 1986 | } |
| 1987 | |
| 1988 | #ifdef HAVE_SENDMSG |
| 1989 | |
| 1990 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1991 | sys_recvmsg(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1992 | { |
| 1993 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 1994 | printfd(tcp, tcp->u_arg[0]); |
| 1995 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1996 | } else { |
| 1997 | if (syserror(tcp) || !verbose(tcp)) |
| 1998 | tprintf("%#lx", tcp->u_arg[1]); |
| 1999 | else |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 2000 | printmsghdr(tcp, tcp->u_arg[1], tcp->u_rval); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2001 | /* flags */ |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2002 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 2003 | printflags(msg_flags, tcp->u_arg[2], "MSG_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2004 | } |
| 2005 | return 0; |
| 2006 | } |
| 2007 | |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 2008 | int |
| 2009 | sys_recvmmsg(struct tcb *tcp) |
| 2010 | { |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 2011 | /* +5 chars are for "left " prefix */ |
| 2012 | static char str[5 + TIMESPEC_TEXT_BUFSIZE]; |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2013 | |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 2014 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 2015 | printfd(tcp, tcp->u_arg[0]); |
| 2016 | tprints(", "); |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2017 | if (verbose(tcp)) { |
| 2018 | sprint_timespec(str, tcp, tcp->u_arg[4]); |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 2019 | /* Abusing tcp->auxstr as temp storage. |
| 2020 | * Will be used and freed on syscall exit. |
| 2021 | */ |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2022 | tcp->auxstr = strdup(str); |
| 2023 | } else { |
| 2024 | tprintf("%#lx, %ld, ", tcp->u_arg[1], tcp->u_arg[2]); |
| 2025 | printflags(msg_flags, tcp->u_arg[3], "MSG_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2026 | tprints(", "); |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2027 | print_timespec(tcp, tcp->u_arg[4]); |
| 2028 | } |
| 2029 | return 0; |
| 2030 | } else { |
| 2031 | if (verbose(tcp)) { |
Dmitry V. Levin | 5ea9765 | 2012-05-01 20:41:40 +0000 | [diff] [blame] | 2032 | decode_mmsg(tcp, 0); |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2033 | /* timeout on entrance */ |
| 2034 | tprintf(", %s", tcp->auxstr ? tcp->auxstr : "{...}"); |
| 2035 | free((void *) tcp->auxstr); |
| 2036 | tcp->auxstr = NULL; |
| 2037 | } |
| 2038 | if (syserror(tcp)) |
| 2039 | return 0; |
| 2040 | if (tcp->u_rval == 0) { |
| 2041 | tcp->auxstr = "Timeout"; |
| 2042 | return RVAL_STR; |
| 2043 | } |
| 2044 | if (!verbose(tcp)) |
| 2045 | return 0; |
| 2046 | /* timeout on exit */ |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 2047 | sprint_timespec(stpcpy(str, "left "), tcp, tcp->u_arg[4]); |
Dmitry V. Levin | e659103 | 2010-03-29 20:45:48 +0400 | [diff] [blame] | 2048 | tcp->auxstr = str; |
| 2049 | return RVAL_STR; |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 2050 | } |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 2051 | } |
Andreas Schwab | 0873f29 | 2010-02-12 21:39:12 +0100 | [diff] [blame] | 2052 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2053 | #endif /* HAVE_SENDMSG */ |
| 2054 | |
Sebastian Pipping | 9cd3850 | 2011-03-03 01:12:25 +0100 | [diff] [blame] | 2055 | static const struct xlat shutdown_modes[] = { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2056 | { 0, "SHUT_RD" }, |
| 2057 | { 1, "SHUT_WR" }, |
| 2058 | { 2, "SHUT_RDWR" }, |
Dmitry V. Levin | 5945273 | 2014-02-05 02:20:51 +0000 | [diff] [blame] | 2059 | XLAT_END |
Sebastian Pipping | 9cd3850 | 2011-03-03 01:12:25 +0100 | [diff] [blame] | 2060 | }; |
| 2061 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2062 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2063 | sys_shutdown(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2064 | { |
| 2065 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 2066 | printfd(tcp, tcp->u_arg[0]); |
| 2067 | tprints(", "); |
Sebastian Pipping | 9cd3850 | 2011-03-03 01:12:25 +0100 | [diff] [blame] | 2068 | printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2069 | } |
| 2070 | return 0; |
| 2071 | } |
| 2072 | |
| 2073 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2074 | sys_getsockname(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2075 | { |
| 2076 | return sys_accept(tcp); |
| 2077 | } |
| 2078 | |
| 2079 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2080 | sys_getpeername(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2081 | { |
| 2082 | return sys_accept(tcp); |
| 2083 | } |
| 2084 | |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2085 | static int |
| 2086 | do_pipe(struct tcb *tcp, int flags_arg) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2087 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2088 | if (exiting(tcp)) { |
| 2089 | if (syserror(tcp)) { |
| 2090 | tprintf("%#lx", tcp->u_arg[0]); |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2091 | } else { |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 2092 | #if !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64) |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2093 | int fds[2]; |
| 2094 | |
| 2095 | if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2096 | tprints("[...]"); |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2097 | else |
| 2098 | tprintf("[%u, %u]", fds[0], fds[1]); |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 2099 | #elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(IA64) |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2100 | tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp)); |
| 2101 | #else |
| 2102 | tprintf("%#lx", tcp->u_arg[0]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2103 | #endif |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2104 | } |
| 2105 | if (flags_arg >= 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2106 | tprints(", "); |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2107 | printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???"); |
| 2108 | } |
| 2109 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2110 | return 0; |
| 2111 | } |
| 2112 | |
| 2113 | int |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2114 | sys_pipe(struct tcb *tcp) |
| 2115 | { |
| 2116 | return do_pipe(tcp, -1); |
| 2117 | } |
| 2118 | |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2119 | int |
| 2120 | sys_pipe2(struct tcb *tcp) |
| 2121 | { |
| 2122 | return do_pipe(tcp, 1); |
| 2123 | } |
Dmitry V. Levin | 4371b10 | 2008-11-10 22:53:02 +0000 | [diff] [blame] | 2124 | |
| 2125 | int |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 2126 | sys_socketpair(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2127 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2128 | int fds[2]; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2129 | |
| 2130 | if (entering(tcp)) { |
| 2131 | printxval(domains, tcp->u_arg[0], "PF_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2132 | tprints(", "); |
Dmitry V. Levin | 8a550d7 | 2008-11-10 17:21:23 +0000 | [diff] [blame] | 2133 | tprint_sock_type(tcp, tcp->u_arg[1]); |
Dmitry V. Levin | 033fb91 | 2014-03-11 22:50:39 +0000 | [diff] [blame] | 2134 | tprintf(", %lu", tcp->u_arg[2]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2135 | } else { |
| 2136 | if (syserror(tcp)) { |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 2137 | tprintf(", %#lx", tcp->u_arg[3]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2138 | return 0; |
| 2139 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2140 | if (umoven(tcp, tcp->u_arg[3], sizeof fds, (char *) fds) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2141 | tprints(", [...]"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2142 | else |
| 2143 | tprintf(", [%u, %u]", fds[0], fds[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2144 | } |
| 2145 | return 0; |
| 2146 | } |
| 2147 | |
| 2148 | int |
Dmitry V. Levin | 3128919 | 2009-11-06 18:05:40 +0000 | [diff] [blame] | 2149 | sys_getsockopt(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2150 | { |
| 2151 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 2152 | printfd(tcp, tcp->u_arg[0]); |
| 2153 | tprints(", "); |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2154 | printxval(socketlayers, tcp->u_arg[1], "SOL_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2155 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2156 | switch (tcp->u_arg[1]) { |
| 2157 | case SOL_SOCKET: |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2158 | printxval(sockoptions, tcp->u_arg[2], "SO_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2159 | break; |
| 2160 | #ifdef SOL_IP |
| 2161 | case SOL_IP: |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2162 | printxval(sockipoptions, tcp->u_arg[2], "IP_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2163 | break; |
| 2164 | #endif |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 2165 | #ifdef SOL_IPV6 |
| 2166 | case SOL_IPV6: |
| 2167 | printxval(sockipv6options, tcp->u_arg[2], "IPV6_???"); |
| 2168 | break; |
| 2169 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2170 | #ifdef SOL_IPX |
| 2171 | case SOL_IPX: |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2172 | printxval(sockipxoptions, tcp->u_arg[2], "IPX_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2173 | break; |
| 2174 | #endif |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2175 | #ifdef SOL_PACKET |
| 2176 | case SOL_PACKET: |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2177 | printxval(sockpacketoptions, tcp->u_arg[2], "PACKET_???"); |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2178 | break; |
| 2179 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2180 | #ifdef SOL_TCP |
| 2181 | case SOL_TCP: |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2182 | printxval(socktcpoptions, tcp->u_arg[2], "TCP_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2183 | break; |
| 2184 | #endif |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 2185 | #ifdef SOL_SCTP |
| 2186 | case SOL_SCTP: |
| 2187 | printxval(socksctpoptions, tcp->u_arg[2], "SCTP_???"); |
| 2188 | break; |
| 2189 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2190 | |
| 2191 | /* SOL_AX25 SOL_ROSE SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25 |
| 2192 | * etc. still need work */ |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 2193 | default: |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2194 | tprintf("%lu", tcp->u_arg[2]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2195 | break; |
| 2196 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2197 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2198 | } else { |
Roland McGrath | fc544db | 2005-02-02 02:48:57 +0000 | [diff] [blame] | 2199 | int len; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2200 | if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &len) < 0) { |
Dmitry V. Levin | 3128919 | 2009-11-06 18:05:40 +0000 | [diff] [blame] | 2201 | tprintf("%#lx, %#lx", |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2202 | tcp->u_arg[3], tcp->u_arg[4]); |
| 2203 | return 0; |
| 2204 | } |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2205 | |
| 2206 | switch (tcp->u_arg[1]) { |
| 2207 | case SOL_SOCKET: |
| 2208 | switch (tcp->u_arg[2]) { |
| 2209 | #ifdef SO_LINGER |
| 2210 | case SO_LINGER: |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2211 | if (len == sizeof(struct linger)) { |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2212 | struct linger linger; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2213 | if (umove(tcp, |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2214 | tcp->u_arg[3], |
| 2215 | &linger) < 0) |
| 2216 | break; |
Dmitry V. Levin | 3128919 | 2009-11-06 18:05:40 +0000 | [diff] [blame] | 2217 | tprintf("{onoff=%d, linger=%d}, " |
Roland McGrath | 96ad7b8 | 2005-02-02 03:11:32 +0000 | [diff] [blame] | 2218 | "[%d]", |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2219 | linger.l_onoff, |
| 2220 | linger.l_linger, |
| 2221 | len); |
| 2222 | return 0; |
| 2223 | } |
| 2224 | break; |
| 2225 | #endif |
Dmitry V. Levin | 0ddd8ad | 2010-12-03 16:54:53 +0000 | [diff] [blame] | 2226 | #ifdef SO_PEERCRED |
| 2227 | case SO_PEERCRED: |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2228 | if (len == sizeof(struct ucred)) { |
Dmitry V. Levin | 0ddd8ad | 2010-12-03 16:54:53 +0000 | [diff] [blame] | 2229 | struct ucred uc; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2230 | if (umove(tcp, |
Dmitry V. Levin | 0ddd8ad | 2010-12-03 16:54:53 +0000 | [diff] [blame] | 2231 | tcp->u_arg[3], |
| 2232 | &uc) < 0) |
| 2233 | break; |
| 2234 | tprintf("{pid=%ld, uid=%ld, gid=%ld}, " |
| 2235 | "[%d]", |
| 2236 | (long)uc.pid, |
| 2237 | (long)uc.uid, |
| 2238 | (long)uc.gid, |
| 2239 | len); |
| 2240 | return 0; |
| 2241 | } |
| 2242 | break; |
| 2243 | #endif |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2244 | } |
| 2245 | break; |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 2246 | case SOL_PACKET: |
| 2247 | switch (tcp->u_arg[2]) { |
| 2248 | #ifdef PACKET_STATISTICS |
| 2249 | case PACKET_STATISTICS: |
| 2250 | if (len == sizeof(struct tpacket_stats)) { |
| 2251 | struct tpacket_stats stats; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2252 | if (umove(tcp, |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 2253 | tcp->u_arg[3], |
| 2254 | &stats) < 0) |
| 2255 | break; |
| 2256 | tprintf("{packets=%u, drops=%u}, " |
| 2257 | "[%d]", |
| 2258 | stats.tp_packets, |
| 2259 | stats.tp_drops, |
| 2260 | len); |
| 2261 | return 0; |
| 2262 | } |
| 2263 | break; |
| 2264 | #endif |
| 2265 | } |
| 2266 | break; |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2267 | } |
| 2268 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2269 | if (len == sizeof(int)) { |
Dmitry V. Levin | 3128919 | 2009-11-06 18:05:40 +0000 | [diff] [blame] | 2270 | printnum_int(tcp, tcp->u_arg[3], "%d"); |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2271 | } |
| 2272 | else { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2273 | printstr(tcp, tcp->u_arg[3], len); |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2274 | } |
Roland McGrath | fc544db | 2005-02-02 02:48:57 +0000 | [diff] [blame] | 2275 | tprintf(", [%d]", len); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2276 | } |
| 2277 | return 0; |
| 2278 | } |
| 2279 | |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2280 | #if defined(ICMP_FILTER) |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2281 | static void printicmpfilter(struct tcb *tcp, long addr) |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2282 | { |
| 2283 | struct icmp_filter filter; |
| 2284 | |
| 2285 | if (!addr) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2286 | tprints("NULL"); |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2287 | return; |
| 2288 | } |
| 2289 | if (syserror(tcp) || !verbose(tcp)) { |
| 2290 | tprintf("%#lx", addr); |
| 2291 | return; |
| 2292 | } |
| 2293 | if (umove(tcp, addr, &filter) < 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2294 | tprints("{...}"); |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2295 | return; |
| 2296 | } |
| 2297 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2298 | tprints("~("); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 2299 | printflags(icmpfilterflags, ~filter.data, "ICMP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2300 | tprints(")"); |
Wichert Akkerman | 7987cdf | 2000-07-05 16:05:39 +0000 | [diff] [blame] | 2301 | } |
| 2302 | #endif /* ICMP_FILTER */ |
| 2303 | |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2304 | static int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2305 | printsockopt(struct tcb *tcp, int level, int name, long addr, int len) |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2306 | { |
| 2307 | printxval(socketlayers, level, "SOL_??"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2308 | tprints(", "); |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2309 | switch (level) { |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2310 | case SOL_SOCKET: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2311 | printxval(sockoptions, name, "SO_???"); |
| 2312 | switch (name) { |
| 2313 | #if defined(SO_LINGER) |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2314 | case SO_LINGER: |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2315 | if (len == sizeof(struct linger)) { |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2316 | struct linger linger; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2317 | if (umove(tcp, addr, &linger) < 0) |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2318 | break; |
| 2319 | tprintf(", {onoff=%d, linger=%d}", |
| 2320 | linger.l_onoff, |
| 2321 | linger.l_linger); |
| 2322 | return 0; |
| 2323 | } |
| 2324 | break; |
| 2325 | #endif |
| 2326 | } |
| 2327 | break; |
| 2328 | #ifdef SOL_IP |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2329 | case SOL_IP: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2330 | printxval(sockipoptions, name, "IP_???"); |
| 2331 | break; |
| 2332 | #endif |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 2333 | #ifdef SOL_IPV6 |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2334 | case SOL_IPV6: |
Roland McGrath | 4f6ba69 | 2004-08-31 07:01:26 +0000 | [diff] [blame] | 2335 | printxval(sockipv6options, name, "IPV6_???"); |
| 2336 | break; |
| 2337 | #endif |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2338 | #ifdef SOL_IPX |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2339 | case SOL_IPX: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2340 | printxval(sockipxoptions, name, "IPX_???"); |
| 2341 | break; |
| 2342 | #endif |
| 2343 | #ifdef SOL_PACKET |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2344 | case SOL_PACKET: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2345 | printxval(sockpacketoptions, name, "PACKET_???"); |
| 2346 | /* TODO: decode packate_mreq for PACKET_*_MEMBERSHIP */ |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 2347 | switch (name) { |
| 2348 | #ifdef PACKET_RX_RING |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2349 | case PACKET_RX_RING: |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 2350 | #endif |
| 2351 | #ifdef PACKET_TX_RING |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2352 | case PACKET_TX_RING: |
Dmitry V. Levin | ca75bd6 | 2009-11-13 12:51:04 +0000 | [diff] [blame] | 2353 | #endif |
| 2354 | #if defined(PACKET_RX_RING) || defined(PACKET_TX_RING) |
| 2355 | if (len == sizeof(struct tpacket_req)) { |
| 2356 | struct tpacket_req req; |
| 2357 | if (umove(tcp, addr, &req) < 0) |
| 2358 | break; |
| 2359 | tprintf(", {block_size=%u, block_nr=%u, frame_size=%u, frame_nr=%u}", |
| 2360 | req.tp_block_size, |
| 2361 | req.tp_block_nr, |
| 2362 | req.tp_frame_size, |
| 2363 | req.tp_frame_nr); |
| 2364 | return 0; |
| 2365 | } |
| 2366 | break; |
| 2367 | #endif /* PACKET_RX_RING || PACKET_TX_RING */ |
| 2368 | } |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2369 | break; |
| 2370 | #endif |
| 2371 | #ifdef SOL_TCP |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2372 | case SOL_TCP: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2373 | printxval(socktcpoptions, name, "TCP_???"); |
| 2374 | break; |
| 2375 | #endif |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 2376 | #ifdef SOL_SCTP |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2377 | case SOL_SCTP: |
Holger Hans Peter Freyther | 7fea79b | 2011-01-14 11:08:12 +0100 | [diff] [blame] | 2378 | printxval(socksctpoptions, name, "SCTP_???"); |
| 2379 | break; |
| 2380 | #endif |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2381 | #ifdef SOL_RAW |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2382 | case SOL_RAW: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2383 | printxval(sockrawoptions, name, "RAW_???"); |
| 2384 | switch (name) { |
| 2385 | #if defined(ICMP_FILTER) |
Denys Vlasenko | b237b1b | 2012-02-27 13:56:59 +0100 | [diff] [blame] | 2386 | case ICMP_FILTER: |
| 2387 | tprints(", "); |
| 2388 | printicmpfilter(tcp, addr); |
| 2389 | return 0; |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2390 | #endif |
| 2391 | } |
| 2392 | break; |
| 2393 | #endif |
| 2394 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 2395 | /* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25 |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2396 | * etc. still need work */ |
| 2397 | |
Denys Vlasenko | 989ebc9 | 2012-03-17 04:42:07 +0100 | [diff] [blame] | 2398 | default: |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2399 | tprintf("%u", name); |
| 2400 | } |
| 2401 | |
| 2402 | /* default arg printing */ |
| 2403 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2404 | tprints(", "); |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 2405 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2406 | if (len == sizeof(int)) { |
| 2407 | printnum_int(tcp, addr, "%d"); |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2408 | } |
| 2409 | else { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2410 | printstr(tcp, addr, len); |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2411 | } |
| 2412 | return 0; |
| 2413 | } |
| 2414 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2415 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2416 | sys_setsockopt(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2417 | { |
| 2418 | if (entering(tcp)) { |
Philippe Ombredanne | 894c7e3 | 2014-02-01 09:57:45 -0800 | [diff] [blame] | 2419 | printfd(tcp, tcp->u_arg[0]); |
| 2420 | tprints(", "); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2421 | printsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 2422 | tcp->u_arg[3], tcp->u_arg[4]); |
John Hughes | 93f7fcc | 2002-05-22 15:46:49 +0000 | [diff] [blame] | 2423 | tprintf(", %lu", tcp->u_arg[4]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 2424 | } |
| 2425 | return 0; |
| 2426 | } |