More...
#include <sys/types.h>
#include "../../str.h"


Go to the source code of this file.
Data Structures | |
| struct | carrier_data_t |
Functions | |
| int | add_domain_data (struct carrier_data_t *carrier_data, struct domain_data_t *domain_data, int index) |
| int | compare_carrier_data (const void *v1, const void *v2) |
| struct carrier_data_t * | create_carrier_data (int carrier_id, str *carrier_name, int domains) |
| void | destroy_carrier_data (struct carrier_data_t *carrier_data) |
| struct domain_data_t * | get_domain_data (struct carrier_data_t *carrier_data, int domain_id) |
Definition in file cr_carrier.h.
| int add_domain_data | ( | struct carrier_data_t * | carrier_data, | |
| struct domain_data_t * | domain_data, | |||
| int | index | |||
| ) |
Adds a domain_data struct to the given carrier data structure at the given index. Other etries are moved one position up to make space for the new one.
| carrier_data | the carrier data struct where domain_data should be inserted | |
| domain_data | the domain data struct to be inserted | |
| index | the index where to insert the domain_data structure in the domain array |
Definition at line 99 of file cr_carrier.c.
References carrier_data_t::domain_num, carrier_data_t::domains, carrier_data_t::first_empty_domain, carrier_data_t::id, domain_data_t::id, _str::len, LM_DBG, LM_ERR, LM_INFO, carrier_data_t::name, domain_data_t::name, and _str::s.
Referenced by get_domain_data_or_add().
| int compare_carrier_data | ( | const void * | v1, | |
| const void * | v2 | |||
| ) |
Compares the IDs of two carrier data structures. A NULL pointer is always greater than any ID.
Definition at line 155 of file cr_carrier.c.
References carrier_data_t::id, and NULL.
Referenced by get_carrier_data(), and reload_route_data().
| struct carrier_data_t* create_carrier_data | ( | int | carrier_id, | |
| str * | carrier_name, | |||
| int | domains | |||
| ) | [read] |
Create a new carrier_data struct in shared memory and set it up.
| carrier_id | id of carrier | |
| carrier_name | pointer to the name of the carrier | |
| domains | number of domains for that carrier |
Definition at line 48 of file cr_carrier.c.
References carrier_data_t::domain_num, carrier_data_t::domains, carrier_data_t::id, carrier_data_t::name, NULL, shm_free, shm_malloc(), and SHM_MEM_ERROR.
Referenced by load_config(), and load_route_data_db().
| void destroy_carrier_data | ( | struct carrier_data_t * | carrier_data | ) |
Destroys the given carrier and frees the used memory.
| carrier_data | the structure to be destroyed. |
Definition at line 75 of file cr_carrier.c.
References destroy_domain_data(), carrier_data_t::domain_num, carrier_data_t::domains, NULL, and shm_free.
Referenced by clear_route_data(), load_config(), and load_route_data_db().
| struct domain_data_t* get_domain_data | ( | struct carrier_data_t * | carrier_data, | |
| int | domain_id | |||
| ) | [read] |
Returns the domain data for the given id by doing a binary search.
| carrier_data | carrier data to be searched | |
| domain_id | the id of desired domain |
Definition at line 133 of file cr_carrier.c.
References compare_domain_data(), carrier_data_t::domain_num, carrier_data_t::domains, domain_data_t::id, LM_ERR, and NULL.
Referenced by cr_do_route(), and cr_load_next_domain().
1.5.6