pub struct RadiusPacket {
pub code: u8,
pub identifier: u8,
pub authenticator: [u8; 16],
pub attributes: Vec<RadiusAttribute>,
}Expand description
A RADIUS packet.
Fields§
§code: u8§identifier: u8§authenticator: [u8; 16]§attributes: Vec<RadiusAttribute>Implementations§
Source§impl RadiusPacket
impl RadiusPacket
Sourcepub fn add_attribute(&mut self, attr_type: u8, value: impl AsRef<[u8]>)
pub fn add_attribute(&mut self, attr_type: u8, value: impl AsRef<[u8]>)
Append an attribute to this packet.
Uses the constants from attr for type safety.
§Example
ⓘ
use auth_framework::protocols::radius::{RadiusPacket, attr, code};
let mut packet = RadiusPacket {
code: code::ACCESS_REQUEST,
identifier: 1,
authenticator: [0u8; 16],
attributes: Vec::new(),
};
packet.add_attribute(attr::USER_NAME, b"alice");
packet.add_attribute(attr::NAS_IDENTIFIER, b"my-nas");Trait Implementations§
Source§impl Clone for RadiusPacket
impl Clone for RadiusPacket
Source§fn clone(&self) -> RadiusPacket
fn clone(&self) -> RadiusPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RadiusPacket
impl RefUnwindSafe for RadiusPacket
impl Send for RadiusPacket
impl Sync for RadiusPacket
impl Unpin for RadiusPacket
impl UnsafeUnpin for RadiusPacket
impl UnwindSafe for RadiusPacket
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more