Manipulation of network address pools
Overview
// global functions int tapi_cfg_alloc_entry(const char* parent_oid, cfg_handle* entry); int tapi_cfg_free_entry(cfg_handle* entry); static int tapi_cfg_alloc_ip4_net(cfg_handle* entry); static int tapi_cfg_alloc_ip6_net(cfg_handle* entry); te_errno tapi_cfg_alloc_net(int af, cfg_handle* entry); te_errno tapi_cfg_add_net(const char* net_pool, const struct sockaddr* net_addr, unsigned int prefix, int state, cfg_handle* entry); static te_errno tapi_cfg_add_ip4_net(const struct sockaddr_in* ip4_net_addr, unsigned int prefix, int state, cfg_handle* entry); static te_errno tapi_cfg_add_ip6_net(const struct sockaddr_in6* ip6_net_addr, unsigned int prefix, int state, cfg_handle* entry); int tapi_cfg_alloc_net_addr(cfg_handle net_pool_entry, cfg_handle* p_entry, struct sockaddr** addr); int tapi_cfg_add_net_addr(cfg_handle net_pool_entry, struct sockaddr* add_addr, cfg_handle* p_entry);
Detailed Documentation
Global Functions
int tapi_cfg_alloc_entry(const char* parent_oid, cfg_handle* entry)
Get Configurator handle of free child. The function assumes that all children of the parent has integer value. Zero value is considered as the child is free. The child is marked as non-free by set of 1 as the child value.
Parameters:
parent_oid |
Parent instance OID |
entry |
Location for entry handle |
Returns:
Status code.
See also:
int tapi_cfg_free_entry(cfg_handle* entry)
Free earlier allocated child. Entry handle is set to CFG_HANDLE_INVALID on success.
Parameters:
entry |
Location of entry handle |
Returns:
Status code.
See also:
static int tapi_cfg_alloc_ip4_net(cfg_handle* entry)
Allocate entry in IPv4 subnets pool.
Use tapi_cfg_free_entry function to free allocated entry.
Parameters:
entry |
Location for Cfgr handle |
Returns:
Status code.
See also:
tapi_cfg_free_entry, tapi_cfg_alloc_net_addr
static int tapi_cfg_alloc_ip6_net(cfg_handle* entry)
Allocate entry in IPv6 subnets pool.
Use tapi_cfg_free_entry function to free allocated entry.
Parameters:
entry |
Location for Cfgr handle |
Returns:
Status code.
See also:
tapi_cfg_free_entry, tapi_cfg_alloc_net_addr
te_errno tapi_cfg_alloc_net(int af, cfg_handle* entry)
Allocate entry in IPv4 or IPv6 subnets pool.
Use tapi_cfg_free_entry() function to free allocated entry.
Parameters:
af |
|
entry |
Location for Configurator handle |
Returns:
Status code.
te_errno tapi_cfg_add_net(const char* net_pool, const struct sockaddr* net_addr, unsigned int prefix, int state, cfg_handle* entry)
Add entry to IPv4 or IPv6 subnets pool.
Parameters:
net_pool |
Name of the pool |
net_addr |
Network address (or any network node address) |
prefix |
Network address prefix |
state |
Pool entry initial state (0 or 1) |
entry |
Location for Cfgr handle of new entry |
Returns:
Status code.
static te_errno tapi_cfg_add_ip4_net(const struct sockaddr_in* ip4_net_addr, unsigned int prefix, int state, cfg_handle* entry)
Add entry to IPv4 subnets pool.
Parameters:
ip4_net_addr |
Network address (or any network node address) |
prefix |
Network address prefix |
state |
Pool entry initial state (0 or 1) |
entry |
Location for Cfgr handle of new entry |
Returns:
Status code.
static te_errno tapi_cfg_add_ip6_net(const struct sockaddr_in6* ip6_net_addr, unsigned int prefix, int state, cfg_handle* entry)
Add entry to IPv6 subnets pool.
Parameters:
ip6_net_addr |
Network address (or any network node address) |
prefix |
Network address prefix |
state |
Pool entry initial state (0 or 1) |
entry |
Location for Cfgr handle of new entry |
Returns:
Status code.
int tapi_cfg_alloc_net_addr(cfg_handle net_pool_entry, cfg_handle* p_entry, struct sockaddr** addr)
Allocate IPv4 address from IPv4 subnet got from IPv4 subnets pool.
Use tapi_cfg_free_entry function to free allocated entry.
Parameters:
net_pool_entry |
Subnet handle |
p_entry |
Location for Cfgr handle of new entry |
addr |
Location for allocated address |
Returns:
Status code.
See also:
tapi_cfg_free_entry, tapi_cfg_alloc_ip4_net
int tapi_cfg_add_net_addr(cfg_handle net_pool_entry, struct sockaddr* add_addr, cfg_handle* p_entry)
Add IPv4 address to IPv4 subnet from IPv4 subnets pool.
Parameters:
net_pool_entry |
Subnet handle |
add_addr |
Address to add in pool |
p_entry |
Location for Cfgr handle of new entry |
Returns:
Status code.