The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
base.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 
17 /**
18  * $Id: 3204df5be810535955c8d364f54b18b03460cb5d $
19  *
20  * @file src/protocols/vmps/vmps.h
21  * @brief Structures and prototypes for Cisco's VLAN Query Protocol
22  *
23  * @copyright 2018 The FreeRADIUS server project
24  */
25 
26 RCSID("$Id: 3204df5be810535955c8d364f54b18b03460cb5d $")
27 
28 #include <freeradius-devel/util/pair.h>
29 #include "vmps.h"
30 #include "attrs.h"
31 
33 
35 
38  { .out = &dict_vmps, .proto = "vmps" },
39  { NULL }
40 };
41 
45 
48  { .out = &attr_error_code, .name = "Error-Code", .type = FR_TYPE_UINT8, .dict = &dict_vmps },
49  { .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_vmps },
50  { .out = &attr_sequence_number, .name = "Sequence-Number", .type = FR_TYPE_UINT32, .dict = &dict_vmps },
51  { NULL }
52 };
53 
54 
56 {
57  if (instance_count > 0) {
59  return 0;
60  }
61 
63 
65  fail:
67  return -1;
68  }
69 
72  goto fail;
73  }
74 
75 
76  return 0;
77 }
78 
80 {
82 
83  if (--instance_count > 0) return;
84 
86 }
#define RCSID(id)
Definition: build.h:481
#define fr_dict_autofree(_to_free)
Definition: dict.h:850
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
Definition: dict.h:267
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Definition: dict.h:280
int fr_dict_attr_autoload(fr_dict_attr_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
Definition: dict_util.c:4090
#define fr_dict_autoload(_to_load)
Definition: dict.h:847
Specifies an attribute which must be present for the module to function.
Definition: dict.h:266
Specifies a dictionary which must be loaded/loadable for the module to function.
Definition: dict.h:279
fr_dict_attr_t const * attr_packet_type
Definition: base.c:91
@ FR_TYPE_UINT8
8 Bit unsigned integer.
Definition: merged_model.c:97
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
unsigned int uint32_t
Definition: merged_model.c:33
VQP attributes.
static uint32_t instance_count
Definition: base.c:32
fr_dict_autoload_t libfreeradius_vmps[]
Definition: base.c:37
int fr_vmps_global_init(void)
Definition: base.c:55
void fr_vmps_global_free(void)
Definition: base.c:79
fr_dict_attr_autoload_t libfreeradius_vmps_dict_attr[]
Definition: base.c:47
fr_dict_attr_t const * attr_sequence_number
Definition: base.c:44
fr_dict_t const * dict_vmps
Definition: base.c:34
fr_dict_attr_t const * attr_error_code
Definition: base.c:42
fr_assert(0)
Structures and prototypes for Cisco's VLAN Query Protocol.