1*0Sstevel@tonic-gate/*
2*0Sstevel@tonic-gate * CDDL HEADER START
3*0Sstevel@tonic-gate *
4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate * with the License.
8*0Sstevel@tonic-gate *
9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate * and limitations under the License.
13*0Sstevel@tonic-gate *
14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate *
20*0Sstevel@tonic-gate * CDDL HEADER END
21*0Sstevel@tonic-gate */
22*0Sstevel@tonic-gate/*
23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate * Use is subject to license terms.
25*0Sstevel@tonic-gate */
26*0Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate/* LINTLIBRARY */
29*0Sstevel@tonic-gate/* PROTOLIB1 */
30*0Sstevel@tonic-gate
31*0Sstevel@tonic-gate#include <sys/types.h>
32*0Sstevel@tonic-gate#include <sys/socket.h>
33*0Sstevel@tonic-gate#include <net/if.h>
34*0Sstevel@tonic-gate#include <netinet/in.h>
35*0Sstevel@tonic-gate#include <sys/uio.h>
36*0Sstevel@tonic-gate#include <sys/isa_defs.h>
37*0Sstevel@tonic-gate#include <arpa/inet.h>
38*0Sstevel@tonic-gate#include <sys/ethernet.h>
39*0Sstevel@tonic-gate#include <netdb.h>
40*0Sstevel@tonic-gate#include <net/if_dl.h>
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gate/*
43*0Sstevel@tonic-gate * usr/src/lib/libsocket/inet routines not prototyped in the above
44*0Sstevel@tonic-gate * header files.
45*0Sstevel@tonic-gate */
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gate/* bindresvport.c */
48*0Sstevel@tonic-gateint bindresvport(int sd, struct sockaddr_in *sin);
49*0Sstevel@tonic-gate
50*0Sstevel@tonic-gate/* bootparams_getbyname.c */
51*0Sstevel@tonic-gateint bootparams_getbyname(char *name, char *linebuf, int linelen);
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gate/* inet6_rthdr.c */
54*0Sstevel@tonic-gateint __inet6_rthdr_add(void *, const struct in6_addr *);
55*0Sstevel@tonic-gatestruct in6_addr *__inet6_rthdr_getaddr(void *, int);
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate/* netmasks.c */
58*0Sstevel@tonic-gateint getnetmaskbynet(const struct in_addr net, struct in_addr *mask);
59*0Sstevel@tonic-gateint getnetmaskbyaddr(const struct in_addr addr, struct in_addr *mask);
60*0Sstevel@tonic-gate
61*0Sstevel@tonic-gate/* ruserpass.c */
62*0Sstevel@tonic-gatevoid _ruserpass(const char *host, char **aname, char **apass);
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate/*
65*0Sstevel@tonic-gate * usr/src/lib/libsocket/socket routines
66*0Sstevel@tonic-gate */
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gate/* _soutil.c */
69*0Sstevel@tonic-gate
70*0Sstevel@tonic-gate/* socket.c */
71*0Sstevel@tonic-gateint socket(int domain, int type, int protocol);
72*0Sstevel@tonic-gateint _socket(int domain, int type, int protocol);
73*0Sstevel@tonic-gateint _socket_bsd(int family, int type, int protocol);
74*0Sstevel@tonic-gateint __xnet_socket(int family, int type, int protocol);
75*0Sstevel@tonic-gate
76*0Sstevel@tonic-gate/* socketpair.c */
77*0Sstevel@tonic-gateint socketpair(int domain, int type, int protocol, int sv[]);
78*0Sstevel@tonic-gateint _socketpair(int domain, int type, int protocol, int *sv);
79*0Sstevel@tonic-gateint _socketpair_bsd(int domain, int type, int protocol, int *sv);
80*0Sstevel@tonic-gateint __xnet_socketpair(int domain, int type, int protocol, int *sv);
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gate/* weaks.c */
83*0Sstevel@tonic-gateint bind(int s, const struct sockaddr *name, socklen_t namelen);
84*0Sstevel@tonic-gateint listen(int s, int backlog);
85*0Sstevel@tonic-gateint accept(int s, struct sockaddr *addr, Psocklen_t addrlen);
86*0Sstevel@tonic-gateint connect(int s, const struct sockaddr *name, socklen_t namelen);
87*0Sstevel@tonic-gateint shutdown(int s, int how);
88*0Sstevel@tonic-gatessize_t recv(int s, void *buf, size_t len, int flags);
89*0Sstevel@tonic-gatessize_t recvfrom(int s, void *buf, size_t len, int flags,
90*0Sstevel@tonic-gate				struct sockaddr *from, Psocklen_t fromlen);
91*0Sstevel@tonic-gatessize_t recvmsg(int s, struct msghdr *msg, int flags);
92*0Sstevel@tonic-gatessize_t send(int s, const void *msg, size_t len, int flags);
93*0Sstevel@tonic-gatessize_t sendmsg(int s, const struct msghdr *msg, int flags);
94*0Sstevel@tonic-gatessize_t sendto(int s, const void *msg, size_t len, int flags,
95*0Sstevel@tonic-gate				const struct sockaddr *to, socklen_t tolen);
96*0Sstevel@tonic-gateint getpeername(int s, struct sockaddr *name, Psocklen_t namelen);
97*0Sstevel@tonic-gateint getsockname(int s, struct sockaddr *name, Psocklen_t namelen);
98*0Sstevel@tonic-gateint getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen);
99*0Sstevel@tonic-gateint setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
100*0Sstevel@tonic-gate
101*0Sstevel@tonic-gateint _bind(int s, const struct sockaddr *name, int namelen);
102*0Sstevel@tonic-gateint _listen(int s, int backlog);
103*0Sstevel@tonic-gateint _accept(int s, struct sockaddr *addr, int *addrlen);
104*0Sstevel@tonic-gateint _connect(int s, struct sockaddr *name, int namelen);
105*0Sstevel@tonic-gateint _shutdown(int s, int how);
106*0Sstevel@tonic-gateint _recv(int s, char *buf, int len, int flags);
107*0Sstevel@tonic-gateint _recvfrom(int s, char *buf, int len, int flags,
108*0Sstevel@tonic-gate					struct sockaddr *from, int *fromlen);
109*0Sstevel@tonic-gateint _recvmsg(int s, struct msghdr *msg, int flags);
110*0Sstevel@tonic-gateint _send(int s, const char *msg, int len, int flags);
111*0Sstevel@tonic-gateint _sendmsg(int s, const struct msghdr *msg, int flags);
112*0Sstevel@tonic-gateint _sendto(int s, const char *msg, int len, int flags,
113*0Sstevel@tonic-gate					const struct sockaddr *to, int tolen);
114*0Sstevel@tonic-gateint _getpeername(int s, struct sockaddr *name, int *namelen);
115*0Sstevel@tonic-gateint _getsockname(int s, struct sockaddr *name, int *namelen);
116*0Sstevel@tonic-gateint _getsockopt(int s, int level, int optname, char *optval, int *optlen);
117*0Sstevel@tonic-gateint _setsockopt(int s, int level, int optname, const char *optval, int optlen);
118*0Sstevel@tonic-gateint __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen);
119*0Sstevel@tonic-gateint __xnet_listen(int sock, int backlog);
120*0Sstevel@tonic-gateint __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
121*0Sstevel@tonic-gateint __xnet_recvmsg(int sock, struct msghdr *msg, int flags);
122*0Sstevel@tonic-gateint __xnet_sendmsg(int sock, const struct msghdr *msg, int flags);
123*0Sstevel@tonic-gateint __xnet_sendto(int sock, const void *buf, size_t len, int flags,
124*0Sstevel@tonic-gate    const struct sockaddr *addr, socklen_t addrlen);
125*0Sstevel@tonic-gateint __xnet_getsockopt(int sock, int level, int option_name,
126*0Sstevel@tonic-gate    void *option_value, socklen_t *option_lenp);
127