mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-30 12:48:45 +01:00
Support RFC3576
This commit is contained in:
@@ -7,4 +7,5 @@ pub mod rfc2865;
|
||||
pub mod rfc2866;
|
||||
pub mod rfc2867;
|
||||
pub mod rfc2868;
|
||||
pub mod rfc3576;
|
||||
pub mod tag;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// Code generated by machine generator; DO NOT EDIT.
|
||||
|
||||
use crate::avp::{AVPError, AVPType, AVP};
|
||||
use crate::packet::Packet;
|
||||
|
||||
pub type ErrorCause = u32;
|
||||
pub const ERROR_CAUSE_RESIDUAL_CONTEXT_REMOVED: ErrorCause = 201;
|
||||
pub const ERROR_CAUSE_INVALID_EAP_PACKET: ErrorCause = 202;
|
||||
pub const ERROR_CAUSE_UNSUPPORTED_ATTRIBUTE: ErrorCause = 401;
|
||||
pub const ERROR_CAUSE_MISSING_ATTRIBUTE: ErrorCause = 402;
|
||||
pub const ERROR_CAUSE_NAS_IDENTIFICATION_MISMATCH: ErrorCause = 403;
|
||||
pub const ERROR_CAUSE_INVALID_REQUEST: ErrorCause = 404;
|
||||
pub const ERROR_CAUSE_UNSUPPORTED_SERVICE: ErrorCause = 405;
|
||||
pub const ERROR_CAUSE_UNSUPPORTED_EXTENSION: ErrorCause = 406;
|
||||
pub const ERROR_CAUSE_ADMINISTRATIVELY_PROHIBITED: ErrorCause = 501;
|
||||
pub const ERROR_CAUSE_PROXY_REQUEST_NOT_ROUTABLE: ErrorCause = 502;
|
||||
pub const ERROR_CAUSE_SESSION_CONTEXT_NOT_FOUND: ErrorCause = 503;
|
||||
pub const ERROR_CAUSE_SESSION_CONTEXT_NOT_REMOVABLE: ErrorCause = 504;
|
||||
pub const ERROR_CAUSE_PROXY_PROCESSING_ERROR: ErrorCause = 505;
|
||||
pub const ERROR_CAUSE_RESOURCES_UNAVAILABLE: ErrorCause = 506;
|
||||
pub const ERROR_CAUSE_REQUEST_INITIATED: ErrorCause = 507;
|
||||
|
||||
pub type ServiceType = u32;
|
||||
pub const SERVICE_TYPE_AUTHORIZE_ONLY: ServiceType = 17;
|
||||
|
||||
pub const ERROR_CAUSE_TYPE: AVPType = 101;
|
||||
pub fn delete_error_cause(packet: &mut Packet) {
|
||||
packet.delete(ERROR_CAUSE_TYPE);
|
||||
}
|
||||
pub fn add_error_cause(packet: &mut Packet, value: ErrorCause) {
|
||||
packet.add(AVP::from_u32(ERROR_CAUSE_TYPE, value as u32));
|
||||
}
|
||||
pub fn lookup_error_cause(packet: &Packet) -> Option<Result<ErrorCause, AVPError>> {
|
||||
packet
|
||||
.lookup(ERROR_CAUSE_TYPE)
|
||||
.map(|v| Ok(v.encode_u32()? as ErrorCause))
|
||||
}
|
||||
pub fn lookup_all_error_cause(packet: &Packet) -> Result<Vec<ErrorCause>, AVPError> {
|
||||
let mut vec = Vec::new();
|
||||
for avp in packet.lookup_all(ERROR_CAUSE_TYPE) {
|
||||
vec.push(avp.encode_u32()? as ErrorCause)
|
||||
}
|
||||
Ok(vec)
|
||||
}
|
||||
Reference in New Issue
Block a user