Respect the pre-defined attribute type on each value

This commit is contained in:
moznion
2020-12-10 00:41:03 +09:00
parent 1e03c42d59
commit 6d105b9961
7 changed files with 97 additions and 56 deletions
+8 -8
View File
@@ -3,6 +3,8 @@
use crate::avp::{AVPError, AVPType, AVP};
use crate::packet::Packet;
use crate::rfc2866;
pub const ACCT_TUNNEL_CONNECTION_TYPE: AVPType = 68;
pub fn delete_acct_tunnel_connection(packet: &mut Packet) {
packet.delete(ACCT_TUNNEL_CONNECTION_TYPE);
@@ -42,11 +44,9 @@ pub fn lookup_all_acct_tunnel_packets_lost(packet: &Packet) -> Result<Vec<u32>,
}
Ok(vec)
}
pub type AcctStatusType = u32;
pub const ACCT_STATUS_TYPE_TUNNEL_START: AcctStatusType = 9;
pub const ACCT_STATUS_TYPE_TUNNEL_STOP: AcctStatusType = 10;
pub const ACCT_STATUS_TYPE_TUNNEL_REJECT: AcctStatusType = 11;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_START: AcctStatusType = 12;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_STOP: AcctStatusType = 13;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_REJECT: AcctStatusType = 14;
pub const ACCT_STATUS_TYPE_TUNNEL_START: rfc2866::AcctStatusType = 9;
pub const ACCT_STATUS_TYPE_TUNNEL_STOP: rfc2866::AcctStatusType = 10;
pub const ACCT_STATUS_TYPE_TUNNEL_REJECT: rfc2866::AcctStatusType = 11;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_START: rfc2866::AcctStatusType = 12;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_STOP: rfc2866::AcctStatusType = 13;
pub const ACCT_STATUS_TYPE_TUNNEL_LINK_REJECT: rfc2866::AcctStatusType = 14;
+3 -2
View File
@@ -3,6 +3,8 @@
use crate::avp::{AVPError, AVPType, AVP};
use crate::packet::Packet;
use crate::rfc2865;
pub const ERROR_CAUSE_TYPE: AVPType = 101;
pub fn delete_error_cause(packet: &mut Packet) {
packet.delete(ERROR_CAUSE_TYPE);
@@ -40,5 +42,4 @@ 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 SERVICE_TYPE_AUTHORIZE_ONLY: rfc2865::ServiceType = 17;
+12 -10
View File
@@ -1,14 +1,16 @@
// Code generated by machine generator; DO NOT EDIT.
pub type AcctTerminateCause = u32;
pub const ACCT_TERMINATE_CAUSE_SUPPLICANT_RESTART: AcctTerminateCause = 19;
pub const ACCT_TERMINATE_CAUSE_REAUTHENTICATION_FAILURE: AcctTerminateCause = 20;
pub const ACCT_TERMINATE_CAUSE_PORT_REINIT: AcctTerminateCause = 21;
pub const ACCT_TERMINATE_CAUSE_PORT_DISABLED: AcctTerminateCause = 22;
use crate::rfc2865;
use crate::rfc2866;
pub type NasPortType = u32;
pub const NAS_PORT_TYPE_TOKEN_RING: NasPortType = 20;
pub const NAS_PORT_TYPE_FDDI: NasPortType = 21;
use crate::rfc2868;
pub type TunnelType = u32;
pub const TUNNEL_TYPE_VLAN: TunnelType = 13;
pub const ACCT_TERMINATE_CAUSE_SUPPLICANT_RESTART: rfc2866::AcctTerminateCause = 19;
pub const ACCT_TERMINATE_CAUSE_REAUTHENTICATION_FAILURE: rfc2866::AcctTerminateCause = 20;
pub const ACCT_TERMINATE_CAUSE_PORT_REINIT: rfc2866::AcctTerminateCause = 21;
pub const ACCT_TERMINATE_CAUSE_PORT_DISABLED: rfc2866::AcctTerminateCause = 22;
pub const NAS_PORT_TYPE_TOKEN_RING: rfc2865::NasPortType = 20;
pub const NAS_PORT_TYPE_FDDI: rfc2865::NasPortType = 21;
pub const TUNNEL_TYPE_VLAN: rfc2868::TunnelType = 13;
+7 -6
View File
@@ -1,8 +1,9 @@
// Code generated by machine generator; DO NOT EDIT.
pub type NasPortType = u32;
pub const NAS_PORT_TYPE_PP_PO_A: NasPortType = 30;
pub const NAS_PORT_TYPE_PP_PO_EO_A: NasPortType = 31;
pub const NAS_PORT_TYPE_PP_PO_EO_E: NasPortType = 32;
pub const NAS_PORT_TYPE_PP_PO_EO_VLAN: NasPortType = 33;
pub const NAS_PORT_TYPE_PP_PO_EO_QIN_Q: NasPortType = 34;
use crate::rfc2865;
pub const NAS_PORT_TYPE_PP_PO_A: rfc2865::NasPortType = 30;
pub const NAS_PORT_TYPE_PP_PO_EO_A: rfc2865::NasPortType = 31;
pub const NAS_PORT_TYPE_PP_PO_EO_E: rfc2865::NasPortType = 32;
pub const NAS_PORT_TYPE_PP_PO_EO_VLAN: rfc2865::NasPortType = 33;
pub const NAS_PORT_TYPE_PP_PO_EO_QIN_Q: rfc2865::NasPortType = 34;
+4 -3
View File
@@ -1,5 +1,6 @@
// Code generated by machine generator; DO NOT EDIT.
pub type ErrorCause = u32;
pub const ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE: ErrorCause = 407;
pub const ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED: ErrorCause = 508;
use crate::rfc3576;
pub const ERROR_CAUSE_INVALID_ATTRIBUTE_VALUE: rfc3576::ErrorCause = 407;
pub const ERROR_CAUSE_MULTIPLE_SESSION_SELECTION_UNSUPPORTED: rfc3576::ErrorCause = 508;
+3 -2
View File
@@ -3,6 +3,8 @@
use crate::avp::{AVPError, AVPType, AVP};
use crate::packet::Packet;
use crate::rfc2865;
pub const FRAMED_MANAGEMENT_TYPE: AVPType = 133;
pub fn delete_framed_management(packet: &mut Packet) {
packet.delete(FRAMED_MANAGEMENT_TYPE);
@@ -109,5 +111,4 @@ pub const MANAGEMENT_TRANSPORT_PROTECTION_INTEGRITY_PROTECTION: ManagementTransp
pub const MANAGEMENT_TRANSPORT_PROTECTION_INTEGRITY_CONFIDENTIALITY_PROTECTION:
ManagementTransportProtection = 3;
pub type ServiceType = u32;
pub const SERVICE_TYPE_FRAMED_MANAGEMENT: ServiceType = 18;
pub const SERVICE_TYPE_FRAMED_MANAGEMENT: rfc2865::ServiceType = 18;