Skip to content

Commit 2bb0b3a

Browse files
committed
bfd modes
1 parent c8df023 commit 2bb0b3a

File tree

8 files changed

+41
-10
lines changed

8 files changed

+41
-10
lines changed

nexus/src/app/bfd.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
};
99

1010
use crate::external_api::params;
11-
use mg_admin_client::types::{AddBfdPeerRequest, PeerState};
11+
use mg_admin_client::types::{AddBfdPeerRequest, PeerState, SessionMode};
1212
use nexus_db_queries::context::OpContext;
1313
use nexus_types::external_api::shared::{BfdState, BfdStatus};
1414
use omicron_common::api::{
@@ -62,6 +62,10 @@ impl super::Nexus {
6262
listen: session.local.unwrap_or(Ipv4Addr::UNSPECIFIED.into()),
6363
peer: session.remote,
6464
required_rx: session.required_rx,
65+
mode: match session.mode {
66+
params::BfdMode::SingleHop => SessionMode::SingleHop,
67+
params::BfdMode::MultiHop => SessionMode::MultiHop,
68+
},
6569
})
6670
.await
6771
.map_err(|e| {

nexus/tests/integration_tests/endpoints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ pub static DEMO_BFD_ENABLE: Lazy<params::BfdSessionEnable> =
587587
detection_threshold: 3,
588588
required_rx: 1000000,
589589
switch: "switch0".parse().unwrap(),
590+
mode: params::BfdMode::MultiHop,
590591
});
591592

592593
pub static DEMO_BFD_DISABLE: Lazy<params::BfdSessionDisable> =

nexus/types/src/external_api/params.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,13 @@ pub struct BgpStatusSelector {
17881788
pub name_or_id: NameOrId,
17891789
}
17901790

1791+
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
1792+
#[serde(rename_all = "snake_case")]
1793+
pub enum BfdMode {
1794+
SingleHop,
1795+
MultiHop,
1796+
}
1797+
17911798
/// Information about a bidirectional forwarding detection (BFD) session.
17921799
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
17931800
pub struct BfdSessionEnable {
@@ -1809,6 +1816,9 @@ pub struct BfdSessionEnable {
18091816

18101817
/// The switch to enable this session on. Must be `switch0` or `switch1`.
18111818
pub switch: Name,
1819+
1820+
/// Select either single-hop (RFC 5881) or multi-hop (RFC 5883)
1821+
pub mode: BfdMode,
18121822
}
18131823

18141824
/// Information needed to disable a BFD session

openapi/nexus.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8579,6 +8579,13 @@
85798579
"serial"
85808580
]
85818581
},
8582+
"BfdMode": {
8583+
"type": "string",
8584+
"enum": [
8585+
"single_hop",
8586+
"multi_hop"
8587+
]
8588+
},
85828589
"BfdSessionDisable": {
85838590
"description": "Information needed to disable a BFD session",
85848591
"type": "object",
@@ -8618,6 +8625,14 @@
86188625
"type": "string",
86198626
"format": "ip"
86208627
},
8628+
"mode": {
8629+
"description": "Select either single-hop (RFC 5881) or multi-hop (RFC 5883)",
8630+
"allOf": [
8631+
{
8632+
"$ref": "#/components/schemas/BfdMode"
8633+
}
8634+
]
8635+
},
86218636
"remote": {
86228637
"description": "Address of the remote peer to establish a BFD session with.",
86238638
"type": "string",
@@ -8640,6 +8655,7 @@
86408655
},
86418656
"required": [
86428657
"detection_threshold",
8658+
"mode",
86438659
"remote",
86448660
"required_rx",
86458661
"switch"

package-manifest.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ source.repo = "maghemite"
446446
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
447447
# building `ddm-admin-client` (which will instruct you to update
448448
# `tools/maghemite_openapi_version`).
449-
source.commit = "b451569a2a82cdd3cf354a348929010a2265b8e5"
449+
source.commit = "11ab054e44a5169b7f6d9014f1e2d8d8ccd04c01"
450450
# The SHA256 digest is automatically posted to:
451451
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/maghemite.sha256.txt
452452
source.sha256 = "8f8838e87ec10e1b2b7e0df0a6c4594d263d5c2192734ab30bacc725fc88a794"
@@ -462,7 +462,7 @@ source.repo = "maghemite"
462462
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
463463
# building `ddm-admin-client` (which will instruct you to update
464464
# `tools/maghemite_openapi_version`).
465-
source.commit = "b451569a2a82cdd3cf354a348929010a2265b8e5"
465+
source.commit = "11ab054e44a5169b7f6d9014f1e2d8d8ccd04c01"
466466
# The SHA256 digest is automatically posted to:
467467
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/mg-ddm.sha256.txt
468468
source.sha256 = "325891a260dda5730947b0d7bbd27e6f6ac22b725a1d0eff31db528dae9c02ee"
@@ -477,10 +477,10 @@ source.repo = "maghemite"
477477
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
478478
# building `ddm-admin-client` (which will instruct you to update
479479
# `tools/maghemite_openapi_version`).
480-
source.commit = "b451569a2a82cdd3cf354a348929010a2265b8e5"
480+
source.commit = "11ab054e44a5169b7f6d9014f1e2d8d8ccd04c01"
481481
# The SHA256 digest is automatically posted to:
482482
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/mg-ddm.sha256.txt
483-
source.sha256 = "da7fa95903e728d03d0075533c746d8b65bf185228fc45ae55faa13852541cda"
483+
source.sha256 = "249d3abcb7c2ee3ebc0817eae3d43f290362c566ca20b83134235f914068b758"
484484
output.type = "zone"
485485
output.intermediate_only = true
486486

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
COMMIT="b451569a2a82cdd3cf354a348929010a2265b8e5"
1+
COMMIT="11ab054e44a5169b7f6d9014f1e2d8d8ccd04c01"
22
SHA2="0b0dbc2f8bbc5d2d9be92d64c4865f8f9335355aae62f7de9f67f81dfb3f1803"

tools/maghemite_mg_openapi_version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
COMMIT="b451569a2a82cdd3cf354a348929010a2265b8e5"
2-
SHA2="515b4c65c3785a558b37857e8bea128d0521b9d85290d2f2c272adbe561b0929"
1+
COMMIT="11ab054e44a5169b7f6d9014f1e2d8d8ccd04c01"
2+
SHA2="11a659afb82c65caa3e773f73713c33c3066ab107f84b82f81721ef31eaede0b"

tools/maghemite_mgd_checksums

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
CIDL_SHA256="da7fa95903e728d03d0075533c746d8b65bf185228fc45ae55faa13852541cda"
2-
MGD_LINUX_SHA256="45696f58fa6e6142479c9ba19145a3d1134302a414354422f0560788f9558743"
1+
CIDL_SHA256="249d3abcb7c2ee3ebc0817eae3d43f290362c566ca20b83134235f914068b758"
2+
MGD_LINUX_SHA256="1204388cb93e4fe733189ef0ba37039b3c0058c07c77e06303162734cd1b41c4"

0 commit comments

Comments
 (0)