From d1519b181639b5cb321558a7f251c70a6479d4a2 Mon Sep 17 00:00:00 2001 From: Kyle Simpson Date: Wed, 10 Jan 2024 12:54:09 +0000 Subject: [PATCH] Self review: missed some comments --- nexus/src/app/sagas/instance_common.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nexus/src/app/sagas/instance_common.rs b/nexus/src/app/sagas/instance_common.rs index f885088745..95f7a1e689 100644 --- a/nexus/src/app/sagas/instance_common.rs +++ b/nexus/src/app/sagas/instance_common.rs @@ -261,6 +261,11 @@ pub async fn instance_ip_get_instance_state( Ok(sled_id) } +/// Adds a NAT entry to DPD, routing packets bound for `target_ip` to a +/// target sled. +/// +/// This call is a no-op if `sled_uuid` is `None` or the saga is explicitly +/// set to be inactive in event of double attach/detach (`!target_ip.do_saga`). pub async fn instance_ip_add_nat( sagactx: &NexusActionContext, serialized_authn: &authn::saga::Serialized, @@ -309,6 +314,10 @@ pub async fn instance_ip_add_nat( Ok(()) } +/// Remove a single NAT entry from DPD, dropping packets bound for `target_ip`. +/// +/// This call is a no-op if `sled_uuid` is `None` or the saga is explicitly +/// set to be inactive in event of double attach/detach (`!target_ip.do_saga`). pub async fn instance_ip_remove_nat( sagactx: &NexusActionContext, serialized_authn: &authn::saga::Serialized, @@ -343,6 +352,11 @@ pub async fn instance_ip_remove_nat( Ok(()) } +/// Inform OPTE that it should start sending/receiving traffic on a given IP +/// address. +/// +/// This call is a no-op if `sled_uuid` is `None` or the saga is explicitly +/// set to be inactive in event of double attach/detach (`!target_ip.do_saga`). pub async fn instance_ip_add_opte( sagactx: &NexusActionContext, authz_instance: &authz::Instance, @@ -393,6 +407,11 @@ pub async fn instance_ip_add_opte( Ok(()) } +/// Inform OPTE that it should cease sending/receiving traffic on a given IP +/// address. +/// +/// This call is a no-op if `sled_uuid` is `None` or the saga is explicitly +/// set to be inactive in event of double attach/detach (`!target_ip.do_saga`). pub async fn instance_ip_remove_opte( sagactx: &NexusActionContext, authz_instance: &authz::Instance,