radius_debug.h
Go to the documentation of this file.
1 /**
2  * @file radius_debug.h
3  * @brief Data logging functions for debugging purpose (RADIUS)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneEAP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _RADIUS_DEBUG_H
32 #define _RADIUS_DEBUG_H
33 
34 //Dependencies
35 #include "radius/radius.h"
37 #include "debug.h"
38 
39 
40 //C++ guard
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
46 /**
47  * @brief Parameter value/name binding
48  **/
49 
50 typedef struct
51 {
53  const char_t *name;
55 
56 
57 //RADIUS related functions
58 #if (RADIUS_TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
59  void radiusDumpPacket(const RadiusPacket *packet, size_t length);
60 #else
61  #define radiusDumpPacket(packet, length)
62 #endif
63 
64 void radiusDumpAttribute(const RadiusAttribute *attribute);
65 
66 void radiusDumpInt32(const uint8_t *data, size_t length);
67 void radiusDumpString(const uint8_t *data, size_t length);
68 void radiusDumpIpv4Addr(const uint8_t *data, size_t length);
69 void radiusDumpIpv6Addr(const uint8_t *data, size_t length);
70 void radiusDumpRawData(const uint8_t *data, size_t length);
71 
72 const char_t *radiusGetParamName(uint_t value, const RadiusParamName *paramList,
73  size_t paramListLen);
74 
75 //C++ guard
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
const char_t * name
Definition: radius_debug.h:53
RadiusPacket
Definition: radius.h:89
uint8_t data[]
Definition: ethernet.h:222
void radiusDumpAttribute(const RadiusAttribute *attribute)
Dump RADIUS attribute.
Definition: radius_debug.c:307
void radiusDumpIpv6Addr(const uint8_t *data, size_t length)
Dump an attribute containing an IPv6 address.
Definition: radius_debug.c:523
void radiusDumpPacket(const RadiusPacket *packet, size_t length)
Dump RADIUS packet for debugging purpose.
Definition: radius_debug.c:259
Formatting and parsing of RADIUS attributes.
void radiusDumpRawData(const uint8_t *data, size_t length)
Dump an attribute containing raw data.
Definition: radius_debug.c:546
RADIUS (Remote Authentication Dial In User Service)
void radiusDumpString(const uint8_t *data, size_t length)
Dump an attribute containing a string.
Definition: radius_debug.c:476
uint8_t length
Definition: tcp.h:368
RadiusAttribute
char char_t
Definition: compiler_port.h:48
Parameter value/name binding.
Definition: radius_debug.h:51
uint8_t value[]
Definition: tcp.h:369
void radiusDumpInt32(const uint8_t *data, size_t length)
Dump an attribute containing a 32-bit integer.
Definition: radius_debug.c:455
unsigned int uint_t
Definition: compiler_port.h:50
const char_t * radiusGetParamName(uint_t value, const RadiusParamName *paramList, size_t paramListLen)
Convert a parameter to string representation.
Definition: radius_debug.c:568
Debugging facilities.
void radiusDumpIpv4Addr(const uint8_t *data, size_t length)
Dump an attribute containing an IPv4 address.
Definition: radius_debug.c:500