The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/server/dependency.h>
#include <freeradius-devel/server/main_loop.h>
#include <freeradius-devel/protocol/snmp/freeradius.h>
Go to the source code of this file.
Data Structures | |
struct | fr_snmp_map |
Maps a fr_pair_t to the source of a value. More... | |
union | fr_snmp_map.__unnamed69__ |
Macros | |
#define | FR_FREERADIUS_SNMP_TYPE_OBJECT 0 |
#define | SNMP_MAP_TERMINATOR { .name = NULL, .da = NULL, .type = 0 } |
Typedefs | |
typedef int(* | fr_snmp_get_func_t) (TALLOC_CTX *ctx, fr_value_box_t *out, fr_snmp_map_t const *map, void *snmp_ctx) |
typedef int(* | fr_snmp_index_func_t) (TALLOC_CTX *ctx, void **snmp_ctx_out, fr_snmp_map_t const *map, void const *snmp_ctx_in, uint32_t index) |
typedef struct fr_snmp_map | fr_snmp_map_t |
typedef int(* | fr_snmp_set_func_t) (fr_snmp_map_t const *map, void *snmp_ctx, fr_value_box_t *data) |
Functions | |
static int | _fr_snmp_free (UNUSED void *uctx) |
static int | _fr_snmp_init (UNUSED void *uctx) |
static int | _fr_snmp_init_r (fr_snmp_map_t map[], fr_dict_attr_t const *parent) |
Internal SNMP initialisation function (used for recursion) More... | |
int | fr_snmp_init (void) |
Initialise the tree of SNMP map structures used to attach callbacks to OIDs. More... | |
int | fr_snmp_process (request_t *request) |
static int | snmp_auth_client_stats_offset_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, fr_snmp_map_t const *map, void *snmp_ctx) |
static int | snmp_auth_stats_offset_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, fr_snmp_map_t const *map, UNUSED void *snmp_ctx) |
static int | snmp_client_id_get (TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, void *snmp_ctx) |
static int | snmp_client_index (UNUSED TALLOC_CTX *ctx, void **snmp_ctx_out, UNUSED fr_snmp_map_t const *map, NDEBUG_UNUSED void const *snmp_ctx_in, uint32_t index_num) |
static int | snmp_client_index_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, UNUSED fr_snmp_map_t const *map, void *snmp_ctx) |
static int | snmp_client_ipv4addr_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, void *snmp_ctx) |
static int | snmp_config_reset_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx) |
static int | snmp_config_reset_set (NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx, fr_value_box_t *in) |
static int | snmp_config_reset_time_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx) |
static fr_snmp_map_t const * | snmp_map_search (fr_snmp_map_t const map[], fr_dict_attr_t const *da) |
Perform a binary search to find a map matching a da. More... | |
static void | snmp_next_leaf (fr_da_stack_t *da_stack, unsigned int depth, fr_snmp_map_t const *map) |
Perform depth first traversal of the tree until we hit a leaf node. More... | |
static ssize_t | snmp_process (fr_dcursor_t *out, request_t *request, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, fr_snmp_map_t const *map, void *snmp_ctx, unsigned int snmp_op) |
Traverse a tree of SNMP maps. More... | |
static ssize_t | snmp_process_index (fr_dcursor_t *out, request_t *request, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t cursor, fr_snmp_map_t const *map, void *snmp_ctx, unsigned int snmp_op, uint32_t index_num) |
static ssize_t | snmp_process_index_attr (fr_dcursor_t *out, request_t *request, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, fr_snmp_map_t const *map, void *snmp_ctx, unsigned int snmp_op) |
static ssize_t | snmp_process_leaf (fr_dcursor_t *out, request_t *request, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, fr_snmp_map_t const *map, void *snmp_ctx, unsigned int snmp_op) |
static ssize_t | snmp_process_tlv (fr_dcursor_t *out, request_t *request, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, fr_snmp_map_t const *map, void *snmp_ctx, unsigned int snmp_op) |
static int | snmp_value_serv_ident_get (TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx) |
static int | snmp_value_uptime_get (UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx) |
struct fr_snmp_map |
Maps a fr_pair_t to the source of a value.
Mappings between attributes and snmp values are more complex in an SNMP based interface, because we need to traverse the tree, looking at indexes in multiple levels of mapping tables.
Data Fields | ||
---|---|---|
union fr_snmp_map | __unnamed__ | |
fr_snmp_map_t * | child | Child map. |
fr_dict_attr_t const * | da | Dictionary attribute (resolved from attribute number). |
fr_snmp_get_func_t | get | Function to retrieve value. |
fr_snmp_index_func_t | index | Function for traversing indexes. |
char const * | name |
Attribute number. Table entries must be in attribute number order. |
fr_snmp_set_func_t | set | Function to write a new value. |
unsigned int | type | SNMP type - More specific than attribute type. |
union fr_snmp_map.__unnamed69__ |
Data Fields | ||
---|---|---|
fr_snmp_map_t * | last | Last sibling at this level. |
size_t | offset | Offset in snmp_ctx (passed to index function). |
typedef int(* fr_snmp_get_func_t) (TALLOC_CTX *ctx, fr_value_box_t *out, fr_snmp_map_t const *map, void *snmp_ctx) |
typedef int(* fr_snmp_index_func_t) (TALLOC_CTX *ctx, void **snmp_ctx_out, fr_snmp_map_t const *map, void const *snmp_ctx_in, uint32_t index) |
typedef struct fr_snmp_map fr_snmp_map_t |
typedef int(* fr_snmp_set_func_t) (fr_snmp_map_t const *map, void *snmp_ctx, fr_value_box_t *data) |
|
static |
|
static |
|
static |
int fr_snmp_init | ( | void | ) |
int fr_snmp_process | ( | request_t * | request | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Perform depth first traversal of the tree until we hit a leaf node.
This is used for building a fake da_stack, for findNext, so that if we get a findNext operation on something that's not a leaf, we can find the first leaf under that branch of the tree.
[out] | da_stack | to rewrite. |
[in] | depth | at which to start rewriting. |
[in] | map | at this level. |
Definition at line 512 of file snmp.c.
|
static |
Traverse a tree of SNMP maps.
[out] | out | Where to write response attributes. |
[in] | request | The current request. |
[in,out] | da_stack | we're traversing. |
[in] | depth | we're currently at in the da_stack. |
[in] | cursor | representing the current attribute we're processing. |
[in] | map | matching the current depth in the da_stack. |
[in] | snmp_ctx | allocated by the previous index traversal function. |
[in] | snmp_op | we're performing. |
Definition at line 872 of file snmp.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
fr_dict_autoload_t snmp_dict |
fr_dict_attr_autoload_t snmp_dict_attr |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |