NDISC flags should be located in ndisc module

Closes: #212
Approved by: whitequark
This commit is contained in:
Dan Robertson 2018-05-26 18:10:27 +00:00 committed by Homu
parent e5a3de210c
commit be32144ba2
3 changed files with 19 additions and 20 deletions

View File

@ -210,21 +210,6 @@ pub(super) mod field {
pub const DEST_ADDR: Field = 24..40;
}
bitflags! {
pub struct RouterFlags: u8 {
const MANAGED = 0b10000000;
const OTHER = 0b01000000;
}
}
bitflags! {
pub struct NeighborFlags: u8 {
const ROUTER = 0b10000000;
const SOLICITED = 0b01000000;
const OVERRIDE = 0b00100000;
}
}
impl<T: AsRef<[u8]>> Packet<T> {
/// Imbue a raw octet buffer with ICMPv6 packet structure.
pub fn new(buffer: T) -> Packet<T> {

View File

@ -185,12 +185,11 @@ pub use self::icmpv6::{Message as Icmpv6Message,
#[cfg(any(feature = "proto-ipv4", feature = "proto-ipv6"))]
pub use self::icmp::Repr as IcmpRepr;
#[cfg(feature = "proto-ipv6")]
pub use self::icmpv6::{RouterFlags as NdiscRouterFlags,
NeighborFlags as NdiscNeighborFlags};
#[cfg(feature = "proto-ipv6")]
pub use self::ndisc::Repr as NdiscRepr;
pub use self::ndisc::{Repr as NdiscRepr,
RouterFlags as NdiscRouterFlags,
NeighborFlags as NdiscNeighborFlags};
#[cfg(feature = "proto-ipv6")]
pub use self::ndiscoption::{NdiscOption,

View File

@ -1,12 +1,27 @@
use byteorder::{ByteOrder, NetworkEndian};
use {Error, Result};
use super::icmpv6::{field, Message, NeighborFlags, Packet, RouterFlags};
use super::icmpv6::{field, Message, Packet};
use wire::{EthernetAddress, Ipv6Repr, Ipv6Packet};
use wire::{NdiscOption, NdiscOptionRepr, NdiscOptionType, NdiscPrefixInformation, NdiscRedirectedHeader};
use time::Duration;
use super::Ipv6Address;
bitflags! {
pub struct RouterFlags: u8 {
const MANAGED = 0b10000000;
const OTHER = 0b01000000;
}
}
bitflags! {
pub struct NeighborFlags: u8 {
const ROUTER = 0b10000000;
const SOLICITED = 0b01000000;
const OVERRIDE = 0b00100000;
}
}
/// Getters for the Router Advertisement message header.
/// See [RFC 4861 § 4.2].
///