/* $NetBSD: socket.h,v 1.82 2006/06/27 03:49:08 mrg Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)socket.h 8.6 (Berkeley) 5/3/95
*/
#ifndef _SYS_SOCKET_H_
#define _SYS_SOCKET_H_
#include <sys/featuretest.h>
/*
* Definitions related to sockets: types, address families, options.
*/
/*
* Data types.
*/
#ifndef sa_family_t
#endif
#ifndef socklen_t
#endif
#ifdef _EFI_SIZE_T_
#endif
#ifdef _BSD_SSIZE_T_
#endif
/*
* Socket types.
*/
/*
* Option flags per-socket.
*/
/*
* Additional options, not kept in so_options.
*/
/*
* Structure used for manipulating linger option.
*/
struct linger {
};
/*
*/
/*
* Address families.
*/
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
in interface output routine */
#endif
/*
* Structure used by kernel to store most
* addresses.
*/
struct sockaddr {
};
#if defined(_KERNEL)
/*
* Structure used by kernel to pass protocol
* information in raw sockets.
*/
struct sockproto {
};
#endif /* _KERNEL */
#if 1
/*
* RFC 2553: protocol-independent placeholder for socket addresses
*/
struct sockaddr_storage {
};
#endif /* _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
#endif /* 1 */
/*
* Protocol families, same as address families for now.
*/
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
#endif
#if defined(_NETBSD_SOURCE)
#ifndef gid_t
#endif
#ifndef uid_t
#endif
/*
* Socket credentials.
*/
struct sockcred {
};
/*
* Compute size of a sockcred structure with groups.
*/
#endif /* _NETBSD_SOURCE */
#if defined(_NETBSD_SOURCE)
/*
* Definitions for network related sysctl, CTL_NET.
*
* Second level is protocol family.
* Third level is protocol number.
*
* Further levels are defined by the individual families below.
*/
#define CTL_NET_NAMES { \
{ 0, 0 }, \
{ "local", CTLTYPE_NODE }, \
{ "inet", CTLTYPE_NODE }, \
{ "implink", CTLTYPE_NODE }, \
{ "pup", CTLTYPE_NODE }, \
{ "chaos", CTLTYPE_NODE }, \
{ "xerox_ns", CTLTYPE_NODE }, \
{ "iso", CTLTYPE_NODE }, \
{ "emca", CTLTYPE_NODE }, \
{ "datakit", CTLTYPE_NODE }, \
{ "ccitt", CTLTYPE_NODE }, \
{ "ibm_sna", CTLTYPE_NODE }, \
{ "decnet", CTLTYPE_NODE }, \
{ "dec_dli", CTLTYPE_NODE }, \
{ "lat", CTLTYPE_NODE }, \
{ "hylink", CTLTYPE_NODE }, \
{ "appletalk", CTLTYPE_NODE }, \
{ "route", CTLTYPE_NODE }, \
{ "link_layer", CTLTYPE_NODE }, \
{ "xtp", CTLTYPE_NODE }, \
{ "coip", CTLTYPE_NODE }, \
{ "cnt", CTLTYPE_NODE }, \
{ "rtip", CTLTYPE_NODE }, \
{ "ipx", CTLTYPE_NODE }, \
{ "inet6", CTLTYPE_NODE }, \
{ "pip", CTLTYPE_NODE }, \
{ "isdn", CTLTYPE_NODE }, \
{ "natm", CTLTYPE_NODE }, \
{ "arp", CTLTYPE_NODE }, \
{ "key", CTLTYPE_NODE }, \
}
struct kinfo_pcb {
union {
} ki_s;
union {
} ki_d;
};
#define PCB_ALL 0
#endif /* _NETBSD_SOURCE */
#if defined(_NETBSD_SOURCE)
/*
* PF_ROUTE - Routing table
*
* Three additional levels are defined:
* Fourth: address family, 0 is wildcard
* Fifth: type of info, defined below
* Sixth: flag(s) to mask with for NET_RT_FLAGS
*/
#define CTL_NET_RT_NAMES { \
{ 0, 0 }, \
{ "dump", CTLTYPE_STRUCT }, \
{ "flags", CTLTYPE_STRUCT }, \
{ 0, 0 }, \
{ "iflist", CTLTYPE_STRUCT }, \
}
#endif /* _NETBSD_SOURCE */
/*
* Maximum queue length specifiable by listen(2).
*/
#ifndef SOMAXCONN
#endif
/*
* Message header for recvmsg and sendmsg calls.
* Used value-result for recvmsg, value only for sendmsg.
*/
struct msghdr {
};
/*
* Header for ancillary data objects in msg_control buffer.
* not expressible by flags. The format is a sequence
* of message elements headed by cmsghdr structures.
*/
struct cmsghdr {
/* followed by u_char cmsg_data[]; */
};
/* given pointer to struct cmsghdr, return pointer to data */
__CMSG_ALIGN(sizeof(struct cmsghdr)))
/*
* Alignment requirement for CMSG struct manipulation.
* We declare it separately for two reasons:
* idea of ALIGNBYTES at runtime.
* without (2), we can't guarantee binary compatibility in case of future
* changes in ALIGNBYTES.
*/
#ifdef _KERNEL
#endif
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
__CMSG_ALIGN(sizeof(struct cmsghdr)) > \
(struct cmsghdr *)0 : \
/*
* RFC 2292 requires to check msg_controllen, in case that the kernel returns
* an empty list for some reasons.
*/
(struct cmsghdr *)0)
/* "Socket"-level control message types: */
#if defined(_NETBSD_SOURCE)
#endif
/*
* Types of socket shutdown(2).
*/
#include <sys/EfiCdefs.h>
int __cmsg_alignbytes(void);
#ifndef _KERNEL
int listen(int, int);
int setsockopt(int, int, int, const void *, socklen_t);
int shutdown(int, int);
int sockatmark(int);
int socket(int, int, int)
#if !defined(__LIBC12_SOURCE__) && !defined(_STANDALONE)
#endif
;
int socketpair(int, int, int, int *);
#endif /* !_KERNEL */
#endif /* !_SYS_SOCKET_H_ */