/* Registration works over both AF_INET and AF_INET6, and services registered via this function are advertised as available for any address. If the local rpcbind daemon is listening on AF_INET6, services registered via this function will be advertised on IN6ADDR_ANY (ie available for all AF_INET and AF_INET6 addresses).  */
int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
/* Registration works over both AF_INET and AF_INET6, and services registered via this function are advertised as available for any address. If the local rpcbind daemon is listening on AF_INET6, services registered via this function will be advertised on IN6ADDR_ANY (ie available for all AF_INET and AF_INET6 addresses).  */
int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
{
	struct rpcbind_args map = {
		.r_prog		= prog,
		.r_vers		= vers,
		.r_prot		= prot,
		.r_port		= port,
	};
	struct rpc_message msg = {
		.rpc_argp	= &map,
	};
	int error;
	error = rpcb_create_local();
	if (error)
		return error;
	dprintk("RPC:       %sregistering (%u, %u, %d, %u) with local "
			"rpcbind\n", (port ? "" : "un"),
			prog, vers, prot, port);
	msg.rpc_proc = &rpcb_procedures2[RPCBPROC_UNSET];
	if (port)
		msg.rpc_proc = &rpcb_procedures2[RPCBPROC_SET];
	return rpcb_register_call(rpcb_local_clnt, &msg);
}