networkclient
|
Functions | |
void | nr_packet_print_hex (RADIUS_PACKET *packet) |
size_t | nr_vp_snprintf (char *buffer, size_t bufsize, const VALUE_PAIR *vp) |
size_t | nr_vp_snprintf_value (char *buffer, size_t bufsize, const VALUE_PAIR *vp) |
void | nr_vp_fprintf_list (FILE *fp, const VALUE_PAIR *vps) |
int | nr_vp_sscanf (const char *string, VALUE_PAIR **pvp) |
ssize_t | nr_vp_sscanf_value (VALUE_PAIR *vp, const char *value) |
These routines convert the internal data structures to a printable form, or parse them.
void nr_packet_print_hex | ( | RADIUS_PACKET * | packet | ) |
Pretty-prints a hex dump of a RADIUS packet.
This function is available only in debugging builds of the library. It is useful during development, but should not be used in a production system.
The packet headers are printed individually, and each attribute is printed as "type length data..."
[in] | packet | The RADIUS packet to print |
References radius_packet::data, radius_packet::flags, radius_packet::length, NR_MAX_PACKET_CODE, nr_packet_codes, NR_PACKET_SIGNED, and NR_PACKET_VERIFIED.
Referenced by main().
void nr_vp_fprintf_list | ( | FILE * | fp, |
const VALUE_PAIR * | vps | ||
) |
Prints a list of :VALUE_PAIR structures to the given output.
[in] | fp | Where to print the results |
[in] | vps | Linked list of VALUE_PAIR to print |
References value_pair::next, and nr_vp_snprintf().
Referenced by main().
size_t nr_vp_snprintf | ( | char * | buffer, |
size_t | bufsize, | ||
const VALUE_PAIR * | vp | ||
) |
Pretty-print the entire VALUE_PAIR
All data is printed in ASCII format. The data type of "octets" is printed as a hex string (e.g. 0xabcdef01...). The data type of "ipaddr" is printed as a dotted-quad (e.g. 192.0.2.15).
The format is "Attribute-Name = value"
[out] | buffer | Where the printable version of the VALUE_PAIR is stored |
[in] | bufsize | size of the output buffer |
[in] | vp | VALUE_PAIR to print |
References value_pair::da, nr_dict_attr::name, and nr_vp_snprintf_value().
Referenced by nr_vp_fprintf_list().
size_t nr_vp_snprintf_value | ( | char * | buffer, |
size_t | bufsize, | ||
const VALUE_PAIR * | vp | ||
) |
Pretty-print the VALUE_PAIR::data field
Prints the value of a VALUE_PAIR, without the name or "=" sign.
[out] | buffer | Where the printable version of the VALUE_PAIR is stored |
[in] | bufsize | size of the output buffer |
[in] | vp | VALUE_PAIR to print |
References value_pair::da, value_pair::length, NR_TYPE_BYTE, NR_TYPE_DATE, NR_TYPE_IFID, NR_TYPE_INTEGER, NR_TYPE_INTEGER64, NR_TYPE_IPADDR, NR_TYPE_IPV6ADDR, NR_TYPE_OCTETS, NR_TYPE_SHORT, NR_TYPE_STRING, return_NR_ERR, and nr_dict_attr::type.
Referenced by nr_vp_snprintf().
int nr_vp_sscanf | ( | const char * | string, |
VALUE_PAIR ** | pvp | ||
) |
Scan a string into a VALUE_PAIR. The counterpart to nr_vp_snprintf_value()
[in] | string | Printable version of the VALUE_PAIR |
[out] | pvp | Newly allocated VALUE_PAIR |
References nr_debug_error, nr_dict_attr_byname(), nr_vp_alloc(), nr_vp_free(), nr_vp_sscanf_value(), and return_NR_ERR.
ssize_t nr_vp_sscanf_value | ( | VALUE_PAIR * | vp, |
const char * | value | ||
) |
Scan the data portion of a VALUE_PAIR. The counterpart to nr_vp_snprintf_value()
[in,out] | vp | The VALUE_PAIR where the data will be stored |
[in] | value | The string version of the data to be parsed |
References value_pair::da, value_pair::length, nr_debug_error, NR_TYPE_BYTE, NR_TYPE_DATE, NR_TYPE_IFID, NR_TYPE_INTEGER, NR_TYPE_INTEGER64, NR_TYPE_IPADDR, NR_TYPE_IPV6ADDR, NR_TYPE_SHORT, NR_TYPE_STRING, return_NR_ERR, and nr_dict_attr::type.
Referenced by nr_vp_sscanf().