net.c revision fa30618c22c58ca26d9cb89bd297197ed99cc30f
176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman/*
276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
57987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * All rights reserved.
776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *
876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * Redistribution and use in source and binary forms, with or without
976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * modification, are permitted provided that the following conditions
1076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * are met:
1176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * 1. Redistributions of source code must retain the above copyright
1276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *    notice, this list of conditions and the following disclaimer.
1376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * 2. Redistributions in binary form must reproduce the above copyright
1476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *    notice, this list of conditions and the following disclaimer in the
1576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *    documentation and/or other materials provided with the distribution.
1676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * 3. The name of the author may not be used to endorse or promote products
1776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *    derived from this software without specific prior written permission.
1876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *
1976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *
3076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman *	$Id$
3176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman */
3276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
3376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include "defs.h"
3476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
3576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <sys/stat.h>
3676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <sys/socket.h>
3776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <sys/un.h>
38f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman
39f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#if defined(HAVE_SIN6_SCOPE_ID_LINUX)
40f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define in6_addr in6_addr_libc
41f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define ipv6_mreq ipv6_mreq_libc
42f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define sockaddr_in6 sockaddr_in6_libc
43f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#endif
44f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman
4576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <netinet/in.h>
468c7122c9519dfd46ea7c8c026eab6f7aed74cf21Wichert Akkerman#ifdef HAVE_NETINET_TCP_H
47bf79f2e16b090ffe59cd1e1820935680a2da7b78Wichert Akkerman#include <netinet/tcp.h>
48bf79f2e16b090ffe59cd1e1820935680a2da7b78Wichert Akkerman#endif
498c7122c9519dfd46ea7c8c026eab6f7aed74cf21Wichert Akkerman#ifdef HAVE_NETINET_UDP_H
508c7122c9519dfd46ea7c8c026eab6f7aed74cf21Wichert Akkerman#include <netinet/udp.h>
518c7122c9519dfd46ea7c8c026eab6f7aed74cf21Wichert Akkerman#endif
5276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <arpa/inet.h>
53f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#include <net/if.h>
5476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if defined(LINUX)
5576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#include <asm/types.h>
5676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC__ + __GLIBC_MINOR__ >= 3)
5776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#  include <netipx/ipx.h>
5876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#else
5976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#  include <linux/ipx.h>
6076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
6176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* LINUX */
6276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
63f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#if defined (__GLIBC__) && (((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) || defined(HAVE_SIN6_SCOPE_ID_LINUX))
64f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#if defined(HAVE_LINUX_IN6_H)
65f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#if defined(HAVE_SIN6_SCOPE_ID_LINUX)
66f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef in6_addr
67f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef ipv6_mreq
68f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef sockaddr_in6
69f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define in6_addr in6_addr_kernel
70f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define ipv6_mreq ipv6_mreq_kernel
71f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define sockaddr_in6 sockaddr_in6_kernel
72f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#endif
73505e176ded6376a1283093b334c2c6deb47916e7Wichert Akkerman#include <linux/in6.h>
74f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#if defined(HAVE_SIN6_SCOPE_ID_LINUX)
75f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef in6_addr
76f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef ipv6_mreq
77f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#undef sockaddr_in6
78f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define in6_addr in6_addr_libc
79f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define ipv6_mreq ipv6_mreq_libc
80f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#define sockaddr_in6 sockaddr_in6_kernel
81f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#endif
82505e176ded6376a1283093b334c2c6deb47916e7Wichert Akkerman#endif
832f473da12babff710bbe37c7f95be01fd00118f9Wichert Akkerman#endif
84505e176ded6376a1283093b334c2c6deb47916e7Wichert Akkerman
85f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#if defined(HAVE_SYS_UIO_H)
86f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#include <sys/uio.h>
87f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
88f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
89f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#if defined(HAVE_LINUX_NETLINK_H)
90f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#include <linux/netlink.h>
91f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
92f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
93f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#if defined(HAVE_LINUX_IF_PACKET_H)
94f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#include <linux/if_packet.h>
95f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
96f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
977987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(HAVE_LINUX_ICMP_H)
987987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#include <linux/icmp.h>
997987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
1007987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
10176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifndef PF_UNSPEC
10276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define PF_UNSPEC AF_UNSPEC
10376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
10476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
10516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#if UNIXWARE >= 7
10616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#define HAVE_SENDMSG		1		/* HACK - *FIXME* */
10716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#endif
10816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
10976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef LINUX
11076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman/* Under Linux these are enums so we can't test for them with ifdef. */
11176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_EGP IPPROTO_EGP
11276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_PUP IPPROTO_PUP
11376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_IDP IPPROTO_IDP
11476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_IGMP IPPROTO_IGMP
11576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_RAW IPPROTO_RAW
11676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#define IPPROTO_MAX IPPROTO_MAX
11776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
11876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
11976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat domains[] = {
12076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_UNSPEC,	"PF_UNSPEC"	},
12176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_UNIX,	"PF_UNIX"	},
12276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_INET,	"PF_INET"	},
123f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_NETLINK
124f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ PF_NETLINK,	"PF_NETLINK"	},
125f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
126f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_PACKET
127f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ PF_PACKET,	"PF_PACKET"	},
128f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
129f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_INET6
130f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ PF_INET6,	"PF_INET6"	},
131f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
132f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_ATMSVC
133f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ PF_ATMSVC,	"PF_INET6"	},
134f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
135f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_INET6
136f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ PF_INET6,	"PF_INET6"	},
137f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
13876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_LOCAL
13976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_LOCAL,	"PS_LOCAL"	},
14076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
14176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_ISO
14276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_ISO,	"PF_ISO"	},
14376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
14476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_AX25
14576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_AX25,	"PF_AX25"	},
14676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
14776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_IPX
14876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_IPX,	"PF_IPX"	},
14976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
15076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_APPLETALK
15176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_APPLETALK,	"PF_APPLETALK"	},
15276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
15376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_NETROM
15476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_NETROM,	"PF_NETROM"	},
15576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
15676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_BRIDGE
15776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_BRIDGE,	"PF_BRIDGE"	},
15876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
15976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_AAL5
16076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_AAL5,	"PF_AAL5"	},
16176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
16276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_X25
16376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_X25,	"PF_X25"	},
16476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
16576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_ROSE
16676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_ROSE,	"PF_ROSE"	},
16776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
16876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_DECNET
16976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_DECNET,	"PF_DECNET"	},
17076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
17176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_NETBEUI
17276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_NETBEUI,	"PF_NETBEUI"	},
17376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
17476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_IMPLINK
17576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ PF_IMPLINK,	"PF_IMPLINK"	},
17676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
17776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,		NULL		},
17876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
179f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanstatic struct xlat addrfams[] = {
180f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_UNSPEC,	"AF_UNSPEC"	},
181f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_UNIX,	"AF_UNIX"	},
182f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_INET,	"AF_INET"	},
183e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#ifdef AF_INET6
184f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_INET6,	"AF_INET6"	},
185e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#endif
186f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_DECnet,	"AF_DECnet"	},
187f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef PF_ATMSVC
188f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_ATMSVC,	"AF_ATMSVC"	},
189f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
190e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#ifdef AF_PACKET
191f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_PACKET,	"AF_PACKET"	},
192e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#endif
193e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#ifdef AF_NETLINK
194f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_NETLINK,	"AF_NETLINK"	},
195e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#endif
196e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#ifdef AF_ISO
197f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_ISO,	"AF_ISO"	},
198f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
199e4aafd4c4d5ecd3317419d1681ef5804dbf1333eWichert Akkerman#ifdef AF_IMPLINK
200f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ AF_IMPLINK,	"AF_IMPLINK"	},
201f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
202f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ 0,		NULL		},
203f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman};
20476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat socktypes[] = {
20576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_STREAM,	"SOCK_STREAM"	},
20676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_DGRAM,	"SOCK_DGRAM"	},
20776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOCK_RAW
20876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_RAW,	"SOCK_RAW"	},
20976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
21076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOCK_SEQPACKET
21176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_SEQPACKET,"SOCK_SEQPACKET"},
21276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
21376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOCK_RDM
21476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_RDM,	"SOCK_RDM"	},
21576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
21676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOCK_PACKET
21776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SOCK_PACKET,	"SOCK_PACKET"	},
21876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
21976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,		NULL		},
22076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
221efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkermanstatic struct xlat socketlayers[] = {
222efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_IP,	"SOL_IP"	},
223efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_ICMP)
224efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_ICMP,	"SOL_ICMP"	},
225efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
226efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_TCP,	"SOL_TCP"	},
227efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_UDP,	"SOL_UDP"	},
228efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_IPV6)
229efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_IPV6,	"SOL_IPV6"	},
230efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
231efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_ICMPV6)
232efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_ICMPV6,	"SOL_ICMPV6"	},
233efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
234efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_RAW)
235efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_RAW,	"SOL_RAW"	},
236efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
237efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_IPX)
238efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_IPX,	"SOL_IPX"	},
239efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
240efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_IPX)
241efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_IPX,	"SOL_IPX"	},
242efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
243efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_AX25)
244efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_AX25,	"SOL_AX25"	},
245efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
246efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_ATALK)
247efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_ATALK,	"SOL_ATALK"	},
248efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
249efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_NETROM)
250efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_NETROM,	"SOL_NETROM"	},
251efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
252efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_ROSE)
253efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_ROSE,	"SOL_ROSE"	},
254efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
255efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_DECNET)
256efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_DECNET,	"SOL_DECNET"	},
257efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
258efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_X25)
259efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_X25,	"SOL_X25"	},
260efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
261efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_PACKET)
262efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_PACKET,	"SOL_PACKET"	},
263efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
264efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_ATM)
265efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_ATM,	"SOL_ATM"	},
266efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
267efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_AAL)
268efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_AAL,	"SOL_AAL"	},
269efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
270efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#if defined(SOL_IRDA)
271efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman	{ SOL_IRDA,	"SOL_IRDA"	},
272efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman#endif
273efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman};
27476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat protocols[] = {
27576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_IP,	"IPPROTO_IP"	},
27676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_ICMP,	"IPPROTO_ICMP"	},
27776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_TCP,	"IPPROTO_TCP"	},
27876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_UDP,	"IPPROTO_UDP"	},
27976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_GGP
28076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_GGP,	"IPPROTO_GGP"	},
28176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
28276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_EGP
28376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_EGP,	"IPPROTO_EGP"	},
28476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
28576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_PUP
28676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_PUP,	"IPPROTO_PUP"	},
28776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
28876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_IDP
28976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_IDP,	"IPPROTO_IDP"	},
29076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
29176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_IPV6
29276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_IPV6,	"IPPROTO_IPV6"	},
29376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
29476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_ICMPV6
29576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_ICMPV6,"IPPROTO_ICMPV6"},
29676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
29776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_IGMP
29876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_IGMP,	"IPPROTO_IGMP"	},
29976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
30076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_HELLO
30176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_HELLO,"IPPROTO_HELLO"	},
30276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
30376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_ND
30476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_ND,	"IPPROTO_ND"	},
30576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
30676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_RAW
30776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_RAW,	"IPPROTO_RAW"	},
30876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
30976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_MAX
31076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_MAX,	"IPPROTO_MAX"	},
31176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
31276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef IPPROTO_IPIP
31376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPPROTO_IPIP,	"IPPROTO_IPIP"	},
31476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
31576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,		NULL		},
31676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
31776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat msg_flags[] = {
31876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_OOB,	"MSG_OOB"	},
31976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_DONTROUTE
32076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_DONTROUTE,"MSG_DONTROUTE"	},
32176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
32276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_PEEK
32376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_PEEK,	"MSG_PEEK"	},
32476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
32576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_CTRUNC
32676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_CTRUNC,	"MSG_CTRUNC"	},
32776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
32876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_PROXY
32976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_PROXY,	"MSG_PROXY"	},
33076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
33176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_EOR
33276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_EOR,	"MSG_EOR"	},
33376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
33476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef MSG_WAITALL
33576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ MSG_WAITALL,	"MSG_WAITALL"	},
33676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
337f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_TRUNC
338f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_TRUNC,	"MSG_TRUNC"	},
339f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
340f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_CTRUNC
341f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_CTRUNC,	"MSG_CTRUNC"	},
342f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
343f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_ERRQUEUE
344f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_ERRQUEUE,	"MSG_ERRQUEUE"	},
345f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
346f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_DONTWAIT
347f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_DONTWAIT,	"MSG_DONTWAIT"	},
348f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
349f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_CONFIRM
350f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_CONFIRM,	"MSG_CONFIRM"	},
351f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
352f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef MSG_PROBE
353f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ MSG_PROBE,	"MSG_PROBE"	},
354f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
35576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,		NULL		},
35676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
35776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
35876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat sockoptions[] = {
359f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef SO_PEERCRED
360f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ SO_PEERCRED,	"SO_PEERCRED"	},
361f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
362f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef SO_PASSCRED
363f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	{ SO_PASSCRED,	"SO_PASSCRED"	},
364f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
36576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_DEBUG
36676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_DEBUG,	"SO_DEBUG"	},
36776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
36876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_REUSEADDR
36976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_REUSEADDR,	"SO_REUSEADDR"	},
37076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
37176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_KEEPALIVE
37276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_KEEPALIVE,	"SO_KEEPALIVE"	},
37376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
37476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_DONTROUTE
37576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_DONTROUTE,	"SO_DONTROUTE"	},
37676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
37776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_BROADCAST
37876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_BROADCAST,	"SO_BROADCAST"	},
37976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
38076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_LINGER
38176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_LINGER,	"SO_LINGER"	},
38276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
38376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_OOBINLINE
38476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_OOBINLINE,	"SO_OOBINLINE"	},
38576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
38676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_TYPE
38776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_TYPE,	"SO_TYPE"	},
38876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
38976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_ERROR
39076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_ERROR,	"SO_ERROR"	},
39176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
39276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_SNDBUF
39376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_SNDBUF,	"SO_SNDBUF"	},
39476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
39576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_RCVBUF
39676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_RCVBUF,	"SO_RCVBUF"	},
39776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
39876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_NO_CHECK
39976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_NO_CHECK,	"SO_NO_CHECK"	},
40076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
40176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_PRIORITY
40276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_PRIORITY,	"SO_PRIORITY"	},
40376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
40476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_ACCEPTCONN
40576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_ACCEPTCONN,"SO_ACCEPTCONN"	},
40676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
40776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_USELOOPBACK
40876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_USELOOPBACK,"SO_USELOOPBACK"},
40976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
41076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_SNDLOWAT
41176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_SNDLOWAT,	"SO_SNDLOWAT"	},
41276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
41376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_RCVLOWAT
41476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_RCVLOWAT,	"SO_RCVLOWAT"	},
41576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
41676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_SNDTIMEO
41776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_SNDTIMEO,	"SO_SNDTIMEO"	},
41876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
41976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_RCVTIMEO
42076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_RCVTIMEO,	"SO_RCVTIMEO"	},
42176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
42276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_BSDCOMPAT
42376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_BSDCOMPAT,	"SO_BSDCOMPAT"	},
42476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
42576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_REUSEPORT
42676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_REUSEPORT,	"SO_REUSEPORT"	},
42776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
42876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_RCVLOWAT
42976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_RCVLOWAT, "SO_RCVLOWAT"	},
43076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
43176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_SNDLOWAT
43276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_SNDLOWAT, "SO_SNDLOWAT"	},
43376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
43476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_RCVTIMEO
43576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_RCVTIMEO, "SO_RCVTIMEO"	},
43676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
43776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SO_SNDTIMEO
43876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ SO_SNDTIMEO, "SO_SNDTIMEO"	},
43976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
44076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,		NULL		},
44176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
44276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
44376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IP
44476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat sockipoptions[] = {
4457987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_TOS,		"IP_TOS"		},
4467987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_TTL,		"IP_TTL"		},
44776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if defined(IP_HDRINCL)
4487987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_HDRINCL,		"IP_HDRINCL"		},
44976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
45076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if defined(IP_OPTIONS)
4517987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_OPTIONS,		"IP_OPTIONS"		},
4527987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
4537987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_ROUTER_ALERT,	"IP_ROUTER_ALERT"	},
4547987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(IP_RECVOPTIONS)
4557987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_RECVOPTIONS,	"IP_RECVOPTIONS"	},
4567987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
4577987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_RETOPTS,		"IP_RETOPTS"		},
4587987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_PKTINFO,		"IP_PKTINFO"		},
4597987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_PKTOPTIONS,	"IP_PKTOPTIONS"	},
4607987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MTU_DISCOVER,	"IP_MTU_DISCOVER"	},
4617987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MTU_DISCOVER,	"IP_MTU_DISCOVER"	},
4627987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_RECVERR,		"IP_RECVERR"		},
4637987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_RECVTTL,		"IP_RECRECVTTL"		},
4647987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_RECVTOS,		"IP_RECRECVTOS"		},
4657987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(IP_MTU)
4667987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MTU,		"IP_MTU"		},
4677987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
4687987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MULTICAST_IF,	"IP_MULTICAST_IF"	},
4697987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MULTICAST_TTL,	"IP_MULTICAST_TTL"	},
4707987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_MULTICAST_LOOP,	"IP_MULTICAST_LOOP"	},
4717987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_ADD_MEMBERSHIP,	"IP_ADD_MEMBERSHIP"	},
4727987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ IP_DROP_MEMBERSHIP,	"IP_DROP_MEMBERSHIP"	},
4737987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ 0,			NULL			},
47476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
47576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* SOL_IP */
47676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
47776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IPX
47876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat sockipxoptions[] = {
47976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ IPX_TYPE,     "IPX_TYPE"      },
48076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	{ 0,            NULL            },
48176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
48276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* SOL_IPX */
48376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
4847987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_RAW
4857987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanstatic struct xlat sockrawoptions[] = {
4867987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_FILTER)
4877987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ ICMP_FILTER,		"ICMP_FILTER"	},
4887987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
4897987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ 0,			NULL		},
4907987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman};
4917987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif /* SOL_RAW */
4927987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
4937987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_PACKET
4947987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanstatic struct xlat sockpacketoptions[] = {
4957987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
4967987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
4977987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(PACKET_RECV_OUTPUT)
4987987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
4997987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5007987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(PACKET_RX_RING)
5017987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ PACKET_RX_RING,		"PACKET_RX_RING"	},
5027987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5037987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(PACKET_STATISTICS)
5047987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ PACKET_STATISTICS,		"PACKET_STATISTICS"	},
5057987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5067987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ 0,				NULL			},
5077987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman};
5087987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif /* SOL_PACKET */
5097987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
51076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_TCP
51176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic struct xlat socktcpoptions[] = {
5127987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ TCP_NODELAY,	"TCP_NODELAY"	},
5137987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ TCP_MAXSEG,	"TCP_MAXSEG"	},
5147987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(TCP_CORK)
5157987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ TCP_CORK,	"TCP_CORK"	},
5167987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5177987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ 0,		NULL		},
51876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman};
51976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* SOL_TCP */
52076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
5217987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_RAW
5227987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanstatic struct xlat icmpfilterflags[] = {
5237987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_ECHOREPLY)
5247987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_ECHOREPLY),		"ICMP_ECHOREPLY"	},
5257987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5267987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_DEST_UNREACH)
5277987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_DEST_UNREACH),	"ICMP_DEST_UNREACH"	},
5287987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5297987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_SOURCE_QUENCH)
5307987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_SOURCE_QUENCH),	"ICMP_SOURCE_QUENCH"	},
5317987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5327987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_REDIRECT)
5337987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_REDIRECT),		"ICMP_REDIRECT"		},
5347987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5357987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_ECHO)
5367987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_ECHO),		"ICMP_ECHO"		},
5377987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5387987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_TIME_EXCEEDED)
5397987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_TIME_EXCEEDED),	"ICMP_TIME_EXCEEDED"	},
5407987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5417987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_PARAMETERPROB)
5427987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_PARAMETERPROB),	"ICMP_PARAMETERPROB"	},
5437987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5447987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_TIMESTAMP)
5457987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_TIMESTAMP),		"ICMP_TIMESTAMP"	},
5467987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5477987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_TIMESTAMPREPLY)
5487987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_TIMESTAMPREPLY),	"ICMP_TIMESTAMPREPLY"	},
5497987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5507987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_INFO_REQUEST)
5517987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_INFO_REQUEST),	"ICMP_INFO_REQUEST"	},
5527987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5537987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_INFO_REPLY)
5547987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_INFO_REPLY),		"ICMP_INFO_REPLY"	},
5557987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5567987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_ADDRESS)
5577987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_ADDRESS),		"ICMP_ADDRESS"		},
5587987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5597987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_ADDRESSREPLY)
5607987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ (1<<ICMP_ADDRESSREPLY),	"ICMP_ADDRESSREPLY"	},
5617987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
5627987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	{ 0,				NULL			},
5637987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman};
5647987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif /* SOL_RAW */
5657987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
56616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
56776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanvoid
568f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanprintsock(tcp, addr, addrlen)
56976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
57076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanlong addr;
571f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanint addrlen;
57276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
573f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	union {
574f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		char pad[128];
575f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr sa;
576f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_in sin;
577f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_un sau;
5789ce1a63eb20b069607c06f9645ac5a17b418a5f3Wichert Akkerman#ifdef HAVE_INET_NTOP
579f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_in6 sa6;
5809ce1a63eb20b069607c06f9645ac5a17b418a5f3Wichert Akkerman#endif
581f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#if defined(LINUX) && defined(AF_IPX)
582f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_ipx sipx;
583f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
584f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef AF_PACKET
585f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_ll ll;
58676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
587f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef AF_NETLINK
588f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		struct sockaddr_nl nl;
589f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif
590f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	} addrbuf;
591f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	char string_addr[100];
59276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
59376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (addr == 0) {
59476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("NULL");
59576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		return;
59676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
59776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (!verbose(tcp)) {
59876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%#lx", addr);
59976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		return;
60076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
601f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if ((addrlen<2) || (addrlen>sizeof(addrbuf)))
602f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		addrlen=sizeof(addrbuf);
603f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
604f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if (umoven(tcp, addr, addrlen, (char*)&addrbuf) < 0) {
60576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("{...}");
60676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		return;
60776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
608f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
609f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf("{sin_family=");
610f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	printxval(addrfams, addrbuf.sa.sa_family, "AF_???");
611f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf(", ");
612f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
613f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	switch (addrbuf.sa.sa_family) {
61476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	case AF_UNIX:
615f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		if (addrlen==2) {
616f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf("<nil>");
617f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		} else if (addrbuf.sau.sun_path[0]) {
618fa30618c22c58ca26d9cb89bd297197ed99cc30fWichert Akkerman			tprintf("path=\"%-.*s\"", addrlen-2, addrbuf.sau.sun_path);
619f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		} else {
620fa30618c22c58ca26d9cb89bd297197ed99cc30fWichert Akkerman			tprintf("path=@%-.*s", addrlen-3, addrbuf.sau.sun_path+1);
621f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		}
62276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		break;
62376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	case AF_INET:
62476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}",
625f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			ntohs(addrbuf.sin.sin_port), inet_ntoa(addrbuf.sin.sin_addr));
62676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		break;
6279ce1a63eb20b069607c06f9645ac5a17b418a5f3Wichert Akkerman#ifdef HAVE_INET_NTOP
6289ce1a63eb20b069607c06f9645ac5a17b418a5f3Wichert Akkerman	case AF_INET6:
629f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		inet_ntop(AF_INET6, &addrbuf.sa6.sin6_addr, string_addr, sizeof(string_addr));
630f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=%u",
631f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman				ntohs(addrbuf.sa6.sin6_port), string_addr,
632f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman				addrbuf.sa6.sin6_flowinfo);
633f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#ifdef HAVE_SIN6_SCOPE_ID
634f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		{
635f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#if defined(HAVE_IF_INDEXTONAME) && defined(IN6_IS_ADDR_LINKLOCAL) && defined(IN6_IS_ADDR_MC_LINKLOCAL)
636f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		    int numericscope = 0;
637f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		    if (IN6_IS_ADDR_LINKLOCAL (&addrbuf.sa6.sin6_addr)
638f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			    || IN6_IS_ADDR_MC_LINKLOCAL (&addrbuf.sa6.sin6_addr)) {
639f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			char scopebuf[IFNAMSIZ + 1];
640f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman
641f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			if (if_indextoname (addrbuf.sa6.sin6_scope_id, scopebuf) == NULL)
642f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			    numericscope++;
643f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			else
644f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			    tprintf(", sin6_scope_id=if_nametoindex(\"%s\")", scopebuf);
645f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		    } else
646f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			numericscope++;
647f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman
648f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		    if (numericscope)
649f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#endif
650f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman			tprintf(", sin6_scope_id=%u", addrbuf.sa6.sin6_scope_id);
651f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		}
652f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman#endif
653f185065a405794eaf6abc0dcf8345d9e6aa882f7Wichert Akkerman		    break;
6549ce1a63eb20b069607c06f9645ac5a17b418a5f3Wichert Akkerman#endif
655dbb440e5ae5d1a6be4eeda28088e8dfc9b195bacWichert Akkerman#if defined(AF_IPX) && defined(linux)
65676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	case AF_IPX:
657f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		{
65876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			int i;
65976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("{sipx_port=htons(%u), ",
660f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					ntohs(addrbuf.sipx.sipx_port));
66176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			/* Yes, I know, this does not look too
66276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			 * strace-ish, but otherwise the IPX
66376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			 * addresses just look monstrous...
66476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			 * Anyways, feel free if you don't like
66576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			 * this way.. :)
66676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			 */
667f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf("%08lx:", (unsigned long)ntohl(addrbuf.sipx.sipx_network));
66876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			for (i = 0; i<IPX_NODE_LEN; i++)
669f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman				tprintf("%02x", addrbuf.sipx.sipx_node[i]);
670f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf("/[%02x]", addrbuf.sipx.sipx_type);
671f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		}
672f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		break;
673f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif /* AF_IPX && linux */
674f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef AF_PACKET
675f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	case AF_PACKET:
676f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		{
677f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			int i;
678f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf("proto=%#04x, if%d, pkttype=%d, addr(%d)={%d, ",
679f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					ntohs(addrbuf.ll.sll_protocol),
680f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					addrbuf.ll.sll_ifindex,
681f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					addrbuf.ll.sll_pkttype,
682f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					addrbuf.ll.sll_halen,
683f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					addrbuf.ll.sll_hatype);
684f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			for (i=0; i<addrbuf.ll.sll_addr[i]; i++)
685f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman				tprintf("%02x", addrbuf.ll.sll_addr[i]);
68676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
68776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		break;
688f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
689f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif /* AF_APACKET */
690f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#ifdef AF_NETLINLK
691f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	case AF_NETLINK:
692f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("pid=%d, groups=%08x", addrbuf.nl.nl_pid, addrbuf.nl.nl_groups);
693f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		break;
694f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman#endif /* AF_NETLINK */
69576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	/* AF_AX25 AF_APPLETALK AF_NETROM AF_BRIDGE AF_AAL5
696f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	AF_X25 AF_ROSE etc. still need to be done */
69776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
69876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	default:
699f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("{sa_family=%u, sa_data=", addrbuf.sa.sa_family);
70076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data,
701f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			sizeof addrbuf.sa.sa_data);
70276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		break;
70376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
704f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf("}");
70576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
70676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
70776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if HAVE_SENDMSG
70876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
70976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstatic void
710f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanprintiovec(tcp, iovec, len)
711f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanstruct tcb *tcp;
712f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanstruct iovec *iovec;
713f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanlong   len;
714f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman{
715f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	struct iovec *iov;
716f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	int i;
717f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
718f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	iov = (struct iovec *) malloc(len * sizeof *iov);
719f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if (iov == NULL) {
720f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		fprintf(stderr, "No memory");
721f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		return;
722f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	}
723f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if (umoven(tcp, (long)iovec,
724f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman				len * sizeof *iov, (char *) iov) < 0) {
725f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("%#lx", (unsigned long)iovec);
726f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	} else {
727f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("[");
728f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		for (i = 0; i < len; i++) {
729f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			if (i)
730f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman				tprintf(", ");
731f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf("{");
732f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			printstr(tcp, (long) iov[i].iov_base,
733f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman					iov[i].iov_len);
734f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf(", %lu}", (unsigned long)iov[i].iov_len);
735f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		}
736f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("]");
737f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	}
738f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	free((char *) iov);
739f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman}
740f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
741f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkermanstatic void
74276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanprintmsghdr(tcp, addr)
74376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
74476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanlong addr;
74576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
74676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	struct msghdr msg;
74776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
7482e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman	if (umove(tcp, addr, &msg) < 0) {
7492e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman		tprintf("%#lx", addr);
7502e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman		return;
7512e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman	}
752f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf("{msg_name(%d)=", msg.msg_namelen);
753f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	printsock(tcp, (long)msg.msg_name, msg.msg_namelen);
754f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
755f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf(", msg_iov(%lu)=", (unsigned long)msg.msg_iovlen);
756f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	printiovec(tcp, msg.msg_iov, msg.msg_iovlen);
757f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman
75876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef HAVE_MSG_CONTROL
759f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf(", msg_controllen=%lu", (unsigned long)msg.msg_controllen);
760f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if (msg.msg_controllen)
761f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf(", msg_control=%#lx, ", (unsigned long) msg.msg_control);
762f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf(", msg_flags=");
763f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	if (printflags(msg_flags, msg.msg_flags)==0)
764f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		tprintf("0");
76576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#else /* !HAVE_MSG_CONTROL */
766f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf("msg_accrights=%#lx, msg_accrightslen=%u",
76776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		(unsigned long) msg.msg_accrights, msg.msg_accrightslen);
76876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* !HAVE_MSG_CONTROL */
769f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman	tprintf("}");
77076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
77176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
77276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* HAVE_SENDMSG */
77376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
77476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
77576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_socket(tcp)
77676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
77776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
77876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
77976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printxval(domains, tcp->u_arg[0], "PF_???");
78076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
78176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printxval(socktypes, tcp->u_arg[1], "SOCK_???");
78276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
78376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		switch (tcp->u_arg[0]) {
78476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case PF_INET:
78576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(protocols, tcp->u_arg[2], "IPPROTO_???");
78676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
78776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_IPX
78876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case PF_IPX:
78976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			/* BTW: I don't believe this.. */
79076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("[");
79176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(domains, tcp->u_arg[2], "PF_???");
79276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("]");
79376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
79476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* PF_IPX */
79576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		default:
79676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%lu", tcp->u_arg[2]);
79776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
79876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
79976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
80076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
80176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
80276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
80376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
80476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_bind(tcp)
80576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
80676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
80776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
80876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
809f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		printsock(tcp, tcp->u_arg[1], tcp->u_arg[2]);
81076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu", tcp->u_arg[2]);
81176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
81276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
81376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
81476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
81576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
81676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_connect(tcp)
81776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
81876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
81976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return sys_bind(tcp);
82076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
82176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
82276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
82376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_listen(tcp)
82476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
82576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
82676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
82776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
82876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
82976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
83076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
83176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
83276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
83376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_accept(tcp)
83476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
83576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
83676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
83776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
83876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else if (!tcp->u_arg[2])
83976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%#lx, NULL", tcp->u_arg[1]);
84076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	else {
84176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (tcp->u_arg[1] == 0 || syserror(tcp)) {
84276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx", tcp->u_arg[1]);
84376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		} else {
844f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			printsock(tcp, tcp->u_arg[1], tcp->u_arg[2]);
84576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
84676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
84776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printnum(tcp, tcp->u_arg[2], "%lu");
84876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
84976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
85076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
85176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
85276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
85376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_send(tcp)
85476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
85576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
85676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
85776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
85876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
85976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu, ", tcp->u_arg[2]);
86076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* flags */
86176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[3]) == 0)
86276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
86376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
86476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
86576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
86676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
86776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
86876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_sendto(tcp)
86976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
87076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
87176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
87276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
87376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
87476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu, ", tcp->u_arg[2]);
87576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* flags */
87676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[3]) == 0)
87776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
87876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* to address */
87976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
880f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
88176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* to length */
88276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu", tcp->u_arg[5]);
88376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
88476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
88576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
88676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
88776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef HAVE_SENDMSG
88876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
88976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
89076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_sendmsg(tcp)
89176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
89276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
89376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
89476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
89576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printmsghdr(tcp, tcp->u_arg[1]);
89676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* flags */
89776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
89876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[2]) == 0)
89976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
90076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
90176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
90276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
90376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
90476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* HAVE_SENDMSG */
90576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
90676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
90776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_recv(tcp)
90876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
90976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
91076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
91176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
91276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else {
91376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp))
91476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx", tcp->u_arg[1]);
91576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		else
91676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printstr(tcp, tcp->u_arg[1], tcp->u_rval);
91776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
91876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu, ", tcp->u_arg[2]);
91976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[3]) == 0)
92076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
92176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
92276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
92376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
92476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
92576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
92676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_recvfrom(tcp)
92776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
92876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
92976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	int fromlen;
93076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
93176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
93276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
93376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else {
93476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp)) {
93576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx, %lu, %lu, %#lx, %#lx",
93676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3],
93776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tcp->u_arg[4], tcp->u_arg[5]);
93876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
93976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
94076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* buf */
94176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printstr(tcp, tcp->u_arg[1], tcp->u_rval);
94276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* len */
94376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", %lu, ", tcp->u_arg[2]);
94476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* flags */
94576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[3]) == 0)
94676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
94776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* from address, len */
94876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (!tcp->u_arg[4] || !tcp->u_arg[5]) {
94976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			if (tcp->u_arg[4] == 0)
95076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tprintf(", NULL");
95176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			else
95276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tprintf(", %#lx", tcp->u_arg[4]);
95376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			if (tcp->u_arg[5] == 0)
95476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tprintf(", NULL");
95576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			else
95676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tprintf(", %#lx", tcp->u_arg[5]);
95776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
95876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
95976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (umove(tcp, tcp->u_arg[5], &fromlen) < 0) {
96076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", {...}, [?]");
96176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
96276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
96376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
964f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman		printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
96576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* from length */
96676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", [%u]", fromlen);
96776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
96876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
96976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
97076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
97176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef HAVE_SENDMSG
97276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
97376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
97476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_recvmsg(tcp)
97576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
97676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
97776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
97876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
97976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else {
98076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp) || !verbose(tcp))
98176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx", tcp->u_arg[1]);
98276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		else
98376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printmsghdr(tcp, tcp->u_arg[1]);
98476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* flags */
98576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
98676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (printflags(msg_flags, tcp->u_arg[2]) == 0)
98776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("0");
98876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
98976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
99076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
99176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
99276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* HAVE_SENDMSG */
99376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
99476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
99576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_shutdown(tcp)
99676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
99776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
99876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
99976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
100076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		switch (tcp->u_arg[1]) {
100176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case 0:
100276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%s", " /* receive */");
100376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
100476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case 1:
100576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%s", " /* send */");
100676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
100776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case 2:
100876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%s", " /* send and receive */");
100976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
101076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
101176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
101276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
101376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
101476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
101576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
101676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_getsockname(tcp)
101776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
101876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
101976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return sys_accept(tcp);
102076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
102176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
102276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
102376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_getpeername(tcp)
102476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
102576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
102676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return sys_accept(tcp);
102776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
102876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
102976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
103076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_pipe(tcp)
103176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
103276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
103376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
103476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#if defined(LINUX) && !defined(SPARC)
103576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	int fds[2];
103676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
103776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (exiting(tcp)) {
103876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp)) {
103976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx", tcp->u_arg[0]);
104076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
104176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
104276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
104376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("[...]");
104476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		else
104576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("[%u, %u]", fds[0], fds[1]);
104676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
10472e4ffe59b588159eb80e236f068278ba47735932Wichert Akkerman#elif defined(SPARC) || defined(SVR4) || defined(FREEBSD)
104876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (exiting(tcp))
104976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
105076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
105176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
105276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
105376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
105476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
105576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_socketpair(tcp)
105676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
105776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
105876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef LINUX
105976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	int fds[2];
106076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
106176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
106276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
106376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printxval(domains, tcp->u_arg[0], "PF_???");
106476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
106576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printxval(socktypes, tcp->u_arg[1], "SOCK_???");
106676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
106776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		switch (tcp->u_arg[0]) {
106876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case PF_INET:
106976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(protocols, tcp->u_arg[2], "IPPROTO_???");
107076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
107176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef PF_IPX
107276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case PF_IPX:
107376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			/* BTW: I don't believe this.. */
107476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("[");
107576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(domains, tcp->u_arg[2], "PF_???");
107676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("]");
107776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
107876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* PF_IPX */
107976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		default:
10802e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman			tprintf("%lu", tcp->u_arg[2]);
108176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
108276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
108376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else {
108476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp)) {
10852e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman			tprintf(", %#lx", tcp->u_arg[3]);
108676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
108776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
108876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef LINUX
108976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (umoven(tcp, tcp->u_arg[3], sizeof fds, (char *) fds) < 0)
10902e2553a534f532a1546ea2b2f3dc3cd2276d020dWichert Akkerman			tprintf(", [...]");
109176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		else
109276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", [%u, %u]", fds[0], fds[1]);
109376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif /* LINUX */
10942e4ffe59b588159eb80e236f068278ba47735932Wichert Akkerman#if defined(SUNOS4) || defined(SVR4) || defined(FREEBSD)
109576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", [%lu, %lu]", tcp->u_rval, getrval2(tcp));
10962e4ffe59b588159eb80e236f068278ba47735932Wichert Akkerman#endif /* SUNOS4 || SVR4 || FREEBSD */
109776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
109876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
109976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
110076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
110176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
110276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_getsockopt(tcp)
110376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
110476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
110576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
110676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
110776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		switch (tcp->u_arg[1]) {
110876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_SOCKET:
110976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_SOCKET, ");
111076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockoptions, tcp->u_arg[2], "SO_???");
111176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
111276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
111376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IP
111476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_IP:
111576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_IP, ");
111676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockipoptions, tcp->u_arg[2], "IP_???");
111776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
111876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
111976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
112076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IPX
112176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_IPX:
112276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_IPX, ");
112376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockipxoptions, tcp->u_arg[2], "IPX_???");
112476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
112576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
112676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
11277987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_PACKET
11287987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		case SOL_PACKET:
11297987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf("SOL_PACKET, ");
11307987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printxval(sockpacketoptions, tcp->u_arg[2], "PACKET_???");
11317987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", ");
11327987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			break;
11337987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
113476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_TCP
113576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_TCP:
113676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_TCP, ");
113776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(socktcpoptions, tcp->u_arg[2], "TCP_???");
113876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
113976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
114076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
114176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
114276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* SOL_AX25 SOL_ROSE SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
114376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		 * etc. still need work */
114476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		default:
114576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			/* XXX - should know socket family here */
1146efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman			printxval(socketlayers, tcp->u_arg[1], "SOL_???");
1147f5eeabb156641482abd504fb98b039e1aae4ae87Wichert Akkerman			tprintf(", %lu, ", tcp->u_arg[2]);
114876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
114976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
115076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	} else {
115176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		if (syserror(tcp)) {
115276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("%#lx, %#lx",
115376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman				tcp->u_arg[3], tcp->u_arg[4]);
115476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			return 0;
115576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
115676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printnum(tcp, tcp->u_arg[3], "%ld");
115776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf(", ");
115876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		printnum(tcp, tcp->u_arg[4], "%ld");
115976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
116076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
116176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
116276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
11637987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_FILTER)
11647987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanstatic void printicmpfilter(tcp, addr)
11657987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanstruct tcb *tcp;
11667987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkermanlong addr;
11677987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman{
11687987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	struct icmp_filter	filter;
11697987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
11707987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	if (!addr) {
11717987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		tprintf("NULL");
11727987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		return;
11737987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	}
11747987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	if (syserror(tcp) || !verbose(tcp)) {
11757987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		tprintf("%#lx", addr);
11767987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		return;
11777987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	}
11787987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	if (umove(tcp, addr, &filter) < 0) {
11797987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		tprintf("{...}");
11807987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		return;
11817987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	}
11827987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
11837987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	tprintf("~(");
11847987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	if (printflags(icmpfilterflags, ~filter.data) == 0)
11857987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		tprintf("0");
11867987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman	tprintf(")");
11877987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman}
11887987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif /* ICMP_FILTER */
11897987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman
119076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanint
119176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermansys_setsockopt(tcp)
119276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkermanstruct tcb *tcp;
119376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman{
119476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	if (entering(tcp)) {
119576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		tprintf("%ld, ", tcp->u_arg[0]);
119676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		switch (tcp->u_arg[1]) {
119776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_SOCKET:
119876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_SOCKET, ");
119976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockoptions, tcp->u_arg[2], "SO_???");
120076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
12017987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12027987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
120376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
120476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IP
120576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_IP:
120676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_IP, ");
120776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockipoptions, tcp->u_arg[2], "IP_???");
120876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
12097987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12107987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
121176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
121276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
121376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_IPX
121476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_IPX:
121576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_IPX, ");
121676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(sockipxoptions, tcp->u_arg[2], "IPX_???");
121776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
12187987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12197987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
12207987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			break;
12217987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
12227987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_PACKET
12237987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		case SOL_PACKET:
12247987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf("SOL_PACKET, ");
12257987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printxval(sockpacketoptions, tcp->u_arg[2], "PACKET_???");
12267987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", ");
12277987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			/* TODO: decode packate_mreq for PACKET_*_MEMBERSHIP */
12287987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12297987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
123076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
123176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
123276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#ifdef SOL_TCP
123376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		case SOL_TCP:
123476baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf("SOL_TCP, ");
123576baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			printxval(socktcpoptions, tcp->u_arg[2], "TCP_???");
123676baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			tprintf(", ");
12377987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12387987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
12397987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			break;
12407987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
12417987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#ifdef SOL_RAW
12427987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman		case SOL_RAW:
12437987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf("SOL_RAW, ");
12447987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printxval(sockrawoptions, tcp->u_arg[2], "RAW_???");
12457987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", ");
12467987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			switch (tcp->u_arg[2]) {
12477987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#if defined(ICMP_FILTER)
12487987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman				case ICMP_FILTER:
12497987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman					printicmpfilter(tcp, tcp->u_arg[3]);
12507987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman					break;
12517987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman#endif
12527987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman				default:
12537987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman					printnum(tcp, tcp->u_arg[3], "%ld");
12547987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman					break;
12557987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			}
12567987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
125776baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
125876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman#endif
125976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman
126076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		/* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
126176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		 * etc. still need work  */
126276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		default:
126376baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			/* XXX - should know socket family here */
1264efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman			printxval(socketlayers, tcp->u_arg[1], "IPPROTO_???");
1265efdecacc5d7f91c17adb7cdb1dd7306ea6d22c9fWichert Akkerman			tprintf(", %lu, ", tcp->u_arg[2]);
12667987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			printnum(tcp, tcp->u_arg[3], "%ld");
12677987cdf192632516d6ba493b0a9943f5a3a7c362Wichert Akkerman			tprintf(", %lu", tcp->u_arg[4]);
126876baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman			break;
126976baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman		}
127076baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	}
127176baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman	return 0;
127276baf7c9f6dd61a15524ad43c1b690c252cf5b7Wichert Akkerman}
127316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
127416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#if UNIXWARE >= 7
127516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
127616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstatic struct xlat sock_version[] = {
127716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_UW211_SVR4,	"UW211_SVR4" },
127816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_UW211_XPG4,	"UW211_XPG4" },
127916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_GEMINI_SVR4,	"GEMINI_SVR4" },
128016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_GEMINI_XPG4,	"GEMINI_XPG4" },
128116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_FP1_SVR4,	"FP1_SVR4" },
128216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ __NETLIB_FP1_XPG4,	"FP1_XPG4" },
128316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	{ 0,            NULL            },
128416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman};
128516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
128616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
128716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
128816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermannetlib_call(tcp, func)
128916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
129016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint (*func) ();
129116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
129216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	if (entering(tcp)) {
129316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		int i;
129416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		printxval (sock_version, tcp->u_arg[0], "__NETLIB_???");
129516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		tprintf(", ");
129616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		--tcp->u_nargs;
129716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		for (i = 0; i < tcp->u_nargs; i++)
129816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			tcp->u_arg[i] = tcp->u_arg[i + 1];
129916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		return func (tcp);
130016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
130116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	}
130216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
130316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return func (tcp);
130416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
130516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
130616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
130716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xsocket(tcp)
130816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
130916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
131016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_socket);
131116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
131216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
131316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
131416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xsocketpair(tcp)
131516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
131616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
131716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_socketpair);
131816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
131916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
132016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
132116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xbind(tcp)
132216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
132316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
132416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_bind);
132516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
132616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
132716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
132816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xconnect(tcp)
132916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
133016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
133116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_connect);
133216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
133316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
133416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
133516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xlisten(tcp)
133616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
133716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
133816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_listen);
133916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
134016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
134116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
134216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xaccept(tcp)
134316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
134416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
134516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_accept);
134616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
134716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
134816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
134916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xsendmsg(tcp)
135016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
135116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
135216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_sendmsg);
135316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
135416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
135516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
135616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xrecvmsg(tcp)
135716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
135816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
135916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_recvmsg);
136016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
136116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
136216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
136316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xgetsockaddr(tcp)
136416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
136516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
136616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	if (entering(tcp)) {
136716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		printxval (sock_version, tcp->u_arg[0], "__NETLIB_???");
136816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		tprintf(", ");
136916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		if (tcp->u_arg[1] == 0) {
137016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			tprintf ("LOCALNAME, ");
137116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		}
137216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		else if (tcp->u_arg[1] == 1) {
137316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			tprintf ("REMOTENAME, ");
137416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		}
137516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		else {
137616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			tprintf ("%ld, ", tcp->u_arg [1]);
137716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		}
137816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		tprintf ("%ld, ", tcp->u_arg [2]);
137916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	}
138016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	else {
138116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		if (tcp->u_arg[3] == 0 || syserror(tcp)) {
138216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			tprintf("%#lx", tcp->u_arg[3]);
138316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		} else {
138416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman			printsock(tcp, tcp->u_arg[3], tcp->u_arg[4]);
138516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		}
138616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		tprintf(", ");
138716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman		printnum(tcp, tcp->u_arg[4], "%lu");
138816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	}
138916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
139016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return 0;
139116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
139216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
139316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
139416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#if 0
139516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
139616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
139716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xsetsockaddr(tcp)
139816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
139916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
140016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_setsockaddr);
140116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
140216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
140316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#endif
140416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
140516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
140616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xgetsockopt(tcp)
140716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
140816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
140916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_getsockopt);
141016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
141116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
141216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
141316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xsetsockopt(tcp)
141416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
141516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
141616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_setsockopt);
141716a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
141816a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
141916a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanint
142016a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermansys_xshutdown(tcp)
142116a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkermanstruct tcb *tcp;
142216a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman{
142316a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman	return netlib_call (tcp, sys_shutdown);
142416a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman}
142516a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman
142616a03d2e97415afe6cf34172a0aea97a95a0b160Wichert Akkerman#endif
1427