radius_attributes.c File Reference

Formatting and parsing of RADIUS attributes. More...

#include "radius/radius.h"
#include "radius/radius_attributes.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   RADIUS_TRACE_LEVEL
 

Functions

void radiusAddAttribute (RadiusPacket *packet, uint8_t type, const void *value, size_t length)
 Append an attribute to a RADIUS packet. More...
 
const RadiusAttributeradiusGetAttribute (const RadiusPacket *packet, uint8_t type, uint_t index)
 Search a RADIUS packet for a given attribute. More...
 

Detailed Description

Formatting and parsing of RADIUS attributes.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneEAP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file radius_attributes.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   RADIUS_TRACE_LEVEL

Definition at line 32 of file radius_attributes.c.

Function Documentation

◆ radiusAddAttribute()

void radiusAddAttribute ( RadiusPacket packet,
uint8_t  type,
const void *  value,
size_t  length 
)

Append an attribute to a RADIUS packet.

Parameters
[in]packetPointer to the RADIUS packet
[in]typeAttribute type
[in]valueAttribute value
[in]lengthLength of the attribute value

Definition at line 51 of file radius_attributes.c.

◆ radiusGetAttribute()

const RadiusAttribute* radiusGetAttribute ( const RadiusPacket packet,
uint8_t  type,
uint_t  index 
)

Search a RADIUS packet for a given attribute.

Parameters
[in]packetPointer to the RADIUS packet
[in]typeAttribute type
[in]indexAttribute occurrence index
Returns
If the specified attribute is found, a pointer to the corresponding attribute is returned. Otherwise NULL pointer is returned

Definition at line 93 of file radius_attributes.c.