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