man ber_decode_null () - Basic Encoding Rules (BER) tag decoding routines

NAME

Basic Encoding Rules (BER) tag decoding routines

LIBRARIES

Abz Library (-labz), Debug Library (-ldebug), BER Library (-lber)

SYNOPSIS

#include <ber/ber.h>

int ber_decode_null(ber_t *ber");
int ber_decode_sequence(ber_t *ber");
int ber_decode_get_request(ber_t *ber");
int ber_decode_get_next_request(ber_t *ber");
int ber_decode_get_response(ber_t *ber");
int ber_decode_set_request(ber_t *ber");
int ber_decode_trap(ber_t *ber");
int ber_decode_get_bulk_request(ber_t *ber");
int ber_decode_inform_request(ber_t *ber");
int ber_decode_snmpv2_trap(ber_t *ber");
int ber_decode_counter64(uint64_t *value, ber_t *ber");
int ber_decode_integer(int32_t *value, ber_t *ber");
int ber_decode_counter32(uint32_t *value, ber_t *ber");
int ber_decode_gauge32(uint32_t *value, ber_t *ber");
int ber_decode_timeticks(uint32_t *ticks, ber_t *ber");
int ber_decode_ipaddress(uint32_t *addr, ber_t *ber");
int ber_decode_octet_string(octet_string_t *str, ber_t *ber");
int ber_decode_string(char **str, ber_t *ber");
int ber_decode_oid(uint32_t **oid, ber_t *ber");
int ber_decode_get_message(ber_t *ber");
int ber_decode_put_message(ber_t *ber");
int ber_decode_auth(ber_t *ber");
int ber_decode_reset(ber_t *ber");
int ber_decode_set_level(ber_t *ber");

DESCRIPTION

These routines are used to decode a BER stack. BER or Basic Encoding Rules (ITU X.690) is a language used to encode data so that it can be transferred and interpreted by different hosts in a platform independant manner.

BER is used to encode data in SNMP and LDAP and probably other popular protocols as well. This library used by the author's SNMP software.

RETURN VALUES

All of the functions return 0 if successful, -1 if some error occurred. Call abz_get_error(3) to retrieve error messages.

NOTES

You have to initialize ber_t (buf, offset, size) before calling any of the functions.

Even though the size and offset field are unsigned 32-bit integers, the size of the buffer should not exceed 2147483647 bytes (maximum 32-bit signed integer value).

The functions decode the buffer from front to back. Although the buffer data and the size of the buffer won't be changed, the offset is updated to where data was decoded.

Remember to free the memory allocated by ber_decode_octet_string() and ber_decode_oid() for returned values.

In the case of the functions where memory is allocated (i.e. ber_decode_octet_string() and ber_decode_oid()), the variables are guaranteed to be NULL if the function fails.

IP addresses are stored in network byte order.

SEE ALSO

AUTHOR

Written by Abraham vd Merwe <abz@blio.com>

CETTE PAGE DOCUMENTE AUSSI :