Support RFC4072

This commit is contained in:
moznion
2020-12-02 02:52:04 +09:00
parent 5053597ad7
commit bbd70e4838
4 changed files with 36 additions and 2 deletions

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)
- [RFC4072](https://tools.ietf.org/html/rfc4072)
- [RFC5090](https://tools.ietf.org/html/rfc5090)
- [RFC6519](https://tools.ietf.org/html/rfc6519)
- [RFC6677](https://tools.ietf.org/html/rfc6677)
@@ -34,14 +35,12 @@ Simple example implementations are here:
- rfc2869
- rfc3162
- rfc3580
- rfc4072
- rfc4372
- rfc4603
- rfc4675
- rfc4679
- rfc4818
- rfc4849
- rfc5090
- rfc5176
- rfc5447
- rfc5580

12
dicts/dictionary.rfc4072 Normal file
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 4072
# http://www.ietf.org/rfc/rfc4072.txt
#
# $Id$
#
ATTRIBUTE EAP-Key-Name 102 octets

View File

@@ -8,6 +8,7 @@ pub mod rfc2866;
pub mod rfc2867;
pub mod rfc2868;
pub mod rfc3576;
pub mod rfc4072;
pub mod rfc5090;
pub mod rfc6519;
pub mod rfc6677;

22
radius/src/rfc4072.rs Normal file
View File

@@ -0,0 +1,22 @@
// Code generated by machine generator; DO NOT EDIT.
use crate::avp::{AVPType, AVP};
use crate::packet::Packet;
pub const EAP_KEY_NAME_TYPE: AVPType = 102;
pub fn delete_eap_key_name(packet: &mut Packet) {
packet.delete(EAP_KEY_NAME_TYPE);
}
pub fn add_eap_key_name(packet: &mut Packet, value: &[u8]) {
packet.add(AVP::from_bytes(EAP_KEY_NAME_TYPE, value));
}
pub fn lookup_eap_key_name(packet: &Packet) -> Option<Vec<u8>> {
packet.lookup(EAP_KEY_NAME_TYPE).map(|v| v.encode_bytes())
}
pub fn lookup_all_eap_key_name(packet: &Packet) -> Vec<Vec<u8>> {
let mut vec = Vec::new();
for avp in packet.lookup_all(EAP_KEY_NAME_TYPE) {
vec.push(avp.encode_bytes())
}
vec
}