Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/un.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/nsproxy.h>
#include <net/ipv6.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/xprtsock.h>
#include "netns.h"
Go to the source code of this file.
Data Structures | |
struct | rpcbind_args |
struct | rpcb_info |
Macros | |
#define | RPCBIND_SOCK_PATHNAME "/var/run/rpcbind.sock" |
#define | RPCBIND_PROGRAM (100000u) |
#define | RPCBIND_PORT (111u) |
#define | RPCBVERS_2 (2u) |
#define | RPCBVERS_3 (3u) |
#define | RPCBVERS_4 (4u) |
#define | RPCB_OWNER_STRING "0" |
#define | RPCB_MAXOWNERLEN sizeof(RPCB_OWNER_STRING) |
#define | RPCB_program_sz (1) |
#define | RPCB_version_sz (1) |
#define | RPCB_protocol_sz (1) |
#define | RPCB_port_sz (1) |
#define | RPCB_boolean_sz (1) |
#define | RPCB_netid_sz (1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) |
#define | RPCB_addr_sz (1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN)) |
#define | RPCB_ownerstring_sz (1 + XDR_QUADLEN(RPCB_MAXOWNERLEN)) |
#define | RPCB_mappingargs_sz |
#define | RPCB_getaddrargs_sz |
#define | RPCB_getportres_sz RPCB_port_sz |
#define | RPCB_setres_sz RPCB_boolean_sz |
#define | RPCB_getaddrres_sz RPCB_addr_sz |
Functions | |
void | rpcb_put_local (struct net *net) |
int | rpcb_create_local (struct net *net) |
int | rpcb_register (struct net *net, u32 prog, u32 vers, int prot, unsigned short port) |
int | rpcb_v4_register (struct net *net, const u32 program, const u32 version, const struct sockaddr *address, const char *netid) |
void | rpcb_getport_async (struct rpc_task *task) |
EXPORT_SYMBOL_GPL (rpcb_getport_async) | |
#define RPCB_addr_sz (1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN)) |
Definition at line 92 of file rpcb_clnt.c.
#define RPCB_boolean_sz (1) |
Definition at line 89 of file rpcb_clnt.c.
#define RPCB_getaddrargs_sz |
Definition at line 100 of file rpcb_clnt.c.
#define RPCB_getaddrres_sz RPCB_addr_sz |
Definition at line 111 of file rpcb_clnt.c.
#define RPCB_getportres_sz RPCB_port_sz |
Definition at line 104 of file rpcb_clnt.c.
#define RPCB_mappingargs_sz |
Definition at line 98 of file rpcb_clnt.c.
#define RPCB_MAXOWNERLEN sizeof(RPCB_OWNER_STRING) |
Definition at line 80 of file rpcb_clnt.c.
#define RPCB_netid_sz (1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) |
Definition at line 91 of file rpcb_clnt.c.
#define RPCB_OWNER_STRING "0" |
Definition at line 79 of file rpcb_clnt.c.
#define RPCB_ownerstring_sz (1 + XDR_QUADLEN(RPCB_MAXOWNERLEN)) |
Definition at line 93 of file rpcb_clnt.c.
#define RPCB_port_sz (1) |
Definition at line 88 of file rpcb_clnt.c.
#define RPCB_program_sz (1) |
Definition at line 85 of file rpcb_clnt.c.
#define RPCB_protocol_sz (1) |
Definition at line 87 of file rpcb_clnt.c.
#define RPCB_setres_sz RPCB_boolean_sz |
Definition at line 105 of file rpcb_clnt.c.
#define RPCB_version_sz (1) |
Definition at line 86 of file rpcb_clnt.c.
#define RPCBIND_PORT (111u) |
Definition at line 42 of file rpcb_clnt.c.
#define RPCBIND_PROGRAM (100000u) |
Definition at line 41 of file rpcb_clnt.c.
#define RPCBIND_SOCK_PATHNAME "/var/run/rpcbind.sock" |
Definition at line 39 of file rpcb_clnt.c.
#define RPCBVERS_2 (2u) |
Definition at line 44 of file rpcb_clnt.c.
#define RPCBVERS_3 (3u) |
Definition at line 45 of file rpcb_clnt.c.
#define RPCBVERS_4 (4u) |
Definition at line 46 of file rpcb_clnt.c.
anonymous enum |
Definition at line 48 of file rpcb_clnt.c.
EXPORT_SYMBOL_GPL | ( | rpcb_getport_async | ) |
Definition at line 328 of file rpcb_clnt.c.
rpcb_getport_async - obtain the port for a given RPC service on a given host : task that is waiting for portmapper request
This one can be called for an ongoing RPC request, and can be used in an async (rpciod) context.
Definition at line 647 of file rpcb_clnt.c.
Definition at line 178 of file rpcb_clnt.c.
rpcb_register - set or unset a port registration with the local rpcbind svc : target network namespace : RPC program number to bind : RPC version number to bind : transport protocol to register : port value to register
Returns zero if the registration request was dispatched successfully and the rpcbind daemon returned success. Otherwise, returns an errno value that reflects the nature of the error (request could not be dispatched, timed out, or rpcbind returned an error).
RPC services invoke this function to advertise their contact information via the system's rpcbind daemon. RPC services invoke this function once for each [program, version, transport] tuple they wish to advertise.
Callers may also unregister RPC services that are no longer available by setting the passed-in port to zero. This removes all registered transports for [program, version] from the local rpcbind database.
This function uses rpcbind protocol version 2 to contact the local rpcbind daemon.
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).
Definition at line 430 of file rpcb_clnt.c.
int rpcb_v4_register | ( | struct net * | net, |
const u32 | program, | ||
const u32 | version, | ||
const struct sockaddr * | address, | ||
const char * | netid | ||
) |
rpcb_v4_register - set or unset a port registration with the local rpcbind : target network namespace : RPC program number of service to (un)register
Returns zero if the registration request was dispatched successfully and the rpcbind daemon returned success. Otherwise, returns an errno value that reflects the nature of the error (request could not be dispatched, timed out, or rpcbind returned an error).
RPC services invoke this function to advertise their contact information via the system's rpcbind daemon. RPC services invoke this function once for each [program, version, address, netid] tuple they wish to advertise.
Callers may also unregister RPC services that are registered at a specific address by setting the port number in to zero. They may unregister all registered protocol families at once for a service by passing a NULL argument. If is "" then all netids for [program, version, address] are unregistered.
This function uses rpcbind protocol version 4 to contact the local rpcbind daemon. The local rpcbind daemon must support version 4 of the rpcbind protocol in order for these functions to register a service successfully.
Supported netids include "udp" and "tcp" for UDP and TCP over IPv4, and "udp6" and "tcp6" for UDP and TCP over IPv6, respectively.
The contents of determine the address family and the port to be registered. The usual practice is to pass INADDR_ANY as the raw address, but specifying a non-zero address is also supported by this API if the caller wishes to advertise an RPC service on a specific network interface.
Note that passing in INADDR_ANY does not create the same service registration as IN6ADDR_ANY. The former advertises an RPC service on any IPv4 address, but not on IPv6. The latter advertises the service on all IPv4 and IPv6 addresses.
Definition at line 569 of file rpcb_clnt.c.