Struct radius::core::packet::Packet [−][src]
pub struct Packet { /* fields omitted */ }
Expand description
This struct represents a packet of RADIUS for request and response.
Implementations
impl Packet
[src]
impl Packet
[src]pub fn new(code: Code, secret: &[u8]) -> Self
[src]
pub fn new(code: Code, secret: &[u8]) -> Self
[src]Constructor for a Packet.
By default, this constructor makes an instance with a random identifier value.
If you’d like to set an arbitrary identifier, please use new_with_identifier()
constructor instead or set_identifier()
method for created instance.
pub fn new_with_identifier(code: Code, secret: &[u8], identifier: u8) -> Self
[src]
pub fn new_with_identifier(code: Code, secret: &[u8], identifier: u8) -> Self
[src]Constructor for a Packet with arbitrary identifier value.
If you want to make an instance with a random identifier value, please consider using new()
.
pub fn get_code(&self) -> Code
[src]
pub fn get_identifier(&self) -> u8
[src]
pub fn get_secret(&self) -> &Vec<u8>
[src]
pub fn get_authenticator(&self) -> &Vec<u8>
[src]
pub fn set_identifier(&mut self, identifier: u8)
[src]
pub fn set_identifier(&mut self, identifier: u8)
[src]This sets an identifier value to an instance.
pub fn decode(bs: &[u8], secret: &[u8]) -> Result<Self, PacketError>
[src]
pub fn decode(bs: &[u8], secret: &[u8]) -> Result<Self, PacketError>
[src]This decodes bytes into a Packet.
pub fn make_response_packet(&self, code: Code) -> Self
[src]
pub fn make_response_packet(&self, code: Code) -> Self
[src]This method makes a response packet according to self (i.e. request packet).
pub fn is_authentic_response(
response: &[u8],
request: &[u8],
secret: &[u8]
) -> bool
[src]
pub fn is_authentic_response(
response: &[u8],
request: &[u8],
secret: &[u8]
) -> bool
[src]Returns whether the Packet is authentic response or not.
pub fn is_authentic_request(request: &[u8], secret: &[u8]) -> bool
[src]
pub fn is_authentic_request(request: &[u8], secret: &[u8]) -> bool
[src]Returns whether the Packet is authentic request or not.
pub fn delete(&mut self, typ: AVPType)
[src]
pub fn delete(&mut self, typ: AVPType)
[src]Delete all of AVPs from the list according to given AVP type.
pub fn lookup(&self, typ: AVPType) -> Option<&AVP>
[src]
pub fn lookup(&self, typ: AVPType) -> Option<&AVP>
[src]Returns an AVP that matches at first with the given AVP type. If there are not any matched ones, this returns None
.
pub fn lookup_all(&self, typ: AVPType) -> Vec<&AVP>
[src]
pub fn lookup_all(&self, typ: AVPType) -> Vec<&AVP>
[src]Returns AVPs that match with the given AVP type.
Trait Implementations
impl StructuralPartialEq for Packet
[src]
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,