Now that the "namespace" is cached and restored correctly.
+++ /dev/null
-# -*- text -*-
-# Copyright (C) 2019 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$
-#
-# The FreeRADIUS Vendor-Specific dictionary for SNMP operations.
-#
-# Version: $Id$
-#
-
-PROTOCOL VQP 6 format=2
-BEGIN-PROTOCOL VQP
-
-$INCLUDE dictionary.vqp
-
-END-PROTOCOL VQP
+++ /dev/null
-# -*- text -*-
-# Copyright (C) 2019 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$
-##############################################################################
-#
-# Cisco's VLAN Query Protocol
-#
-# The default destination port is 1589.
-#
-# $Id$
-#
-##############################################################################
-
-#
-# VQP / VMPS internal attributes for the packet header
-#
-ATTRIBUTE Packet-Type 1 integer internal
-ATTRIBUTE Error-Code 2 integer internal
-ATTRIBUTE Sequence-Number 3 integer internal
-
-#
-# VQP / VMPS Attributes
-#
-ATTRIBUTE Client-IPv4-Address 0x0c01 ipaddr
-ATTRIBUTE Port-Name 0x0c02 string
-ATTRIBUTE VLAN-Name 0x0c03 string
-
-# VTP domain
-ATTRIBUTE Domain-Name 0x0c04 string
-
-# Encapsulates an Ethernet frame...
-ATTRIBUTE Ethernet-Frame 0x0c05 octets
-ATTRIBUTE MAC-Address 0x0c06 ether
-ATTRIBUTE Unknown 0x0c07 octets
-ATTRIBUTE Cookie 0x0c08 ether
-
-#
-# VQP integer mappings
-#
-
-VALUE Packet-Type Join-Request 1
-VALUE Packet-Type Join-Response 2
-VALUE Packet-Type Reconfirm-Request 3
-VALUE Packet-Type Reconfirm-Response 4
-
-VALUE Packet-Type Do-Not-Respond 256
-
-VALUE Error-Code No-Error 0
-VALUE Error-Code Wrong-Version 1
-VALUE Error-Code Insufficient-Resources 2
-VALUE Error-Code Deny 3
-VALUE Error-Code Shutdown 4
-VALUE Error-Code Wrong-Mgmt-Domain 5
DICT += $(wildcard $(addsuffix /dictionary,$(addprefix share/dictionary/,$(PROTOCOLS))))
# Add in protocol specific dictionaries (should be done in proto_* modules?)
-DICT += share/dictionary/vqp/dictionary.vqp
+DICT += share/dictionary/vmps/dictionary.vmps
NORMALIZE := tr -- '[:lower:]/+.-' '[:upper:]____' | sed 's/241_//;'
HEADER := "/* AUTO_GENERATED FILE. DO NOT EDIT */"
extern fr_dict_autoload_t proto_vmps_dict[];
fr_dict_autoload_t proto_vmps_dict[] = {
- { .out = &dict_vmps, .proto = "vqp" },
+ { .out = &dict_vmps, .proto = "vmps" },
{ NULL }
};
static int mod_load(void)
{
- if (fr_vqp_init() < 0) return -1;
+ if (fr_vqp_init() < 0) {
+ ERROR("Failed initializing the VMPS dictionaries: %s", fr_strerror());
+ return -1;
+ }
return 0;
}
extern fr_dict_autoload_t proto_vmps_all_dict[];
fr_dict_autoload_t proto_vmps_all_dict[] = {
- { .out = &dict_vmps, .proto = "vqp" },
+ { .out = &dict_vmps, .proto = "vmps" },
{ NULL }
};
COMPILE_TERMINATOR
};
-static int mod_instantiate(UNUSED void *instance, CONF_SECTION *process_app_cs)
-{
- CONF_SECTION *listen_cs = cf_item_to_section(cf_parent(process_app_cs));
- CONF_SECTION *server_cs;
- vp_tmpl_rules_t parse_rules;
-
- memset(&parse_rules, 0, sizeof(parse_rules));
- parse_rules.dict_def = dict_vmps;
-
- rad_assert(listen_cs);
-
- server_cs = cf_item_to_section(cf_parent(listen_cs));
- rad_assert(strcmp(cf_section_name1(server_cs), "server") == 0);
-
- return virtual_server_compile_sections(server_cs, compile_list, &parse_rules);
-}
extern fr_app_worker_t proto_vmps_all;
fr_app_worker_t proto_vmps_all = {
.magic = RLM_MODULE_INIT,
.name = "vmps_all",
- .instantiate = mod_instantiate,
.entry_point = mod_process,
+ .compile_list = compile_list,
};
#include <freeradius-devel/util/dict.h>
-extern fr_dict_t *dict_vqp;
+extern fr_dict_t *dict_vmps;
extern fr_dict_attr_t const *attr_error_code;
extern fr_dict_attr_t const *attr_packet_type;
static int instance_count = 0;
-fr_dict_t *dict_vqp;
+fr_dict_t *dict_vmps;
extern fr_dict_autoload_t libfreeradius_vqp[];
fr_dict_autoload_t libfreeradius_vqp[] = {
- { .out = &dict_vqp, .proto = "vqp" },
+ { .out = &dict_vmps, .proto = "vmps" },
{ NULL }
};
extern fr_dict_attr_autoload_t libfreeradius_vqp_dict_attr[];
fr_dict_attr_autoload_t libfreeradius_vqp_dict_attr[] = {
- { .out = &attr_error_code, .name = "Error-Code", .type = FR_TYPE_UINT32, .dict = &dict_vqp },
- { .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_vqp },
- { .out = &attr_sequence_number, .name = "Sequence-Number", .type = FR_TYPE_UINT32, .dict = &dict_vqp },
+ { .out = &attr_error_code, .name = "Error-Code", .type = FR_TYPE_UINT32, .dict = &dict_vmps },
+ { .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_vmps },
+ { .out = &attr_sequence_number, .name = "Sequence-Number", .type = FR_TYPE_UINT32, .dict = &dict_vmps },
{ NULL }
};
return 0;
}
- if (fr_dict_autoload(libfreeradius_vqp) < 0) return -1;
+ if (fr_dict_autoload(libfreeradius_vqp) < 0) {
+ fr_strerror_printf("Failed loading the 'vmps' dictionary - %s", fr_strerror());
+ return -1;
+ }
+
if (fr_dict_attr_autoload(libfreeradius_vqp_dict_attr) < 0) {
+ fr_strerror_printf("Failed loading the 'vmps' attributes");
fr_dict_autofree(libfreeradius_vqp);
return -1;
}
/*
* Create the VP.
*/
- vp = fr_pair_afrom_child_num(packet, fr_dict_root(dict_vqp), attr);
+ vp = fr_pair_afrom_child_num(packet, fr_dict_root(dict_vmps), attr);
if (!vp) {
fr_strerror_printf("No memory");
for (i = 0; i < VQP_MAX_ATTRIBUTES; i++) {
if (!contents[code][i]) break;
- vps[i] = fr_pair_find_by_child_num(packet->vps, fr_dict_root(dict_vqp),
+ vps[i] = fr_pair_find_by_child_num(packet->vps, fr_dict_root(dict_vmps),
contents[code][i], TAG_ANY);
/*