Skip to content

Commit

Permalink
Self review: missed some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Jan 10, 2024
1 parent f5a50b0 commit d1519b1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nexus/src/app/sagas/instance_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d1519b1

Please sign in to comment.