netlink_packet_route/prefix/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: MIT

use netlink_packet_utils::nla::NlaError;
use netlink_packet_utils::DecodeError;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum PrefixError {
    #[error("Invalid PREFIX_ADDRESS, unexpected payload length: {payload_length}")]
    InvalidPrefixAddress { payload_length: usize },

    #[error("Invalid PREFIX_CACHEINFO: {0:?}")]
    InvalidPrefixCacheInfo(DecodeError),

    #[error(transparent)]
    ParseNla(#[from] NlaError),

    #[error(transparent)]
    Other(#[from] DecodeError),
}