Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ digest = "0.10.7"
dns-server = { path = "dns-server" }
dns-server-api = { path = "dns-server-api" }
dns-service-client = { path = "clients/dns-service-client" }
dpd-client = { git = "https://github.com/oxidecomputer/dendrite", rev = "738c80d18d5e94eda367440ade7743e9d9f124de" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

picks up current dpd-client HEAD commit

dpd-client = { git = "https://github.com/oxidecomputer/dendrite", rev = "6ba23e71121c196e1e3c4e0621ba7a6f046237c7" }
dropshot = { version = "0.16.3", features = [ "usdt-probes" ] }
dyn-clone = "1.0.20"
either = "1.15.0"
Expand Down
12 changes: 12 additions & 0 deletions common/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ pub const AZ_PREFIX: u8 = 48;
pub const RACK_PREFIX: u8 = 56;
pub const SLED_PREFIX: u8 = 64;

// Multicast constants

/// IPv4 Source-Specific Multicast (SSM) subnet as defined in RFC 4607:
/// <https://tools.ietf.org/html/rfc4607>.
pub const IPV4_SSM_SUBNET: oxnet::Ipv4Net =
oxnet::Ipv4Net::new_unchecked(Ipv4Addr::new(232, 0, 0, 0), 8);

/// IPv6 Source-Specific Multicast (SSM) flag field value as defined in RFC 4607:
/// <https://tools.ietf.org/html/rfc4607>.
/// This is the flags nibble (high nibble of second byte) for FF3x::/32 addresses.
pub const IPV6_SSM_FLAG_FIELD: u8 = 3;

/// maximum possible value for a tcp or udp port
pub const MAX_PORT: u16 = u16::MAX;

Expand Down
22 changes: 21 additions & 1 deletion common/src/vlan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
//! VLAN ID wrapper.

use crate::api::external::Error;
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
use std::fmt;
use std::str::FromStr;

/// The maximum VLAN value (inclusive), as specified by IEEE 802.1Q.
pub const VLAN_MAX: u16 = 4094;

/// Wrapper around a VLAN ID, ensuring it is valid.
#[derive(Debug, Deserialize, Clone, Copy)]
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Copy, JsonSchema)]
#[serde(rename = "VlanId")]
pub struct VlanID(u16);

impl VlanID {
Expand Down Expand Up @@ -44,3 +47,20 @@ impl FromStr for VlanID {
)
}
}

impl From<VlanID> for u16 {
fn from(vlan_id: VlanID) -> u16 {
vlan_id.0
}
}

impl slog::Value for VlanID {
fn serialize(
&self,
_record: &slog::Record,
key: slog::Key,
serializer: &mut dyn slog::Serializer,
) -> slog::Result {
serializer.emit_u16(key, self.0)
}
}
7 changes: 5 additions & 2 deletions end-to-end-tests/src/bin/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use end_to_end_tests::helpers::{
use omicron_test_utils::dev::poll::{CondCheckError, wait_for_condition};
use oxide_client::types::{
ByteCount, DeviceAccessTokenRequest, DeviceAuthRequest, DeviceAuthVerify,
DiskCreate, DiskSource, IpPoolCreate, IpPoolLinkSilo, IpVersion, NameOrId,
SiloQuotasUpdate,
DiskCreate, DiskSource, IpPoolCreate, IpPoolLinkSilo, IpPoolType,
IpVersion, NameOrId, SiloQuotasUpdate,
};
use oxide_client::{
ClientConsoleAuthExt, ClientDisksExt, ClientProjectsExt,
Expand Down Expand Up @@ -53,6 +53,9 @@ async fn run_test() -> Result<()> {
name: pool_name.parse().unwrap(),
description: "Default IP pool".to_string(),
ip_version,
mvlan: None,
pool_type: IpPoolType::Unicast,
switch_port_uplinks: None,
})
.send()
.await?;
Expand Down
7 changes: 5 additions & 2 deletions end-to-end-tests/src/bin/commtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use oxide_client::{
ClientSystemHardwareExt, ClientSystemIpPoolsExt, ClientSystemStatusExt,
ClientVpcsExt,
types::{
IpPoolCreate, IpPoolLinkSilo, IpRange, IpVersion, Name, NameOrId,
PingStatus, ProbeCreate, ProbeInfo, ProjectCreate,
IpPoolCreate, IpPoolLinkSilo, IpPoolType, IpRange, IpVersion, Name,
NameOrId, PingStatus, ProbeCreate, ProbeInfo, ProjectCreate,
UsernamePasswordCredentials,
},
};
Expand Down Expand Up @@ -295,6 +295,9 @@ async fn rack_prepare(
name: pool_name.parse().unwrap(),
description: "Default IP pool".to_string(),
ip_version,
mvlan: None,
pool_type: IpPoolType::Unicast,
switch_port_uplinks: None,
})
.send()
.await?;
Expand Down
2 changes: 2 additions & 0 deletions nexus/db-model/src/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use diesel::pg::Pg;
use diesel::serialize::{self, ToSql};
use diesel::sql_types;
use omicron_common::api::external;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand All @@ -23,6 +24,7 @@ use std::convert::TryFrom;
FromSqlRow,
Serialize,
Deserialize,
JsonSchema,
)]
#[diesel(sql_type = sql_types::BigInt)]
#[repr(transparent)]
Expand Down
Loading
Loading