diff --git a/dicts/dictionary.rfc2867 b/dicts/dictionary.rfc2867 new file mode 100644 index 0000000..abfd62d --- /dev/null +++ b/dicts/dictionary.rfc2867 @@ -0,0 +1,19 @@ +# -*- text -*- +# Copyright (C) 2020 The FreeRADIUS Server project and contributors +# This work is licensed under CC-BY version 4.0 https://creativecommons.org/licenses/by/4.0 +# Version $Id$ +# +# Attributes and values defined in RFC 2867. +# http://www.ietf.org/rfc/rfc2867.txt +# +# $Id$ +# +ATTRIBUTE Acct-Tunnel-Connection 68 string +ATTRIBUTE Acct-Tunnel-Packets-Lost 86 integer + +VALUE Acct-Status-Type Tunnel-Start 9 +VALUE Acct-Status-Type Tunnel-Stop 10 +VALUE Acct-Status-Type Tunnel-Reject 11 +VALUE Acct-Status-Type Tunnel-Link-Start 12 +VALUE Acct-Status-Type Tunnel-Link-Stop 13 +VALUE Acct-Status-Type Tunnel-Link-Reject 14 diff --git a/src/lib.rs b/src/lib.rs index 38e8a68..3fcec60 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,5 +11,6 @@ pub mod request; pub mod request_handler; pub mod rfc2865; pub mod rfc2866; +pub mod rfc2867; pub mod secret_provider; pub mod server; diff --git a/src/rfc2867.rs b/src/rfc2867.rs new file mode 100644 index 0000000..c9478cf --- /dev/null +++ b/src/rfc2867.rs @@ -0,0 +1,43 @@ +// Code generated by machine generator; DO NOT EDIT. + +use crate::attribute::Attribute; +use crate::attributes::AVPType; +use crate::packet::Packet; + +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_TUNNEL_CONNECTION_TYPE: AVPType = 68; +pub fn delete_acct_tunnel_connection(packet: &mut Packet) { + packet.delete(ACCT_TUNNEL_CONNECTION_TYPE); +} +pub fn lookup_acct_tunnel_connection(packet: &Packet) -> Option<&Attribute> { + packet.lookup(ACCT_TUNNEL_CONNECTION_TYPE) +} +pub fn lookup_all_acct_tunnel_connection(packet: &Packet) -> Vec<&Attribute> { + packet.lookup_all(ACCT_TUNNEL_CONNECTION_TYPE) +} +pub fn add_acct_tunnel_connection(packet: &mut Packet, value: &str) { + let attr = Attribute::from_string(value); + packet.add(ACCT_TUNNEL_CONNECTION_TYPE, &attr); +} + +pub const ACCT_TUNNEL_PACKETS_LOST_TYPE: AVPType = 86; +pub fn delete_acct_tunnel_packets_lost(packet: &mut Packet) { + packet.delete(ACCT_TUNNEL_PACKETS_LOST_TYPE); +} +pub fn lookup_acct_tunnel_packets_lost(packet: &Packet) -> Option<&Attribute> { + packet.lookup(ACCT_TUNNEL_PACKETS_LOST_TYPE) +} +pub fn lookup_all_acct_tunnel_packets_lost(packet: &Packet) -> Vec<&Attribute> { + packet.lookup_all(ACCT_TUNNEL_PACKETS_LOST_TYPE) +} +pub fn add_acct_tunnel_packets_lost(packet: &mut Packet, value: u32) { + let attr = Attribute::from_u32(value); + packet.add(ACCT_TUNNEL_PACKETS_LOST_TYPE, &attr); +}