Skip to main content

SSHStampConfig

Struct SSHStampConfig 

Source
pub struct SSHStampConfig {
Show 13 fields pub hostkey: SignKey, pub pubkeys: [Option<Ed25519PubKey>; 1], pub wifi_ap_ssid: String<32>, pub wifi_ap_pw: String<63>, pub wifi_ap_band: u8, pub wifi_sta_ssid: String<32>, pub wifi_sta_pw: String<63>, pub mac: [u8; 6], pub ipv4_static: Option<StaticConfigV4>, pub ipv6_static: Option<StaticConfigV6>, pub uart_pins: UartPins, pub uart_params: UartParams, pub first_login: bool,
}

Fields§

§hostkey: SignKey§pubkeys: [Option<Ed25519PubKey>; 1]

Authentication: only pubkey-based auth supported

§wifi_ap_ssid: String<32>

WiFi Access Point Mode

§wifi_ap_pw: String<63>§wifi_ap_band: u8

AP band mode (2.4GHz / 5GHz / Auto). Ignored on chips without 5GHz.

§wifi_sta_ssid: String<32>

Station Mode

§wifi_sta_pw: String<63>§mac: [u8; 6]

Networking MAC address. Special values:

  • [0xFF; 6]: Generate random MAC on each boot
  • Otherwise: Use the stored MAC (defaults to hardware eFuse MAC)
§ipv4_static: Option<StaticConfigV4>

None for DHCP

§ipv6_static: Option<StaticConfigV6>§uart_pins: UartPins

UART

§uart_params: UartParams

UART line parameters (baud, data bits, parity, stop bits) for the serial bridge. Settable via the SSH_STAMP_UART_* env vars.

§first_login: bool

True until a pubkey is provisioned. Further changes require authentication.

Implementations§

Source§

impl SSHStampConfig

Source

pub const CURRENT_VERSION: u8 = 12

Bump this when the format changes

Source

pub fn is_mac_random(&self) -> bool

Check if configured for random MAC on each boot

Source

pub fn resolve_mac(&self) -> Result<[u8; 6]>

Get the MAC address to use (resolves random sentinel)

§Errors

Returns an error if the RNG fails

Source

pub fn new(default_mac: [u8; 6], uart_pins: UartPins) -> Result<Self>

Creates a new config with default parameters.

default_mac is the MAC the platform wants the device to default to (typically read from hardware OTP/eFuse). Stored as-is in the config; may be overwritten later via the SSH_STAMP_WIFI_MAC_* env vars.

uart_pins is the TX/RX pin assignment, which is target-specific and must be provided by the port binary.

§Errors

Will only fail on RNG failure.

Trait Implementations§

Source§

impl Debug for SSHStampConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SSHStampConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'de> SSHDecode<'de> for SSHStampConfig

Source§

fn dec<S>(s: &mut S) -> WireResult<Self>
where S: SSHSource<'de>,

Decode data Read more
Source§

impl SSHEncode for SSHStampConfig

Source§

fn enc(&self, s: &mut dyn SSHSink) -> WireResult<()>

Encode data Read more
Source§

impl StructuralPartialEq for SSHStampConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.