Support RFC6519

This commit is contained in:
moznion
2020-12-02 02:46:20 +09:00
parent 258416839b
commit 7e3c900ad5
4 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -15,6 +15,7 @@ This supports the following RFC dictionaries at the moment:
- [RFC2867](https://tools.ietf.org/html/rfc2867)
- [RFC2868](https://tools.ietf.org/html/rfc2868)
- [RFC3576](https://tools.ietf.org/html/rfc3576)
- [RFC6519](https://tools.ietf.org/html/rfc6519)
- [RFC6677](https://tools.ietf.org/html/rfc6677)
## Usage
@@ -45,7 +46,6 @@ Simple example implementations are here:
- rfc5580
- rfc5607
- rfc5904
- rfc6519
- rfc6572
- rfc6911
- rfc6929
+12
View File
@@ -0,0 +1,12 @@
# -*- 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 6519.
# http://www.ietf.org/rfc/rfc6519.txt
#
# $Id$
#
ATTRIBUTE DS-Lite-Tunnel-Name 144 string
+1
View File
@@ -8,5 +8,6 @@ pub mod rfc2866;
pub mod rfc2867;
pub mod rfc2868;
pub mod rfc3576;
pub mod rfc6519;
pub mod rfc6677;
pub mod tag;
+24
View File
@@ -0,0 +1,24 @@
// Code generated by machine generator; DO NOT EDIT.
use crate::avp::{AVPError, AVPType, AVP};
use crate::packet::Packet;
pub const DS_LITE_TUNNEL_NAME_TYPE: AVPType = 144;
pub fn delete_ds_lite_tunnel_name(packet: &mut Packet) {
packet.delete(DS_LITE_TUNNEL_NAME_TYPE);
}
pub fn add_ds_lite_tunnel_name(packet: &mut Packet, value: &str) {
packet.add(AVP::from_string(DS_LITE_TUNNEL_NAME_TYPE, value));
}
pub fn lookup_ds_lite_tunnel_name(packet: &Packet) -> Option<Result<String, AVPError>> {
packet
.lookup(DS_LITE_TUNNEL_NAME_TYPE)
.map(|v| v.encode_string())
}
pub fn lookup_all_ds_lite_tunnel_name(packet: &Packet) -> Result<Vec<String>, AVPError> {
let mut vec = Vec::new();
for avp in packet.lookup_all(DS_LITE_TUNNEL_NAME_TYPE) {
vec.push(avp.encode_string()?)
}
Ok(vec)
}