view usr/src/lib/libsocket/common/llib-lsocket @ 12016:0248e987199b

PSARC 2009/306 Brussels II - ipadm and libipadm PSARC 2010/080 Brussels II addendum 6827318 Brussels Phase II aka ipadm(1m) 6731945 need BSD getifaddrs() API 6909065 explicitly disallow non-contiguous netmasks in the next minor release 6853922 ifconfig dumps core when ether address is non-hexadecimal. 6815806 ipReasmTimeout value should be variable 6567083 nd_getset has some dead and confusing code. 6884466 remove unused tcp/sctp ndd tunables 6928813 Comments at odds with default value of tcp_time_wait_interval 6236982 ifconfig usesrc lets adapter use itself as source address 6936855 modifying the ip6_strict_src_multihoming to non-zero value will unbind V4 IREs
author Girish Moodalbail <Girish.Moodalbail@Sun.COM>
date Fri, 26 Mar 2010 17:53:11 -0400
parents 68f95e015346
children 19e11862653b
line wrap: on
line source

/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

/* LINTLIBRARY */
/* PROTOLIB1 */

#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/uio.h>
#include <sys/isa_defs.h>
#include <arpa/inet.h>
#include <sys/ethernet.h>
#include <netdb.h>
#include <net/if_dl.h>
#include <ifaddrs.h>
#include <libsocket_priv.h>

/*
 * usr/src/lib/libsocket/inet routines not prototyped in the above
 * header files.
 */

/* bindresvport.c */
int bindresvport(int sd, struct sockaddr_in *sin);

/* bootparams_getbyname.c */
int bootparams_getbyname(char *name, char *linebuf, int linelen);

/* inet6_rthdr.c */
int __inet6_rthdr_add(void *, const struct in6_addr *);
struct in6_addr *__inet6_rthdr_getaddr(void *, int);

/* netmasks.c */
int getnetmaskbynet(const struct in_addr net, struct in_addr *mask);

/* ruserpass.c */
void _ruserpass(const char *host, char **aname, char **apass);

/*
 * usr/src/lib/libsocket/socket routines
 */

/* _soutil.c */

/* socket.c */
int socket(int domain, int type, int protocol);
int _socket(int domain, int type, int protocol);
int _socket_bsd(int family, int type, int protocol);
int __xnet_socket(int family, int type, int protocol);

/* socketpair.c */
int socketpair(int domain, int type, int protocol, int sv[]);
int _socketpair(int domain, int type, int protocol, int *sv);
int _socketpair_bsd(int domain, int type, int protocol, int *sv);
int __xnet_socketpair(int domain, int type, int protocol, int *sv);

/* weaks.c */
int bind(int s, const struct sockaddr *name, socklen_t namelen);
int listen(int s, int backlog);
int accept(int s, struct sockaddr *addr, Psocklen_t addrlen);
int connect(int s, const struct sockaddr *name, socklen_t namelen);
int shutdown(int s, int how);
ssize_t recv(int s, void *buf, size_t len, int flags);
ssize_t recvfrom(int s, void *buf, size_t len, int flags,
				struct sockaddr *from, Psocklen_t fromlen);
ssize_t recvmsg(int s, struct msghdr *msg, int flags);
ssize_t send(int s, const void *msg, size_t len, int flags);
ssize_t sendmsg(int s, const struct msghdr *msg, int flags);
ssize_t sendto(int s, const void *msg, size_t len, int flags,
				const struct sockaddr *to, socklen_t tolen);
int getpeername(int s, struct sockaddr *name, Psocklen_t namelen);
int getsockname(int s, struct sockaddr *name, Psocklen_t namelen);
int getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen);
int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);

int _bind(int s, const struct sockaddr *name, int namelen);
int _listen(int s, int backlog);
int _accept(int s, struct sockaddr *addr, int *addrlen);
int _connect(int s, struct sockaddr *name, int namelen);
int _shutdown(int s, int how);
int _recv(int s, char *buf, int len, int flags);
int _recvfrom(int s, char *buf, int len, int flags,
					struct sockaddr *from, int *fromlen);
int _recvmsg(int s, struct msghdr *msg, int flags);
int _send(int s, const char *msg, int len, int flags);
int _sendmsg(int s, const struct msghdr *msg, int flags);
int _sendto(int s, const char *msg, int len, int flags,
					const struct sockaddr *to, int tolen);
int _getpeername(int s, struct sockaddr *name, int *namelen);
int _getsockname(int s, struct sockaddr *name, int *namelen);
int _getsockopt(int s, int level, int optname, char *optval, int *optlen);
int _setsockopt(int s, int level, int optname, const char *optval, int optlen);
int __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen);
int __xnet_listen(int sock, int backlog);
int __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
int __xnet_recvmsg(int sock, struct msghdr *msg, int flags);
int __xnet_sendmsg(int sock, const struct msghdr *msg, int flags);
int __xnet_sendto(int sock, const void *buf, size_t len, int flags,
    const struct sockaddr *addr, socklen_t addrlen);
int __xnet_getsockopt(int sock, int level, int option_name,
    void *option_value, socklen_t *option_lenp);