Skip to content

Commit 4301011

Browse files
committed
Add SpHandler::unlock method
1 parent 831d4be commit 4301011

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

gateway-messages/src/sp_impl.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use crate::MessageKind;
2929
use crate::MgsError;
3030
use crate::MgsRequest;
3131
use crate::MgsResponse;
32+
use crate::MonorailError;
3233
use crate::PowerState;
3334
use crate::PowerStateTransition;
3435
use crate::RotBootInfo;
@@ -46,6 +47,8 @@ use crate::SpUpdatePrepare;
4647
use crate::StartupOptions;
4748
use crate::SwitchDuration;
4849
use crate::TlvPage;
50+
use crate::UnlockChallenge;
51+
use crate::UnlockResponse;
4952
use crate::UpdateChunk;
5053
use crate::UpdateId;
5154
use crate::UpdateStatus;
@@ -417,6 +420,15 @@ pub trait SpHandler {
417420
fn start_host_flash_hash(&mut self, slot: u16) -> Result<(), SpError>;
418421

419422
fn get_host_flash_hash(&mut self, slot: u16) -> Result<[u8; 32], SpError>;
423+
424+
/// Unlocks the tech port if the challenge and response are compatible
425+
fn unlock(
426+
&mut self,
427+
vid: Self::VLanId,
428+
challenge: UnlockChallenge,
429+
response: UnlockResponse,
430+
time_sec: u32,
431+
) -> Result<(), MonorailError>;
420432
}
421433

422434
/// Handle a single incoming message.
@@ -1457,6 +1469,16 @@ mod tests {
14571469
) -> Result<[u8; 32], SpError> {
14581470
unimplemented!()
14591471
}
1472+
1473+
fn unlock(
1474+
&mut self,
1475+
_vid: Self::VLanId,
1476+
_challenge: UnlockChallenge,
1477+
_response: UnlockResponse,
1478+
_time_sec: u32,
1479+
) -> Result<(), MonorailError> {
1480+
unimplemented!()
1481+
}
14601482
}
14611483

14621484
#[cfg(feature = "std")]

0 commit comments

Comments
 (0)