/*
* 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
* 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 (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley
* 4.3 BSD under license from the Regents of the University of
* California.
*/
#ifdef PORTMAP
/*
*
* The backward compatibility routines for the earlier implementation
* Based on berkeley socket abstraction, now implemented on the top
*/
#include "mt.h"
#include "rpc_mt.h"
#include <stdio.h>
#include <netdb.h>
#include <netdir.h>
#include <errno.h>
#include <rpc/pmap_clnt.h>
#include <rpc/pmap_prot.h>
#include <syslog.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
int __rpc_bindresvport(int, struct sockaddr_in *, int *, int);
int __rpc_bindresvport_ipv6(int, struct sockaddr *, int *, int, char *);
void get_myaddress_ipv6(char *, struct sockaddr *);
extern mutex_t rpcsoc_lock;
/*
* A common clnt create routine
*/
static CLIENT *
{
int port;
(void) mutex_lock(&rpcsoc_lock);
(void) mutex_unlock(&rpcsoc_lock);
return (NULL);
}
if (fd == RPC_ANYSOCK) {
if (fd == -1)
goto syserror;
} else {
goto syserror;
}
/* pmap_getport is recursive */
(void) mutex_unlock(&rpcsoc_lock);
if (sport == 0) {
goto err;
}
/* pmap_getport is recursive */
(void) mutex_lock(&rpcsoc_lock);
}
/* Transform sockaddr_in to netbuf */
if (cl) {
/*
* The fd should be closed while destroying the handle.
*/
}
(void) freenetconfigent(nconf);
(void) mutex_unlock(&rpcsoc_lock);
return (cl);
}
goto err;
(void) freenetconfigent(nconf);
(void) mutex_unlock(&rpcsoc_lock);
return (NULL);
}
CLIENT *
{
return (NULL);
return (cl);
}
CLIENT *
{
UDPMSGSIZE, UDPMSGSIZE));
}
CLIENT *
{
recvsz, "tcp"));
}
CLIENT *
{
}
/*
* A common server create routine
*/
static SVCXPRT *
{
int port;
int res;
return (NULL);
}
if (fd == RPC_ANYSOCK) {
if (fd == -1) {
"svc%s_create: could not open connection : %s", netid,
errorstr);
(void) freenetconfigent(nconf);
return (NULL);
}
}
(void) freenetconfigent(nconf);
if (madefd)
return (NULL);
}
if (res == -1)
return (svc);
}
SVCXPRT *
{
}
SVCXPRT *
{
}
SVCXPRT *
{
}
SVCXPRT *
{
}
SVCXPRT *
svcraw_create(void)
{
return (svc_raw_create());
}
/*
* Bind a fd to a privileged IP port.
* This is slightly different from the code in netdir_options
* because it has a different interface - main thing is that it
* needs to know its own address. We also wanted to set the qlen.
* t_getname() can be used for those purposes and perhaps job can be done.
*/
int
char *fmly)
{
int res;
int i;
extern mutex_t portnum_lock;
/* VARIABLES PROTECTED BY portnum_lock: port */
return (-1);
}
if (geteuid()) {
return (-1);
}
if (i != -1)
return (-1);
}
if (sin == 0) {
}
/* LINTED pointer cast */
/* LINTED pointer cast */
} else {
return (-1);
}
/* Transform sockaddr to netbuf */
return (-1);
}
return (-1);
res = -1;
(void) mutex_lock(&portnum_lock);
if (port == 0)
for (i = 0; i < NPORTS; i++) {
if (res == 0) {
break;
res = -1;
break;
}
(void) mutex_unlock(&portnum_lock);
return (res);
}
int
{
}
/*
* Get clients IP address.
* don't use gethostbyname, which would invoke yellow pages
* Remains only for backward compatibility reasons.
* Used mainly by the portmapper so that it can register
* with itself. Also used by pmap*() routines
*/
void
{
/* LINTED pointer cast */
if (__can_use_af(AF_INET6)) {
/* Local copy of in6addr_any to avoid -lsocket */
} else {
}
} else {
/* LINTED pointer cast */
}
}
void
{
}
/*
* Get port used by specified service on specified host.
* Exists for source compatibility only.
* Obsoleted by rpcb_getaddr().
*/
{
return (0);
}
/*
* For connectionless "udp" transport. Obsoleted by rpc_call().
*/
int
{
}
/*
* For connectionless kind of transport. Obsoleted by rpc_reg()
*/
int
{
outproc, "udp"));
}
/*
* All the following clnt_broadcast stuff is convulated; it supports
* the earlier calling style of the callback function
*/
/*
* Need to translate the netbuf address into sockaddr_in address.
* Dont care about netid here.
*/
/* ARGSUSED2 */
static bool_t
{
return ((*clnt_broadcast_result)(resultp,
}
/*
* Broadcasts on UDP transport. Obsoleted by rpc_broadcast().
*/
enum clnt_stat
{
if (thr_main()) {
} else {
(void *)eachresult);
}
}
/*
* Create the client des authentication object. Obsoleted by
* authdes_seccreate().
*/
AUTH *
{
if (syncaddr) {
/*
* Change addr to hostname, because that is the way
* new interface takes it.
*/
int fd;
goto fallback;
/* Transform sockaddr_in to netbuf */
(void) freenetconfigent(nconf);
goto fallback;
}
(void) freenetconfigent(nconf);
goto fallback;
}
(void) freenetconfigent(nconf);
return (nauth);
}
}
#endif /* PORTMAP */