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