xref: /onnv-gate/usr/src/lib/libsocket/common/llib-lsocket (revision 12016:0248e987199b)
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*12016SGirish.Moodalbail@Sun.COM * Common Development and Distribution License (the "License").
6*12016SGirish.Moodalbail@Sun.COM * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
210Sstevel@tonic-gate/*
22*12016SGirish.Moodalbail@Sun.COM * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate * Use is subject to license terms.
240Sstevel@tonic-gate */
250Sstevel@tonic-gate
260Sstevel@tonic-gate/* LINTLIBRARY */
270Sstevel@tonic-gate/* PROTOLIB1 */
280Sstevel@tonic-gate
290Sstevel@tonic-gate#include <sys/types.h>
300Sstevel@tonic-gate#include <sys/socket.h>
310Sstevel@tonic-gate#include <net/if.h>
320Sstevel@tonic-gate#include <netinet/in.h>
330Sstevel@tonic-gate#include <sys/uio.h>
340Sstevel@tonic-gate#include <sys/isa_defs.h>
350Sstevel@tonic-gate#include <arpa/inet.h>
360Sstevel@tonic-gate#include <sys/ethernet.h>
370Sstevel@tonic-gate#include <netdb.h>
380Sstevel@tonic-gate#include <net/if_dl.h>
39*12016SGirish.Moodalbail@Sun.COM#include <ifaddrs.h>
40*12016SGirish.Moodalbail@Sun.COM#include <libsocket_priv.h>
410Sstevel@tonic-gate
420Sstevel@tonic-gate/*
430Sstevel@tonic-gate * usr/src/lib/libsocket/inet routines not prototyped in the above
440Sstevel@tonic-gate * header files.
450Sstevel@tonic-gate */
460Sstevel@tonic-gate
470Sstevel@tonic-gate/* bindresvport.c */
480Sstevel@tonic-gateint bindresvport(int sd, struct sockaddr_in *sin);
490Sstevel@tonic-gate
500Sstevel@tonic-gate/* bootparams_getbyname.c */
510Sstevel@tonic-gateint bootparams_getbyname(char *name, char *linebuf, int linelen);
520Sstevel@tonic-gate
530Sstevel@tonic-gate/* inet6_rthdr.c */
540Sstevel@tonic-gateint __inet6_rthdr_add(void *, const struct in6_addr *);
550Sstevel@tonic-gatestruct in6_addr *__inet6_rthdr_getaddr(void *, int);
560Sstevel@tonic-gate
570Sstevel@tonic-gate/* netmasks.c */
580Sstevel@tonic-gateint getnetmaskbynet(const struct in_addr net, struct in_addr *mask);
590Sstevel@tonic-gate
600Sstevel@tonic-gate/* ruserpass.c */
610Sstevel@tonic-gatevoid _ruserpass(const char *host, char **aname, char **apass);
620Sstevel@tonic-gate
630Sstevel@tonic-gate/*
640Sstevel@tonic-gate * usr/src/lib/libsocket/socket routines
650Sstevel@tonic-gate */
660Sstevel@tonic-gate
670Sstevel@tonic-gate/* _soutil.c */
680Sstevel@tonic-gate
690Sstevel@tonic-gate/* socket.c */
700Sstevel@tonic-gateint socket(int domain, int type, int protocol);
710Sstevel@tonic-gateint _socket(int domain, int type, int protocol);
720Sstevel@tonic-gateint _socket_bsd(int family, int type, int protocol);
730Sstevel@tonic-gateint __xnet_socket(int family, int type, int protocol);
740Sstevel@tonic-gate
750Sstevel@tonic-gate/* socketpair.c */
760Sstevel@tonic-gateint socketpair(int domain, int type, int protocol, int sv[]);
770Sstevel@tonic-gateint _socketpair(int domain, int type, int protocol, int *sv);
780Sstevel@tonic-gateint _socketpair_bsd(int domain, int type, int protocol, int *sv);
790Sstevel@tonic-gateint __xnet_socketpair(int domain, int type, int protocol, int *sv);
800Sstevel@tonic-gate
810Sstevel@tonic-gate/* weaks.c */
820Sstevel@tonic-gateint bind(int s, const struct sockaddr *name, socklen_t namelen);
830Sstevel@tonic-gateint listen(int s, int backlog);
840Sstevel@tonic-gateint accept(int s, struct sockaddr *addr, Psocklen_t addrlen);
850Sstevel@tonic-gateint connect(int s, const struct sockaddr *name, socklen_t namelen);
860Sstevel@tonic-gateint shutdown(int s, int how);
870Sstevel@tonic-gatessize_t recv(int s, void *buf, size_t len, int flags);
880Sstevel@tonic-gatessize_t recvfrom(int s, void *buf, size_t len, int flags,
890Sstevel@tonic-gate				struct sockaddr *from, Psocklen_t fromlen);
900Sstevel@tonic-gatessize_t recvmsg(int s, struct msghdr *msg, int flags);
910Sstevel@tonic-gatessize_t send(int s, const void *msg, size_t len, int flags);
920Sstevel@tonic-gatessize_t sendmsg(int s, const struct msghdr *msg, int flags);
930Sstevel@tonic-gatessize_t sendto(int s, const void *msg, size_t len, int flags,
940Sstevel@tonic-gate				const struct sockaddr *to, socklen_t tolen);
950Sstevel@tonic-gateint getpeername(int s, struct sockaddr *name, Psocklen_t namelen);
960Sstevel@tonic-gateint getsockname(int s, struct sockaddr *name, Psocklen_t namelen);
970Sstevel@tonic-gateint getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen);
980Sstevel@tonic-gateint setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
990Sstevel@tonic-gate
1000Sstevel@tonic-gateint _bind(int s, const struct sockaddr *name, int namelen);
1010Sstevel@tonic-gateint _listen(int s, int backlog);
1020Sstevel@tonic-gateint _accept(int s, struct sockaddr *addr, int *addrlen);
1030Sstevel@tonic-gateint _connect(int s, struct sockaddr *name, int namelen);
1040Sstevel@tonic-gateint _shutdown(int s, int how);
1050Sstevel@tonic-gateint _recv(int s, char *buf, int len, int flags);
1060Sstevel@tonic-gateint _recvfrom(int s, char *buf, int len, int flags,
1070Sstevel@tonic-gate					struct sockaddr *from, int *fromlen);
1080Sstevel@tonic-gateint _recvmsg(int s, struct msghdr *msg, int flags);
1090Sstevel@tonic-gateint _send(int s, const char *msg, int len, int flags);
1100Sstevel@tonic-gateint _sendmsg(int s, const struct msghdr *msg, int flags);
1110Sstevel@tonic-gateint _sendto(int s, const char *msg, int len, int flags,
1120Sstevel@tonic-gate					const struct sockaddr *to, int tolen);
1130Sstevel@tonic-gateint _getpeername(int s, struct sockaddr *name, int *namelen);
1140Sstevel@tonic-gateint _getsockname(int s, struct sockaddr *name, int *namelen);
1150Sstevel@tonic-gateint _getsockopt(int s, int level, int optname, char *optval, int *optlen);
1160Sstevel@tonic-gateint _setsockopt(int s, int level, int optname, const char *optval, int optlen);
1170Sstevel@tonic-gateint __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen);
1180Sstevel@tonic-gateint __xnet_listen(int sock, int backlog);
1190Sstevel@tonic-gateint __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
1200Sstevel@tonic-gateint __xnet_recvmsg(int sock, struct msghdr *msg, int flags);
1210Sstevel@tonic-gateint __xnet_sendmsg(int sock, const struct msghdr *msg, int flags);
1220Sstevel@tonic-gateint __xnet_sendto(int sock, const void *buf, size_t len, int flags,
1230Sstevel@tonic-gate    const struct sockaddr *addr, socklen_t addrlen);
1240Sstevel@tonic-gateint __xnet_getsockopt(int sock, int level, int option_name,
1250Sstevel@tonic-gate    void *option_value, socklen_t *option_lenp);
126