The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
vmps.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/**
19 * $Id: 9f45268907ea0a25b7975601016c4252f818ea39 $
20 *
21 * @file src/protocols/vmps/vmps.h
22 * @brief Structures and prototypes for Cisco's VLAN Query Protocol
23 *
24 * @copyright 2007 The FreeRADIUS server project
25 * @copyright 2007 Alan DeKok (aland@deployingradius.com)
26 */
27
28RCSIDH(vmps_h, "$Id: 9f45268907ea0a25b7975601016c4252f818ea39 $")
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#define FR_VQP_HDR_LEN (8)
35#define FR_VQP_VERSION (1)
36
37bool fr_vmps_ok(uint8_t const *packet, size_t *packet_len);
38
48
49int fr_vmps_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, unsigned int *code);
50
51ssize_t fr_vmps_packet_size(uint8_t const *data, size_t data_len);
52
53void fr_vmps_print_hex(FILE *fp, uint8_t const *packet, size_t packet_len);
54
55ssize_t fr_vmps_encode(fr_dbuff_t *dbuff, uint8_t const *original,
56 fr_vmps_packet_code_t code, uint32_t id, fr_dcursor_t *cursor) CC_HINT(nonnull(1));
57
58#define FR_VMPS_PACKET_CODE_VALID(_code) (((_code) > 0) && ((_code) < FR_VMPS_CODE_MAX))
59
60extern char const *fr_vmps_packet_names[FR_VMPS_CODE_MAX];
61
62int fr_vmps_global_init(void);
63
64void fr_vmps_global_free(void);
65
66#ifdef __cplusplus
67}
68#endif
#define RCSIDH(h, id)
Definition build.h:604
unsigned short uint16_t
unsigned int uint32_t
long int ssize_t
unsigned char uint8_t
static fr_slen_t data
Definition value.h:1366
static fr_sbuff_err_t char ** out
Definition value.h:1061
int nonnull(2, 5))
fr_vmps_packet_code_t
Definition vmps.h:39
@ FR_VMPS_RECONFIRM_RESPONSE
Definition vmps.h:44
@ FR_VMPS_INVALID
Definition vmps.h:40
@ FR_VMPS_DO_NOT_RESPOND
Definition vmps.h:46
@ FR_VMPS_JOIN_RESPONSE
Definition vmps.h:42
@ FR_VMPS_CODE_MAX
Definition vmps.h:45
@ FR_VMPS_RECONFIRM_REQUEST
Definition vmps.h:43
@ FR_VMPS_JOIN_REQUEST
Definition vmps.h:41
int fr_vmps_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, unsigned int *code)
Definition vmps.c:154
ssize_t fr_vmps_encode(fr_dbuff_t *dbuff, uint8_t const *original, fr_vmps_packet_code_t code, uint32_t id, fr_dcursor_t *cursor))
Definition vmps.c:269
int fr_vmps_global_init(void)
Definition base.c:55
void fr_vmps_global_free(void)
Definition base.c:79
char const * fr_vmps_packet_names[FR_VMPS_CODE_MAX]
Definition vmps.c:75
bool fr_vmps_ok(uint8_t const *packet, size_t *packet_len)
Definition vmps.c:83
ssize_t fr_vmps_packet_size(uint8_t const *data, size_t data_len)
See how big of a packet is in the buffer.
Definition vmps.c:372
void fr_vmps_print_hex(FILE *fp, uint8_t const *packet, size_t packet_len)
Print a raw VMPS packet as hex.
Definition vmps.c:464