firecracker_rs_sdk/models/
network_interface.rs

1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5use super::rate_limiter;
6
7/// Defines a network interface.
8#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
9pub struct NetworkInterface {
10    /// If this field is set, the device model will reply to
11    /// HTTP GET requests sent to the MMDS address via this interface.
12    /// In this case, both ARP requests for 169.254.169.254 and TCP
13    /// segments heading to the same address are intercepted by the
14    /// device model, and do not reach the associated TAP device.
15    // pub allow_mmds_requests: Option<bool>,
16
17    /// guest mac
18    #[serde(rename = "guest_mac", skip_serializing_if = "Option::is_none")]
19    pub guest_mac: Option<String>,
20
21    /// Host level path for the guest network interface
22    /// Required: true
23    #[serde(rename = "host_dev_name")]
24    pub host_dev_name: PathBuf,
25
26    /// iface id
27    /// Required: true
28    #[serde(rename = "iface_id")]
29    pub iface_id: String,
30
31    /// rx rate limiter
32    #[serde(rename = "rx_rate_limiter", skip_serializing_if = "Option::is_none")]
33    pub rx_rate_limiter: Option<rate_limiter::RateLimiter>,
34
35    /// tx rate limiter
36    #[serde(rename = "tx_rate_limiter", skip_serializing_if = "Option::is_none")]
37    pub tx_rate_limiter: Option<rate_limiter::RateLimiter>,
38}