flowparser_sflow/flow_records/
extended_nat.rs1use nom::IResult;
2use serde::{Deserialize, Serialize};
3
4use crate::datagram::{AddressType, parse_address};
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7pub struct ExtendedNat {
8 pub src_address: AddressType,
9 pub dst_address: AddressType,
10}
11
12pub(crate) fn parse_extended_nat(input: &[u8]) -> IResult<&[u8], ExtendedNat> {
13 let (input, src_address) = parse_address(input)?;
14 let (input, dst_address) = parse_address(input)?;
15
16 Ok((
17 input,
18 ExtendedNat {
19 src_address,
20 dst_address,
21 },
22 ))
23}