xref: /titanic_51/usr/src/lib/libsocket/common/llib-lsocket (revision 5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e)
17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
56e91bba0SGirish Moodalbail * Common Development and Distribution License (the "License").
66e91bba0SGirish Moodalbail * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
217c478bd9Sstevel@tonic-gate/*
226e91bba0SGirish Moodalbail * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate */
25*5dbfd19aSTheo Schlossnagle/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gate/* LINTLIBRARY */
287c478bd9Sstevel@tonic-gate/* PROTOLIB1 */
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gate#include <sys/types.h>
317c478bd9Sstevel@tonic-gate#include <sys/socket.h>
327c478bd9Sstevel@tonic-gate#include <net/if.h>
337c478bd9Sstevel@tonic-gate#include <netinet/in.h>
347c478bd9Sstevel@tonic-gate#include <sys/uio.h>
357c478bd9Sstevel@tonic-gate#include <sys/isa_defs.h>
367c478bd9Sstevel@tonic-gate#include <arpa/inet.h>
377c478bd9Sstevel@tonic-gate#include <sys/ethernet.h>
387c478bd9Sstevel@tonic-gate#include <netdb.h>
397c478bd9Sstevel@tonic-gate#include <net/if_dl.h>
406e91bba0SGirish Moodalbail#include <ifaddrs.h>
416e91bba0SGirish Moodalbail#include <libsocket_priv.h>
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gate/*
447c478bd9Sstevel@tonic-gate * usr/src/lib/libsocket/inet routines not prototyped in the above
457c478bd9Sstevel@tonic-gate * header files.
467c478bd9Sstevel@tonic-gate */
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gate/* bindresvport.c */
497c478bd9Sstevel@tonic-gateint bindresvport(int sd, struct sockaddr_in *sin);
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate/* bootparams_getbyname.c */
527c478bd9Sstevel@tonic-gateint bootparams_getbyname(char *name, char *linebuf, int linelen);
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate/* inet6_rthdr.c */
557c478bd9Sstevel@tonic-gateint __inet6_rthdr_add(void *, const struct in6_addr *);
567c478bd9Sstevel@tonic-gatestruct in6_addr *__inet6_rthdr_getaddr(void *, int);
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate/* netmasks.c */
597c478bd9Sstevel@tonic-gateint getnetmaskbynet(const struct in_addr net, struct in_addr *mask);
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate/* ruserpass.c */
627c478bd9Sstevel@tonic-gatevoid _ruserpass(const char *host, char **aname, char **apass);
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate/*
657c478bd9Sstevel@tonic-gate * usr/src/lib/libsocket/socket routines
667c478bd9Sstevel@tonic-gate */
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate/* _soutil.c */
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate/* socket.c */
717c478bd9Sstevel@tonic-gateint socket(int domain, int type, int protocol);
727c478bd9Sstevel@tonic-gateint _socket(int domain, int type, int protocol);
737c478bd9Sstevel@tonic-gateint _socket_bsd(int family, int type, int protocol);
747c478bd9Sstevel@tonic-gateint __xnet_socket(int family, int type, int protocol);
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate/* socketpair.c */
777c478bd9Sstevel@tonic-gateint socketpair(int domain, int type, int protocol, int sv[]);
787c478bd9Sstevel@tonic-gateint _socketpair(int domain, int type, int protocol, int *sv);
797c478bd9Sstevel@tonic-gateint _socketpair_bsd(int domain, int type, int protocol, int *sv);
807c478bd9Sstevel@tonic-gateint __xnet_socketpair(int domain, int type, int protocol, int *sv);
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate/* weaks.c */
837c478bd9Sstevel@tonic-gateint bind(int s, const struct sockaddr *name, socklen_t namelen);
847c478bd9Sstevel@tonic-gateint listen(int s, int backlog);
857c478bd9Sstevel@tonic-gateint accept(int s, struct sockaddr *addr, Psocklen_t addrlen);
86*5dbfd19aSTheo Schlossnagleint accept4(int s, struct sockaddr *addr, Psocklen_t addrlen, int flags);
877c478bd9Sstevel@tonic-gateint connect(int s, const struct sockaddr *name, socklen_t namelen);
887c478bd9Sstevel@tonic-gateint shutdown(int s, int how);
897c478bd9Sstevel@tonic-gatessize_t recv(int s, void *buf, size_t len, int flags);
907c478bd9Sstevel@tonic-gatessize_t recvfrom(int s, void *buf, size_t len, int flags,
917c478bd9Sstevel@tonic-gate				struct sockaddr *from, Psocklen_t fromlen);
927c478bd9Sstevel@tonic-gatessize_t recvmsg(int s, struct msghdr *msg, int flags);
937c478bd9Sstevel@tonic-gatessize_t send(int s, const void *msg, size_t len, int flags);
947c478bd9Sstevel@tonic-gatessize_t sendmsg(int s, const struct msghdr *msg, int flags);
957c478bd9Sstevel@tonic-gatessize_t sendto(int s, const void *msg, size_t len, int flags,
967c478bd9Sstevel@tonic-gate				const struct sockaddr *to, socklen_t tolen);
977c478bd9Sstevel@tonic-gateint getpeername(int s, struct sockaddr *name, Psocklen_t namelen);
987c478bd9Sstevel@tonic-gateint getsockname(int s, struct sockaddr *name, Psocklen_t namelen);
997c478bd9Sstevel@tonic-gateint getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen);
1007c478bd9Sstevel@tonic-gateint setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gateint _bind(int s, const struct sockaddr *name, int namelen);
1037c478bd9Sstevel@tonic-gateint _listen(int s, int backlog);
1047c478bd9Sstevel@tonic-gateint _accept(int s, struct sockaddr *addr, int *addrlen);
105*5dbfd19aSTheo Schlossnagleint _accept4(int s, struct sockaddr *addr, int *addrlen, int flags);
1067c478bd9Sstevel@tonic-gateint _connect(int s, struct sockaddr *name, int namelen);
1077c478bd9Sstevel@tonic-gateint _shutdown(int s, int how);
1087c478bd9Sstevel@tonic-gateint _recv(int s, char *buf, int len, int flags);
1097c478bd9Sstevel@tonic-gateint _recvfrom(int s, char *buf, int len, int flags,
1107c478bd9Sstevel@tonic-gate					struct sockaddr *from, int *fromlen);
1117c478bd9Sstevel@tonic-gateint _recvmsg(int s, struct msghdr *msg, int flags);
1127c478bd9Sstevel@tonic-gateint _send(int s, const char *msg, int len, int flags);
1137c478bd9Sstevel@tonic-gateint _sendmsg(int s, const struct msghdr *msg, int flags);
1147c478bd9Sstevel@tonic-gateint _sendto(int s, const char *msg, int len, int flags,
1157c478bd9Sstevel@tonic-gate					const struct sockaddr *to, int tolen);
1167c478bd9Sstevel@tonic-gateint _getpeername(int s, struct sockaddr *name, int *namelen);
1177c478bd9Sstevel@tonic-gateint _getsockname(int s, struct sockaddr *name, int *namelen);
1187c478bd9Sstevel@tonic-gateint _getsockopt(int s, int level, int optname, char *optval, int *optlen);
1197c478bd9Sstevel@tonic-gateint _setsockopt(int s, int level, int optname, const char *optval, int optlen);
1207c478bd9Sstevel@tonic-gateint __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen);
1217c478bd9Sstevel@tonic-gateint __xnet_listen(int sock, int backlog);
1227c478bd9Sstevel@tonic-gateint __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
1237c478bd9Sstevel@tonic-gateint __xnet_recvmsg(int sock, struct msghdr *msg, int flags);
1247c478bd9Sstevel@tonic-gateint __xnet_sendmsg(int sock, const struct msghdr *msg, int flags);
1257c478bd9Sstevel@tonic-gateint __xnet_sendto(int sock, const void *buf, size_t len, int flags,
1267c478bd9Sstevel@tonic-gate    const struct sockaddr *addr, socklen_t addrlen);
1277c478bd9Sstevel@tonic-gateint __xnet_getsockopt(int sock, int level, int option_name,
1287c478bd9Sstevel@tonic-gate    void *option_value, socklen_t *option_lenp);
129