[][src]Enum cjdns_ann::Entity

pub enum Entity {
    NodeProtocolVersion(u16),
    Peer(PeerData),
    EncodingScheme {
        hex: String,
        scheme: EncodingScheme,
    },
    LinkState(LinkStateData),
}

Announcement message entity types.

Variants

NodeProtocolVersion(u16)

The packet diagram for version entity looks as follows:

                       1               2               3
       0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    0 |     length    |      type     |             version           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Peer(PeerData)

The packet diagram for peer entity looks as follows:

                       1               2               3
       0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    0 |     length     |      type     | encoding form |     flags    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    4 |      MTU (8 byte units)       |           peer number         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    8 |                               unused                          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   12 |                                                               |
      +                                                               +
   16 |                                                               |
      +                           Peer IPv6                           +
   20 |                                                               |
      +                                                               +
   24 |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   28 |                             label                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note: The label field is an Option: zero label parsed as None (the route is being withdrawn and it is no longer usable), nonzero label is Some(label).

EncodingScheme

As EncodingScheme serialization does not have a fixed width in bytes, EncodingScheme entities are prefixed with a number of pads in order that their length will be a multiple of four bytes.

hex stands for hex string representation of serialized encoding scheme.

Fields of EncodingScheme

hex: Stringscheme: EncodingScheme
LinkState(LinkStateData)

LinkState stores data, which is used by route server/super node to plot good paths through the network and avoid links which have long or unreliable delay. So the data under LinkState represents the quality of network link.

Trait Implementations

impl Clone for Entity[src]

impl Debug for Entity[src]

impl Eq for Entity[src]

impl PartialEq<Entity> for Entity[src]

impl StructuralEq for Entity[src]

impl StructuralPartialEq for Entity[src]

Auto Trait Implementations

impl RefUnwindSafe for Entity

impl Send for Entity

impl Sync for Entity

impl Unpin for Entity

impl UnwindSafe for Entity

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.