1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Cross-platform networking primitives shared by `epics-ca-rs`,
//! `epics-pva-rs`, and `epics-bridge-rs`.
//!
//! Two layers, split by whether they own a socket — the same split
//! `epics_pva_rs::server_native` makes for the same reason:
//!
//! * **Wire constants.** Address literals the protocols embed in the
//! datagrams they build ([`ORIGIN_TAG_MCAST_GROUP`]). No socket, no
//! `tokio`, no `socket2` — compiles for every target, RTEMS and VxWorks
//! included.
//! * **Socket-bearing modules** — `async_udp_v4`, `iface_map`,
//! `loopback_mcast`. Built on `tokio::net` / `socket2` / `if-addrs`, none
//! of which cross to `armv7-rtems-eabihf` or the `*-wrs-vxworks*` triples,
//! so they are gated off `epics_embedded_target` and are otherwise
//! host-only. Named in code spans rather than linked for exactly that
//! reason: this module doc is compiled on every target, the three modules
//! are not, and a link from the one to the other cannot resolve on an
//! embedded doc build. The rendered host page still reaches them through
//! its own Modules table.
//!
//! The socket modules:
//!
//! * `iface_map` — enumerate IPv4 network interfaces with their
//! `ifindex`, broadcast/netmask info, and multicast capability.
//! Used by every UDP search/beacon path to plan per-NIC fanout.
//!
//! * `async_udp_v4` — cross-platform async UDP socket with
//! per-NIC TX/RX accuracy. On Unix (Linux + macOS) we use a single
//! wildcard socket plus `IP_PKTINFO` cmsg (pvxs convention); on
//! Windows we use a `Vec` of per-NIC bound sockets (libca
//! convention). Both paths expose the same `AsyncUdpV4` surface.
use Ipv4Addr;
/// pvxs ORIGIN_TAG forwarding multicast group. Mirrors the literal in
/// `udp_collector.cpp:127`: `"224.0.0.128,1@127.0.0.1"` — TTL=1,
/// iface=loopback. We expose the group separately so callers can
/// embed it in send addresses without re-parsing the pvxs string.
///
/// Lives here rather than in `loopback_mcast` because it is *wire data*,
/// not a socket: the PVA SEARCH decoder writes it into the destination of
/// every ORIGIN_TAG re-broadcast it decides on, and that decoder runs on
/// `epics_embedded_target` where the socket half of this module does not
/// exist. Gating a constant behind a socket module is what forced the PVA
/// decoder to stay host-only; the fix is to move the constant, not to copy
/// it.
pub const ORIGIN_TAG_MCAST_GROUP: Ipv4Addr = new;
pub use ;
pub use ;
pub use bind_loopback_mcast;