#[repr(C)]pub struct mxr_config_t {
pub target_ip: *const c_char,
pub port: u16,
pub broadcast: bool,
pub local_ip: *const c_char,
pub interface: *const c_char,
pub name: *const c_char,
pub uid: *const c_char,
pub uid_path: *const c_char,
}Expand description
How a client finds the network.
Zeroing the whole struct asks for the default: multicast discovery on whichever interface the host picks, which is the right answer on a machine with one network and an arbitrary one on any other.
Fields§
§target_ip: *const c_charWhere to send. Null means the multicast group, or the interface’s
broadcast address when broadcast is set.
port: u16UDP port. Zero means the default for the selected mode.
broadcast: boolUse broadcast rather than multicast.
local_ip: *const c_charSelects the interface by address, as text. Null lets the host choose.
It decides both which interface frames leave by and which one they are accepted on. Getting it wrong on a multi-homed host fails one-sidedly: devices are still discovered, because their broadcasts arrive by any route, while every request this client sends leaves by the wrong interface and is never answered.
interface: *const c_charSelects the interface by name, taking precedence over local_ip.
An interface with no address of its own - a tagged VLAN - can be named only this way, and only on Linux.
name: *const c_charThe name this client advertises to devices. Null means a default.
uid: *const c_charThis client’s identifier, in the form mxr_uid_to_string() writes.
Null loads it from uid_path, generating and storing one on first run.
It must be stable across restarts, or every peer counts each run as a
new client.
mxr_uid_to_string(): crate::mxr_uid_to_string
uid_path: *const c_charWhere the identifier is kept. Null means .mxr-uid in the user’s home
directory.