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.
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.
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]
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
25 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
30 #include <sys/types.h>
31 #include <sys/socket.h>
33 #include <netinet/in.h>
35 #include <sys/isa_defs.h>
36 #include <arpa/inet.h>
37 #include <sys/ethernet.h>
39 #include <net/if_dl.h>
41 #include <libsocket_priv.h>
44 * usr/src/lib/libsocket/inet routines not prototyped in the above
49 int bindresvport(int sd, struct sockaddr_in *sin);
51 /* bootparams_getbyname.c */
52 int bootparams_getbyname(char *name, char *linebuf, int linelen);
55 int __inet6_rthdr_add(void *, const struct in6_addr *);
56 struct in6_addr *__inet6_rthdr_getaddr(void *, int);
59 int getnetmaskbynet(const struct in_addr net, struct in_addr *mask);
62 void _ruserpass(const char *host, char **aname, char **apass);
65 * usr/src/lib/libsocket/socket routines
71 int socket(int domain, int type, int protocol);
72 int _socket(int domain, int type, int protocol);
73 int _socket_bsd(int family, int type, int protocol);
74 int __xnet_socket(int family, int type, int protocol);
77 int socketpair(int domain, int type, int protocol, int sv[]);
78 int _socketpair(int domain, int type, int protocol, int *sv);
79 int _socketpair_bsd(int domain, int type, int protocol, int *sv);
80 int __xnet_socketpair(int domain, int type, int protocol, int *sv);
83 int bind(int s, const struct sockaddr *name, socklen_t namelen);
84 int listen(int s, int backlog);
85 int accept(int s, struct sockaddr *addr, Psocklen_t addrlen);
86 int accept4(int s, struct sockaddr *addr, Psocklen_t addrlen, int flags);
87 int connect(int s, const struct sockaddr *name, socklen_t namelen);
88 int shutdown(int s, int how);
89 ssize_t recv(int s, void *buf, size_t len, int flags);
90 ssize_t recvfrom(int s, void *buf, size_t len, int flags,
91 struct sockaddr *from, Psocklen_t fromlen);
92 ssize_t recvmsg(int s, struct msghdr *msg, int flags);
93 ssize_t send(int s, const void *msg, size_t len, int flags);
94 ssize_t sendmsg(int s, const struct msghdr *msg, int flags);
95 ssize_t sendto(int s, const void *msg, size_t len, int flags,
96 const struct sockaddr *to, socklen_t tolen);
97 int getpeername(int s, struct sockaddr *name, Psocklen_t namelen);
98 int getsockname(int s, struct sockaddr *name, Psocklen_t namelen);
99 int getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen);
100 int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
102 int _bind(int s, const struct sockaddr *name, int namelen);
103 int _listen(int s, int backlog);
104 int _accept(int s, struct sockaddr *addr, int *addrlen);
105 int _accept4(int s, struct sockaddr *addr, int *addrlen, int flags);
106 int _connect(int s, struct sockaddr *name, int namelen);
107 int _shutdown(int s, int how);
108 int _recv(int s, char *buf, int len, int flags);
109 int _recvfrom(int s, char *buf, int len, int flags,
110 struct sockaddr *from, int *fromlen);
111 int _recvmsg(int s, struct msghdr *msg, int flags);
112 int _send(int s, const char *msg, int len, int flags);
113 int _sendmsg(int s, const struct msghdr *msg, int flags);
114 int _sendto(int s, const char *msg, int len, int flags,
115 const struct sockaddr *to, int tolen);
116 int _getpeername(int s, struct sockaddr *name, int *namelen);
117 int _getsockname(int s, struct sockaddr *name, int *namelen);
118 int _getsockopt(int s, int level, int optname, char *optval, int *optlen);
119 int _setsockopt(int s, int level, int optname, const char *optval, int optlen);
120 int __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen);
121 int __xnet_listen(int sock, int backlog);
122 int __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
123 int __xnet_recvmsg(int sock, struct msghdr *msg, int flags);
124 int __xnet_sendmsg(int sock, const struct msghdr *msg, int flags);
125 int __xnet_sendto(int sock, const void *buf, size_t len, int flags,
126 const struct sockaddr *addr, socklen_t addrlen);
127 int __xnet_getsockopt(int sock, int level, int option_name,
128 void *option_value, socklen_t *option_lenp);