Skip to main content

onc_rpcbind/
lib.rs

1//! Portmapper v2 ([RFC 1057] appendix A) and rpcbind v3/v4 ([RFC 1833])
2//! clients for ONC RPC service discovery.
3//!
4//! The portmapper (program 100000, port 111) maps a (program, version,
5//! protocol) triple onto the TCP or UDP port serving it.  `DUMP` returns the
6//! entire mapping table to any caller, which makes it the fastest way to
7//! enumerate what RPC services a host runs and on which ports.
8//!
9//! rpcbind extends the portmapper with versioned protocol bindings.  Version 3
10//! adds `GETTIME` (server clock); version 4 adds `GETSTAT` (per-version
11//! operational statistics).
12//!
13//! This crate depends on [`onc_rpc_client`] for the generic RPC client and
14//! transport layer -- the portmapper is program 100000 (a specific RPC
15//! service), not part of the RPC machinery itself.
16//!
17//! [RFC 1057]: https://www.rfc-editor.org/rfc/rfc1057
18//! [RFC 1833]: https://www.rfc-editor.org/rfc/rfc1833
19
20mod client;
21mod error;
22/// Well-known RPC program number table.
23pub mod programs;
24/// rpcbind v3/v4 types and client ([RFC 1833]).
25///
26/// [RFC 1833]: https://www.rfc-editor.org/rfc/rfc1833
27pub mod rpcbind;
28/// Portmapper v2 XDR types ([RFC 1057] appendix A).
29///
30/// [RFC 1057]: https://www.rfc-editor.org/rfc/rfc1057
31pub mod types;
32
33pub use client::PortmapperClient;
34pub use error::PortmapError;
35pub use programs::{known_programs, program_name, security_note};
36pub use rpcbind::{Netbuf, RpcbAddrEntry, RpcbAddrList, RpcbEntry, RpcbList, RpcbRmtCallArgs, RpcbRmtCallRes, RpcbStatByvers, RpcbindClient, RpcbindStatEntry};
37pub use types::{IPPROTO_TCP, IPPROTO_UDP, PMAP_PORT, PMAP_PROG, PROGRAM, VERSION, call_args, call_result, mapping, pmaplist};