Struct radius_rust::protocol::radius_packet::RadiusPacket[][src]

pub struct RadiusPacket { /* fields omitted */ }

Represents RADIUS packet

Implementations

impl RadiusPacket[src]

pub fn initialise_packet(
    code: TypeCode,
    attributes: Vec<RadiusAttribute>
) -> RadiusPacket
[src]

Initialises RADIUS packet with random ID and authenticator

pub fn initialise_packet_from_bytes(
    dictionary: &Dictionary,
    bytes: &[u8]
) -> Result<RadiusPacket, RadiusError>
[src]

Initialises RADIUS packet from raw bytes

pub fn override_id(&mut self, new_id: u8)[src]

Overrides RadiusPacket id

pub fn override_authenticator(&mut self, new_authenticator: Vec<u8>)[src]

Overrides RadiusPacket authenticator

pub fn override_message_authenticator(
    &mut self,
    new_message_authenticator: Vec<u8>
) -> Result<(), RadiusError>
[src]

Overrides RadiusPacket Message-Authenticator

Note: would fail if RadiusPacket has no Message-Authenticator attribute defined

pub fn message_authenticator(&self) -> Result<&[u8], RadiusError>[src]

Returns Message-Authenticator value, if exists in RadiusPacket

pub fn id(&self) -> u8[src]

Returns RadiusPacket id

pub fn authenticator(&self) -> &[u8][src]

Returns RadiusPacket authenticator

pub fn code(&self) -> &TypeCode[src]

Returns RadiusPacket code

pub fn attributes(&self) -> &[RadiusAttribute][src]

Returns RadiusPacket attributes

pub fn attribute_by_name(&self, name: &str) -> Option<&RadiusAttribute>[src]

Returns RadiusAttribute with given name

pub fn attribute_by_id(&self, id: u8) -> Option<&RadiusAttribute>[src]

Returns RadiusAttribute with given id

pub fn to_bytes(&mut self) -> Vec<u8>[src]

Converts RadiusPacket into ready-to-be-sent bytes vector

Trait Implementations

impl Debug for RadiusPacket[src]

impl PartialEq<RadiusPacket> for RadiusPacket[src]

impl StructuralPartialEq for RadiusPacket[src]

Auto Trait Implementations

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,