Skip to main content

batman_robin/model/
originator.rs

1use macaddr::MacAddr6;
2
3/// Represents an originator node in the batman-adv mesh network.
4///
5/// An originator is a node that advertises itself or forwards packets for other nodes.
6/// This struct contains information about the originator's MAC address, routing metrics,
7/// and the interface used to reach it.
8#[derive(Debug, Clone)]
9pub struct Originator {
10    /// MAC address of the originator node.
11    /// Corresponds to `BATADV_ATTR_ORIG_ADDRESS`.
12    pub originator: MacAddr6,
13
14    /// MAC address of the next hop towards the originator.
15    /// Corresponds to `BATADV_ATTR_NEIGH_ADDRESS`.
16    pub next_hop: MacAddr6,
17
18    /// Outgoing interface name or index used to reach the originator.
19    /// Corresponds to `BATADV_ATTR_HARD_IFNAME` (or the interface index).
20    pub outgoing_if: String,
21
22    /// Time since the originator was last seen, in milliseconds.
23    /// Corresponds to `BATADV_ATTR_LAST_SEEN_MSECS`.
24    pub last_seen_ms: u32,
25
26    /// Optional TQ (link quality) metric towards this originator.
27    /// Corresponds to `BATADV_ATTR_TQ`.
28    pub tq: Option<u8>,
29
30    /// Optional throughput value towards this originator.
31    /// Corresponds to `BATADV_ATTR_THROUGHPUT`.
32    pub throughput: Option<u32>,
33
34    /// Indicates whether this originator is considered the best next-hop router.
35    /// Corresponds to `BATADV_ATTR_ROUTER`.
36    pub is_best: bool,
37}