![]() |
The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
|
IP population tool. More...
#include <freeradius-devel/server/base.h>#include <freeradius-devel/server/module_rlm.h>#include <freeradius-devel/io/listen.h>#include <freeradius-devel/unlang/base.h>#include <freeradius-devel/io/thread.h>#include "base.h"#include "redis_ippool.h"
Include dependency graph for rlm_redis_ippool_tool.c:Go to the source code of this file.
Data Structures | |
| struct | ippool_tool_operation_t |
| A single pool operation. More... | |
Macros | |
| #define | ADD_ACTION(_action) |
| #define | EOL "\n" |
| #define | EXIT_WITH_FAILURE |
Typedefs | |
| typedef enum ippool_tool_action | ippool_tool_action_t |
| Pool management actions. | |
Enumerations | |
| enum | ippool_tool_action { IPPOOL_TOOL_NOOP = 0 , IPPOOL_TOOL_ADD , IPPOOL_TOOL_REMOVE , IPPOOL_TOOL_RELEASE , IPPOOL_TOOL_SHOW , IPPOOL_TOOL_MODIFY , IPPOOL_TOOL_ASSIGN , IPPOOL_TOOL_UNASSIGN } |
| Pool management actions. More... | |
Functions | |
| static bool | ipaddr_next (fr_ipaddr_t *ipaddr, fr_ipaddr_t const *end, uint8_t prefix) |
| Iterate over range of IP addresses. | |
| int | main (int argc, char *argv[]) |
| static int | parse_ip_range (fr_ipaddr_t *start_out, fr_ipaddr_t *end_out, char const *ip_str, uint8_t prefix) |
| Convert an IP range or CIDR mask to a start and stop address. | |
| static int | redis_ippool_get_pools (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, fr_event_list_t *el) |
| Run the redis_ippool.pools.list xlat to fetch the list of pools across the cluster. | |
| static int | redis_ippool_get_stats (request_t *request, fr_value_box_t *pool_name, CONF_SECTION *section, fr_event_list_t *el) |
| Run the redis_ippool.stats module method to fetch pool statistics. | |
| static int | redis_ippool_show (request_t *request, ippool_tool_operation_t const *op, CONF_SECTION *section, fr_event_list_t *el) |
| Run the redis_ippool.show module method to fetch lease details. | |
| static request_t * | request_from_internal (TALLOC_CTX *ctx) |
| static int | run_xlat (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, fr_sbuff_t *xlat, fr_event_list_t *el) |
| static uint32_t | uint32_gen_mask (uint8_t bits) |
| static NEVER_RETURNS void | usage (int ret) |
| static int | xlat_add_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, fr_event_list_t *el) |
| static int | xlat_assign_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, char const *owner, fr_event_list_t *el) |
| static int | xlat_modify_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, fr_event_list_t *el) |
| static int | xlat_release_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, fr_event_list_t *el) |
| static int | xlat_remove_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, fr_event_list_t *el) |
| static int | xlat_unassign_lease (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, ippool_tool_operation_t *op, char const *owner, fr_event_list_t *el) |
IP population tool.
Definition in file rlm_redis_ippool_tool.c.
| struct ippool_tool_operation_t |
A single pool operation.
Definition at line 124 of file rlm_redis_ippool_tool.c.
Collaboration diagram for ippool_tool_operation_t:| Data Fields | ||
|---|---|---|
| ippool_tool_action_t | action | What to do to the leases described by net/prefix. |
| fr_ipaddr_t | end | End address. |
| char const * | name | Original range or CIDR string. |
| uint8_t const * | pool | Pool identifier. |
| size_t | pool_len | Length of the pool identifier. |
| uint8_t | prefix | Prefix - The bits between the address mask, and the prefix form the addresses to be modified in the pool. |
| uint8_t const * | range | Range identifier. |
| size_t | range_len | Length of the range identifier. |
| fr_ipaddr_t | start | Start address. |
| #define ADD_ACTION | ( | _action | ) |
| #define EOL "\n" |
Definition at line 142 of file rlm_redis_ippool_tool.c.
| #define EXIT_WITH_FAILURE |
Definition at line 37 of file rlm_redis_ippool_tool.c.
| typedef enum ippool_tool_action ippool_tool_action_t |
Pool management actions.
| enum ippool_tool_action |
Pool management actions.
Definition at line 110 of file rlm_redis_ippool_tool.c.
|
static |
Iterate over range of IP addresses.
Mutates the ipaddr passed in, adding one to the prefix bits on each call.
| [in,out] | ipaddr | to increment. |
| [in] | end | ipaddr to stop at. |
| [in] | prefix | Length of the prefix. |
Definition at line 230 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int main | ( | int argc | , |
| char * | argv[] | ||
| ) |
Definition at line 726 of file rlm_redis_ippool_tool.c.
|
static |
Convert an IP range or CIDR mask to a start and stop address.
| [out] | start_out | Where to write the start address. |
| [out] | end_out | Where to write the end address. |
| [in] | ip_str | Unparsed IP string. |
| [in] | prefix | length of prefixes we'll be allocating. |
Definition at line 362 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Run the redis_ippool.pools.list xlat to fetch the list of pools across the cluster.
Definition at line 664 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Run the redis_ippool.stats module method to fetch pool statistics.
Definition at line 283 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Run the redis_ippool.show module method to fetch lease details.
Definition at line 315 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 671 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 525 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 173 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 562 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 628 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 613 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 598 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 583 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 648 of file rlm_redis_ippool_tool.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 51 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 53 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 55 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 54 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 57 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 56 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 58 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 59 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 52 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 60 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 62 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 68 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 67 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 65 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 66 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 64 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 63 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 69 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 71 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 75 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 74 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 72 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 73 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 70 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 61 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 43 of file rlm_redis_ippool_tool.c.
|
static |
Definition at line 140 of file rlm_redis_ippool_tool.c.
| fr_dict_autoload_t redis_ippool_tool_dict |
Definition at line 46 of file rlm_redis_ippool_tool.c.
| fr_dict_attr_autoload_t redis_ippool_tool_dict_attr |
Definition at line 78 of file rlm_redis_ippool_tool.c.
|
static |
Static server config split into two parts.
The command line provided server value is inserted between the two sections, along with an optional $INCLUDE if the -f option is provided
Definition at line 149 of file rlm_redis_ippool_tool.c.
|
static |
1.9.8