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
41
42
43
44
45
46
47
use super::*;
/// ICMPv6 parameter problem header.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub struct ParameterProblemHeader {
/// The code can offer additional informations about what kind of parameter
/// problem caused the error.
pub code: ParameterProblemCode,
/// Identifies the octet offset within the
/// invoking packet where the error was detected.
///
/// The pointer will point beyond the end of the ICMPv6
/// packet if the field in error is beyond what can fit
/// in the maximum size of an ICMPv6 error message.
pub pointer: u32,
}
#[cfg(test)]
mod test {
use super::*;
use alloc::format;
#[test]
fn clone_eq() {
let value = ParameterProblemHeader {
code: ParameterProblemCode::ErroneousHeaderField,
pointer: 0,
};
assert_eq!(value.clone(), value);
}
#[test]
fn debug() {
let value = ParameterProblemHeader {
code: ParameterProblemCode::ErroneousHeaderField,
pointer: 0,
};
assert_eq!(
format!("{:?}", value),
format!(
"ParameterProblemHeader {{ code: {:?}, pointer: {:?} }}",
value.code, value.pointer
)
);
}
}