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