Destroys the mapping between the program, version, netconfig structure and the service address.
Network Services Library (libnsl.a)
#include <rpc/rpc.h>
 bool_t rpcb_unset(prognum, progver, nconf)
const rpcprog_t prognum;
const rpcvers_t progver;
const struct netconfig *nconf;
The rpcb_unset subroutine destroys a mapping of triplet (program number, version number, and the nc_netid field of the nconf argument) to the address of a remote service. The mapping is destroyed from the rpcbind service of the machine. The nc_netid field of the netconfig structure identifies the network identifier defined by the netconfig database.
| Item | Description | 
|---|---|
| prognum | Specifies the program number of the remote program. | 
| progver | Specifies the version number of the remote program. | 
| nconf | Specifies the protocol associated with the service. | 
| Item | Description | 
|---|---|
| TRUE | successful | 
| FALSE | unsuccessful | 
The rpcb_unset subroutine returns failure if one or more of the following codes are true.
| Item | Description | 
|---|---|
| RPC_UNKNOWNPROTO | The value of the netconfig argument is not valid. | 
| RPC_UNKNOWNADDR | The remote service address is not valid. | 
#include <rpc/rpc.h>
#include <stdio.h>
int main()
{
    rpcprog_t PROGNUM ;
    rpcvers_t PROGVER ;
    struct netconfig *nconf ;
    struct netbuf *nbuf;
    struct t_bind *bind_addr = NULL;
    /* Get netconfig structure corresponding to tcp transport */ 
    if ((nconf = getnetconfigent("tcp")) == (struct netconfig *) NULL) {
        fprintf(stderr, "getnetconfigent failed");
        exit(1);
    }
    /* 
     * Code to open and bind file descriptor to bind_addr address 
     */
    nbuf = &bind_addr->addr;
    if( rpcb_set(PROGNUM, PROGVER, nconf, nbuf) == FALSE ) {
        fprintf(stderr,"rpcb_set() failed");
        exit(1);
    }
    rpcb_unset(PROGNUM, PROGVER, nconf);
    svc_run();
    return 0;
}