1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! IPsec Authentication Header (AH, RFC 4302) Layer 3 wire builder.
//!
//! Serializes an [`AhSpec`] into an RFC 4302 IPsec Authentication Header payload encapsulated
//! directly inside IPv4 or IPv6 with protocol / Next Header number `51` (`0x33`). The wire builder
//! constructs a 24-byte base AH header containing the 8-bit `Next Header` (`NEXT_HEADER`, default
//! `59`), 8-bit `Payload Len` (`4` in 32-bit words minus 2), 16-bit zeroed `Reserved` field, 32-bit
//! big-endian `SPI` (default `0x2000`), 32-bit big-endian `Sequence Number` (`SEQ`, default `1`),
//! and 96-bit (or user-supplied) Integrity Check Value (`ICV`), followed by the authenticated payload.
//!
//! Canonical `.fasm` syntax:
//! `a -> b AH [SPI <u32>] [SEQ <u32>] [ICV "<hex>"] [NEXT_HEADER <u8>] [PAYLOAD "<str>" | HEXPAYLOAD "<hex>"]`
use crate*;
use Vec;
/// Builds an RFC 4302 IPsec Authentication Header (`AH`) packet body and returns `(bytes, 51)`.