pmap_svc.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The server procedure for the version 2 portmaper.
* All the portmapper related interface from the portmap side.
*/
#ifdef PORTMAP
#include <stdio.h>
#include <alloca.h>
#include <ucred.h>
#include <rpc/pmap_prot.h>
#include <rpc/rpcb_prot.h>
#include "rpcbind.h"
#ifdef RPCBIND_DEBUG
#include <netdir.h>
#endif
static PMAPLIST *find_service_pmap();
static bool_t pmapproc_change();
static bool_t pmapproc_getport();
static bool_t pmapproc_dump();
/*
* Called for all the version 2 inquiries.
*/
void
{
case PMAPPROC_NULL:
/*
* Null proc call
*/
#ifdef RPCBIND_DEBUG
#endif
debugging) {
if (doabort) {
}
}
break;
case PMAPPROC_SET:
/*
* Set a program, version to port mapping
*/
break;
case PMAPPROC_UNSET:
/*
* Remove a program, version to port mapping.
*/
break;
case PMAPPROC_GETPORT:
/*
* Lookup the mapping for a program, version and return its
* port number.
*/
break;
case PMAPPROC_DUMP:
/*
* Return the current set of mapped program, version
*/
#ifdef RPCBIND_DEBUG
#endif
break;
case PMAPPROC_CALLIT:
/*
* Calls a procedure on the local machine. If the requested
* procedure is not registered this procedure does not return
* error information!!
*/
break;
default:
break;
}
}
/*
* returns the item with the given program, version number. If that version
* number is not found, it returns the item with that program number, so that
* the port number is now returned to the caller. The caller when makes a
* call to this program, version number, the call will fail and it will
* return with PROGVERS_MISMATCH. The user can then determine the highest
* and the lowest version number for this program using clnt_geterr() and
* use those program version numbers.
*/
static PMAPLIST *
{
continue;
break;
}
return (hit);
}
/*ARGSUSED*/
static bool_t
unsigned long op;
{
int ans;
struct sockaddr_in *who;
char owner[64];
return (FALSE);
}
#ifdef RPCBIND_DEBUG
#endif
goto done_change;
}
goto done_change;
}
if (op == PMAPPROC_SET) {
char buf[32];
} else {
goto done_change;
}
} else if (op == PMAPPROC_UNSET) {
} else {
}
debugging) {
if (doabort) {
}
}
#ifdef RPCBIND_DEBUG
#endif
if (op == PMAPPROC_SET)
else
return (TRUE);
}
/* ARGSUSED */
static bool_t
{
int port = 0;
#ifdef RPCBIND_DEBUG
char *uaddr;
#endif
return (FALSE);
}
#ifdef RPCBIND_DEBUG
#endif
if (fnd) {
char *netid;
} else {
}
goto sendreply;
}
} else { /* this service is dead; delete it */
}
}
}
debugging) {
if (doabort) {
}
}
#ifdef RPCBIND_DEBUG
#endif
return (TRUE);
}
/* ARGSUSED */
static bool_t
{
return (FALSE);
}
if (doabort) {
}
}
return (TRUE);
}
/*
* Is the transport local? The original rpcbind code tried to
* figure out all the network interfaces but there can be a nearly
* infinite number of network interfaces. And the number of interfaces can
* vary over time.
*
* Note that when we get here, we've already establised that we're
*/
{
case AF_INET:
break;
case AF_INET6:
if (forceipv4)
return (B_FALSE);
break;
default:
return (B_FALSE);
}
/*
* Get the peer's uid; if it is known it is sufficiently
* authenticated and considered local. The magic behind this
* call is all in libnsl.
*/
}
#endif /* PORTMAP */