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 5*6e91bba0SGirish Moodalbail * Common Development and Distribution License (the "License"). 6*6e91bba0SGirish 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/* 22*6e91bba0SGirish Moodalbail * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate/* LINTLIBRARY */ 277c478bd9Sstevel@tonic-gate/* PROTOLIB1 */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate#include <sys/types.h> 307c478bd9Sstevel@tonic-gate#include <sys/socket.h> 317c478bd9Sstevel@tonic-gate#include <net/if.h> 327c478bd9Sstevel@tonic-gate#include <netinet/in.h> 337c478bd9Sstevel@tonic-gate#include <sys/uio.h> 347c478bd9Sstevel@tonic-gate#include <sys/isa_defs.h> 357c478bd9Sstevel@tonic-gate#include <arpa/inet.h> 367c478bd9Sstevel@tonic-gate#include <sys/ethernet.h> 377c478bd9Sstevel@tonic-gate#include <netdb.h> 387c478bd9Sstevel@tonic-gate#include <net/if_dl.h> 39*6e91bba0SGirish Moodalbail#include <ifaddrs.h> 40*6e91bba0SGirish Moodalbail#include <libsocket_priv.h> 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate/* 437c478bd9Sstevel@tonic-gate * usr/src/lib/libsocket/inet routines not prototyped in the above 447c478bd9Sstevel@tonic-gate * header files. 457c478bd9Sstevel@tonic-gate */ 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate/* bindresvport.c */ 487c478bd9Sstevel@tonic-gateint bindresvport(int sd, struct sockaddr_in *sin); 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate/* bootparams_getbyname.c */ 517c478bd9Sstevel@tonic-gateint bootparams_getbyname(char *name, char *linebuf, int linelen); 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate/* inet6_rthdr.c */ 547c478bd9Sstevel@tonic-gateint __inet6_rthdr_add(void *, const struct in6_addr *); 557c478bd9Sstevel@tonic-gatestruct in6_addr *__inet6_rthdr_getaddr(void *, int); 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate/* netmasks.c */ 587c478bd9Sstevel@tonic-gateint getnetmaskbynet(const struct in_addr net, struct in_addr *mask); 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate/* ruserpass.c */ 617c478bd9Sstevel@tonic-gatevoid _ruserpass(const char *host, char **aname, char **apass); 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate/* 647c478bd9Sstevel@tonic-gate * usr/src/lib/libsocket/socket routines 657c478bd9Sstevel@tonic-gate */ 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate/* _soutil.c */ 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate/* socket.c */ 707c478bd9Sstevel@tonic-gateint socket(int domain, int type, int protocol); 717c478bd9Sstevel@tonic-gateint _socket(int domain, int type, int protocol); 727c478bd9Sstevel@tonic-gateint _socket_bsd(int family, int type, int protocol); 737c478bd9Sstevel@tonic-gateint __xnet_socket(int family, int type, int protocol); 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate/* socketpair.c */ 767c478bd9Sstevel@tonic-gateint socketpair(int domain, int type, int protocol, int sv[]); 777c478bd9Sstevel@tonic-gateint _socketpair(int domain, int type, int protocol, int *sv); 787c478bd9Sstevel@tonic-gateint _socketpair_bsd(int domain, int type, int protocol, int *sv); 797c478bd9Sstevel@tonic-gateint __xnet_socketpair(int domain, int type, int protocol, int *sv); 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate/* weaks.c */ 827c478bd9Sstevel@tonic-gateint bind(int s, const struct sockaddr *name, socklen_t namelen); 837c478bd9Sstevel@tonic-gateint listen(int s, int backlog); 847c478bd9Sstevel@tonic-gateint accept(int s, struct sockaddr *addr, Psocklen_t addrlen); 857c478bd9Sstevel@tonic-gateint connect(int s, const struct sockaddr *name, socklen_t namelen); 867c478bd9Sstevel@tonic-gateint shutdown(int s, int how); 877c478bd9Sstevel@tonic-gatessize_t recv(int s, void *buf, size_t len, int flags); 887c478bd9Sstevel@tonic-gatessize_t recvfrom(int s, void *buf, size_t len, int flags, 897c478bd9Sstevel@tonic-gate struct sockaddr *from, Psocklen_t fromlen); 907c478bd9Sstevel@tonic-gatessize_t recvmsg(int s, struct msghdr *msg, int flags); 917c478bd9Sstevel@tonic-gatessize_t send(int s, const void *msg, size_t len, int flags); 927c478bd9Sstevel@tonic-gatessize_t sendmsg(int s, const struct msghdr *msg, int flags); 937c478bd9Sstevel@tonic-gatessize_t sendto(int s, const void *msg, size_t len, int flags, 947c478bd9Sstevel@tonic-gate const struct sockaddr *to, socklen_t tolen); 957c478bd9Sstevel@tonic-gateint getpeername(int s, struct sockaddr *name, Psocklen_t namelen); 967c478bd9Sstevel@tonic-gateint getsockname(int s, struct sockaddr *name, Psocklen_t namelen); 977c478bd9Sstevel@tonic-gateint getsockopt(int s, int level, int optname, void *optval, Psocklen_t optlen); 987c478bd9Sstevel@tonic-gateint setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gateint _bind(int s, const struct sockaddr *name, int namelen); 1017c478bd9Sstevel@tonic-gateint _listen(int s, int backlog); 1027c478bd9Sstevel@tonic-gateint _accept(int s, struct sockaddr *addr, int *addrlen); 1037c478bd9Sstevel@tonic-gateint _connect(int s, struct sockaddr *name, int namelen); 1047c478bd9Sstevel@tonic-gateint _shutdown(int s, int how); 1057c478bd9Sstevel@tonic-gateint _recv(int s, char *buf, int len, int flags); 1067c478bd9Sstevel@tonic-gateint _recvfrom(int s, char *buf, int len, int flags, 1077c478bd9Sstevel@tonic-gate struct sockaddr *from, int *fromlen); 1087c478bd9Sstevel@tonic-gateint _recvmsg(int s, struct msghdr *msg, int flags); 1097c478bd9Sstevel@tonic-gateint _send(int s, const char *msg, int len, int flags); 1107c478bd9Sstevel@tonic-gateint _sendmsg(int s, const struct msghdr *msg, int flags); 1117c478bd9Sstevel@tonic-gateint _sendto(int s, const char *msg, int len, int flags, 1127c478bd9Sstevel@tonic-gate const struct sockaddr *to, int tolen); 1137c478bd9Sstevel@tonic-gateint _getpeername(int s, struct sockaddr *name, int *namelen); 1147c478bd9Sstevel@tonic-gateint _getsockname(int s, struct sockaddr *name, int *namelen); 1157c478bd9Sstevel@tonic-gateint _getsockopt(int s, int level, int optname, char *optval, int *optlen); 1167c478bd9Sstevel@tonic-gateint _setsockopt(int s, int level, int optname, const char *optval, int optlen); 1177c478bd9Sstevel@tonic-gateint __xnet_bind(int sock, const struct sockaddr *addr, socklen_t addrlen); 1187c478bd9Sstevel@tonic-gateint __xnet_listen(int sock, int backlog); 1197c478bd9Sstevel@tonic-gateint __xnet_connect(int sock, const struct sockaddr *addr, socklen_t addrlen); 1207c478bd9Sstevel@tonic-gateint __xnet_recvmsg(int sock, struct msghdr *msg, int flags); 1217c478bd9Sstevel@tonic-gateint __xnet_sendmsg(int sock, const struct msghdr *msg, int flags); 1227c478bd9Sstevel@tonic-gateint __xnet_sendto(int sock, const void *buf, size_t len, int flags, 1237c478bd9Sstevel@tonic-gate const struct sockaddr *addr, socklen_t addrlen); 1247c478bd9Sstevel@tonic-gateint __xnet_getsockopt(int sock, int level, int option_name, 1257c478bd9Sstevel@tonic-gate void *option_value, socklen_t *option_lenp); 126