networkclient
attrs.c File Reference

Attribute encoding and decoding routines. More...

#include <networkradius-devel/client.h>
Include dependency graph for attrs.c:

Functions

ssize_t nr_vp2vsa (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const VALUE_PAIR **pvp, uint8_t *ptr, size_t room)
 
ssize_t nr_vp2rfc (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const VALUE_PAIR **pvp, uint8_t *ptr, size_t room)
 
ssize_t nr_vp2attr (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const VALUE_PAIR **pvp, uint8_t *start, size_t room)
 
ssize_t nr_attr2vp_raw (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const uint8_t *data, size_t length, VALUE_PAIR **pvp)
 
ssize_t nr_attr2vp_rfc (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const uint8_t *data, size_t length, VALUE_PAIR **pvp)
 
int nr_tlv_ok (const uint8_t *data, size_t length, size_t dv_type, size_t dv_length)
 
ssize_t nr_attr2vp_vsa (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const uint8_t *data, size_t length, VALUE_PAIR **pvp)
 
ssize_t nr_attr2vp (const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const uint8_t *data, size_t length, VALUE_PAIR **pvp)
 
ssize_t nr_attr2data (const RADIUS_PACKET *packet, ssize_t start, unsigned int attribute, unsigned int vendor, const uint8_t **pdata, size_t *plength)
 

Detailed Description

Attribute encoding and decoding routines.

Function Documentation

ssize_t nr_vp2vsa ( const RADIUS_PACKET packet,
const RADIUS_PACKET original,
const VALUE_PAIR **  pvp,
uint8_t *  data,
size_t  room 
)

Encodes a Vendor-Specific VALUE_PAIR into an attribute.

Attention
This function should not be called.
Parameters
[in]packetWhere to place the encoded attribute.
[in]originalThe original request (optional), if "packet" is a response
[in,out]pvpThe VALUE_PAIR to encode. On any return >=0, it is updated to point to the "next" VALUE_PAIR which should be encoded.
[in]dataWhere the attribute is to be encoded.
[in]roomHow many octets are available for attribute encoding.
Returns
<0 for error, or the number of octets used to encode the attribute.

References nr_dict_attr::attr, value_pair::da, value_pair::next, nr_debug_error, NR_MAX_VENDOR, PW_VENDOR_SPECIFIC, return_NR_ERR, and nr_dict_attr::vendor.

Referenced by nr_vp2attr().