rpcb_svc_4.c revision 8f6d9dae92449b59bdafcb7777bc32f1b2726e48
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
/*
* The server procedure for the version 4 rpcbind.
*
*/
#include <stdio.h>
#include <unistd.h>
#include <netconfig.h>
#include <syslog.h>
#include <netdir.h>
#include <string.h>
#include <stdlib.h>
#include "rpcbind.h"
static void free_rpcb_entry_list(rpcb_entry_list_ptr);
struct svc_req *);
/*
* Called by svc_getreqset. There is a separate server handle for
* every transport that it waits on.
*/
void
{
union {
char *rpcbproc_uaddr2taddr_4_arg;
struct netbuf rpcbproc_taddr2uaddr_4_arg;
} argument;
union {
char *rpcbproc_getaddr_4_res;
struct netbuf rpcbproc_uaddr2taddr_4_res;
char *rpcbproc_taddr2uaddr_4_res;
char *rpcbproc_getversaddr_4_res;
} result;
case NULLPROC:
/*
* Null proc call
*/
return;
case RPCBPROC_SET:
/*
* Check to see whether the message came from
* loopback transports (for security reasons)
*/
return;
}
break;
case RPCBPROC_UNSET:
/*
* Check to see whether the message came from
* loopback transports (for security reasons)
*/
return;
}
break;
case RPCBPROC_GETADDR:
break;
case RPCBPROC_DUMP:
break;
case RPCBPROC_BCAST:
return;
case RPCBPROC_GETTIME:
break;
case RPCBPROC_UADDR2TADDR:
break;
case RPCBPROC_TADDR2UADDR:
break;
case RPCBPROC_GETVERSADDR:
break;
case RPCBPROC_INDIRECT:
return;
case RPCBPROC_GETADDRLIST:
break;
case RPCBPROC_GETSTAT:
break;
default:
return;
}
if (debugging)
return;
}
if (debugging) {
if (doabort) {
}
}
}
if (debugging) {
if (doabort) {
}
}
}
}
/*
* Lookup the mapping for a program, version and return the
* addresses for all transports in the current transport family.
* We return a merged address.
*/
static bool_t
{
rpcb_entry *a;
/*
* Deal with a possible window during which we could return an IPv6
* address when the caller wanted IPv4. See the comments in
* rpcbproc_getaddr_com() for more details.
*/
struct sockaddr_in6 *rmtaddr;
"IPv4 GETADDRLIST request mapped "
"to IPv6: ignoring");
return (FALSE);
}
}
return (FALSE);
} else {
}
(void) rw_wrlock(&list_rbl_lock);
(void) rw_unlock(&list_rbl_lock);
goto fail;
}
!= 0) {
continue; /* not same proto family */
}
continue;
} else if (!maddr[0]) {
/*
* The server died, remove this rpcb_map element
* from the list and free it.
*/
#ifdef PORTMAP
(void) rw_wrlock(&list_pml_lock);
(void) rw_unlock(&list_pml_lock);
#endif
(void) delete_rbl(rbl);
else
continue;
}
/*
* Add it to rlist.
*/
(void) rw_unlock(&list_rbl_lock);
goto fail;
}
a = &rp->rpcb_entry_map;
} else {
}
}
}
(void) rw_unlock(&list_rbl_lock);
/*
* XXX: getaddrlist info is also being stuffed into getaddr.
* Perhaps wrong, but better than it not getting counted at all.
*/
return (TRUE);
fail:
return (FALSE);
}
/*
* Free only the allocated structure, rest is all a pointer to some
* other data somewhere else.
*/
static void
{
}
}
static bool_t
{
return (TRUE);
}
}