diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1091,4 +1091,30 @@ mod tests { ); Ok(()) } + + #[test] + fn test_serialize_pap_authenticate_ack() -> Result<()> { + let authenticate_ack = PPPoEFullPkt::new_ppp( + [0x00, 0x00, 0x5e, 0x00, 0x53, 0x02].into(), + [0x00, 0x00, 0x5e, 0x00, 0x53, 0x01].into(), + 1, + PPPFullPkt::new_pap(PAPFullPkt::new_authenticate_ack( + 0x41, + PAPString("ok".into()), + )), + ); + + let mut buf = Vec::new(); + authenticate_ack.serialize(&mut buf)?; + + assert_eq!( + &buf, + &[ + 0x00, 0x00, 0x5e, 0x00, 0x53, 0x02, 0x00, 0x00, 0x5e, 0x00, 0x53, 0x01, 0x88, 0x64, + 0x11, 0x00, 0x00, 0x01, 0x00, 0x09, 0xc0, 0x23, 0x02, 0x41, 0x00, 0x07, 0x02, 0x6f, + 0x6b + ] + ); + Ok(()) + } } |