cat_dev/mion/proto/mod.rs
1//! This module is a wrapper for all the underlying protocol types used for
2//! interacting with MIONs.
3//!
4//! In general as a user you probably don't need to interact with this directly
5//! except for maybe importing a few types that APIs return. In general you
6//! probably want to use the functions available in the other modules under
7//! [`crate::mion`] in order to interact with the MIONs in a safe way.
8//!
9//! Each of these roughly correlate to one MION service, e.g.:
10//!
11//! - port 7974 UDP is the "control" port, which can be used for discovery. So
12//! for communicating on that port you access:
13//! [`crate::mion::proto::control`].
14//! *note: some tools using session manager improperly use the ATAPI port
15//! which while normally being shared just for the TCP side, can in theory
16//! be configured differently.*
17//!
18//! - port 7978 TCP on the other hand is used by `mionps` to look up
19//! parameters, so we call it the "parameter" port, so you can access types
20//! for communicating on that port under: [`crate::mion::proto::parameter`].
21//! The official tools don't have a way of specifying this port, but it is
22//! actually configurable in `http://<mionip>/setup.cgi`. Specifically you
23//! can change it under "Parameter Space".
24
25pub mod cgis;
26pub mod control;
27pub mod images;
28pub mod parameter;
29
30/// The port the MION uses for 'control' commands.
31pub const DEFAULT_MION_CONTROL_PORT: u16 = 7974;
32/// The port the MION uses for parameter commands.
33pub const DEFAULT_MION_PARAMETER_PORT: u16 = 7978;
34
35/// The amount of seconds we'll wait for a MION Control board to respond to a
36/// ping.
37pub const MION_ANNOUNCE_TIMEOUT_SECONDS: u64 = 10;
38/// MION timeouts for sending packets directly to the MION, on the parameter
39/// port.
40pub const MION_PARAMETER_TIMEOUT_SECONDS: u64 = 5;