Expand description
ONC RPC (RFC 5531) and the portmapper/rpcbind programs (RFC 1833), shared by both roles: XDR, call and reply messages, TCP record marking, and the PMAP v2 / RPCBIND v3-v4 argument and result bodies. Every length the peer announces is bounded before use.
Structs§
Enums§
- Accepted
- What an accepted call came to.
Constants§
- HIGH_
VERSION - IPPROTO_
TCP - IPPROTO_
UDP - LOW_
VERSION - The portmapper versions spoken: PMAP 2, RPCBIND 3 and 4.
- MAX_
AUTH - Credential and verifier bodies are at most 400 bytes (RFC 5531 §8.2).
- MAX_
FRAGMENTS - Fragments one TCP record may be split into.
- MAX_
MAPPINGS - Mappings one answer may carry.
- MAX_
RECORD - One RPC message (a whole TCP record, or a UDP datagram) is at most this long. Nothing a portmapper exchanges comes near it; a DUMP of 1000 mappings is about 60 KiB.
- MAX_
STRING - XDR strings (netids, universal addresses, owners) are at most this long.
- PORT
- PROGRAM
Functions§
- accepted_
reply - call_
message - credential_
json - An RPC credential, as the handler is shown it.
- entry_
list - RPCBIND v4 GETADDRLIST result: one
rpcb_entryper mapping. - host_
for - The host part of a universal address for a mapping, as a client reaching
localsees it. - mapping_
from_ json - A mapping as the handler writes it:
{program, version, protocol, port, owner?}with protocol one of tcp/udp/tcp6/udp6. - mapping_
json - netid_
of - parse_
call - A message that is a call;
Ok(None)for a reply (which a server ignores). - parse_
reply - A reply as the client reads it: its xid and either the result body or why there is none.
- parse_
uaddr - pmaplist
- PMAP v2 DUMP result: the linked list of mappings (only tcp and udp have a v2 form).
- program_
name - Well-known program numbers, so the handler sees a name beside the number.
- protocol_
of - read_
pmap - PMAP v2
pmap(prog, vers, prot, port). - read_
pmaplist - Read a PMAP v2 DUMP result.
- read_
record - Read one record, refusing before reading past the bounds.
- read_
rpcb - read_
rpcblist - Read an RPCBIND DUMP result.
- record
- TCP record marking: one fragment, last-fragment bit set.
- rpc_
mismatch_ reply - MSG_DENIED / RPC_MISMATCH: this server speaks RPC version 2 only.
- rpcblist
- RPCBIND DUMP result.
- uaddr
- A universal address:
h1.h2.h3.h4.p1.p2, or an IPv6 address and.p1.p2. - write_
pmap - write_
rpcb - xid_of
- Just the xid, for answering a call too malformed to parse.