Struct radius_rust::protocol::host::Host[][src]

pub struct Host { /* fields omitted */ }

Generic struct that holds Server & Client common functions and attributes

Implementations

impl Host[src]

pub fn initialise_host(
    auth_port: u16,
    acct_port: u16,
    coa_port: u16,
    dictionary: Dictionary
) -> Host
[src]

Initialises host instance

pub fn create_attribute_by_name(
    &self,
    attribute_name: &str,
    value: Vec<u8>
) -> Result<RadiusAttribute, RadiusError>
[src]

Creates RadiusAttribute with given name (name is checked against Dictionary)

pub fn create_attribute_by_id(
    &self,
    attribute_id: u8,
    value: Vec<u8>
) -> Result<RadiusAttribute, RadiusError>
[src]

Creates RadiusAttribute with given id (id is checked against Dictionary)

pub fn get_port(&self, code: &TypeCode) -> Option<u16>[src]

Returns port of RADIUS server, that receives given type of RADIUS message/packet

pub fn get_dictionary(&self) -> &Dictionary[src]

Returns host's dictionary instance

pub fn get_dictionary_value_by_attr_and_value_name(
    &self,
    attr_name: &str,
    value_name: &str
) -> Option<&DictionaryValue>
[src]

Returns VALUE from dictionary with given attribute * value names

pub fn get_dictionary_attribute_by_id(
    &self,
    packet_attr_id: u8
) -> Option<&DictionaryAttribute>
[src]

Returns ATTRIBUTE from dictionary with given id

pub fn get_dictionary_attribute_by_name(
    &self,
    packet_attr_name: &str
) -> Option<&DictionaryAttribute>
[src]

Returns ATTRIBUTE from dictionary with given name

pub fn initialise_packet_from_bytes(
    &self,
    packet: &[u8]
) -> Result<RadiusPacket, RadiusError>
[src]

Initialises RadiusPacket from bytes

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

Verifies that RadiusPacket attributes have valid values

Note: doesn't verify Message-Authenticator attribute, because it is HMAC-MD5 hash, not an ASCII string

pub fn verify_message_authenticator(
    &self,
    secret: &str,
    packet: &[u8]
) -> Result<(), RadiusError>
[src]

Verifies Message-Authenticator value

Trait Implementations

impl Debug for Host[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>,