Skip to main content

Module wire

Module wire 

Source
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§

Call
Mapping
Reader
Rpcb
RPCBIND rpcb (prog, vers, netid, addr, owner).
Writer

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_entry per mapping.
host_for
The host part of a universal address for a mapping, as a client reaching local sees 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.