#include <stdio.h>#include <errno.h>#include <string.h>#include <dlfcn.h>#include "chtbl.h"#include "config.h"Go to the source code of this file.
Defines | |
| #define | PRIVATE_CODE_ONLY |
| #define | CONFIG_H_ERROR_SIZE 2048 |
| Number of characters for the buffer used to store the last error message. | |
Functions | |
| char * | conf_get_last_error () |
| Return the last error message. More... | |
| int | config_hash_function (const void *key) |
| Hash function used by the hash table module. More... | |
| void | config_free_user_data (void *d) |
| Function used to free allocated memory in the hash table. More... | |
| int | config_compare_user_data (const void *d1, const void *d2) |
| Function used to compare 2 elements in the hash table. More... | |
| int | get_number_of_modem_conf () |
| Return the number of records in the modems' configuration file. More... | |
| char * | dummy_mac_processor (char *addr) |
| Dummy MAC address calculator. More... | |
| int | configlex () |
| Flex generated parser. | |
| int | parse_configuration_file (char *path, int *err) |
| Load a given configuration file. More... | |
| int | modem_conf_get_id (char *mac) |
| Returns the ID of a given MAC address. More... | |
| char * | modem_conf_get_tag_name (int id) |
| Returns the tag name of a given MAC address, representd by its ID. More... | |
| int | modem_conf_is_autoconf (int id) |
| Returns a value that indicates if a given modem supports auto-configuration. More... | |
| void * | modem_conf_get_function (int id) |
| Returns the MAC processor for a given MAC address. More... | |
| void | free_all_configuration_data () |
| Free all data allocated for the hash table. More... | |
| int | get_value (char *tag, char **value) |
| Return the value associated with a given tag. More... | |
Variables | |
| char | last_error [CONFIG_H_ERROR_SIZE] |
| Buffer that contains the last error message. | |
| int | allochtab = 0 |
| This flag indicates wether the memory allocated for the hash table is freed or not. | |
| CHTbl | htab |
| Handler to the hash table. | |
| modem_conf_struct | modem_configuration_list [MODEM_CONF_MAX_ENTRY] |
| This array contains the modems' configuration. The first record is associated with the default configuration. | |
| int | nb_modem |
| Number of configured modems. This integer represents the number of records in the array "modem_configuration_list". | |
| FILE * | configin |
| Flex input file descriptor. | |
Definition in file config.c.
|
|
Return the last error message.
Definition at line 31 of file config.c. References last_error. Referenced by configuration_load(). |
|
||||||||||||
|
Function used to compare 2 elements in the hash table.
Definition at line 80 of file config.c. Referenced by parse_configuration_file(). |
|
|
Function used to free allocated memory in the hash table.
Definition at line 63 of file config.c. Referenced by parse_configuration_file(). |
|
|
Hash function used by the hash table module.
Definition at line 43 of file config.c. Referenced by parse_configuration_file(). |
|
|
Dummy MAC address calculator.
Definition at line 122 of file config.c. Referenced by parse_configuration_file(). |
|
|
Free all data allocated for the hash table.
Definition at line 330 of file config.c. References allochtab, and htab. Referenced by parse_configuration_file(). |
|
|
Return the number of records in the modems' configuration file.
Definition at line 112 of file config.c. References nb_modem. Referenced by modem_conf_get_id(), and parse_configuration_file(). |
|
||||||||||||
|
Return the value associated with a given tag.
Definition at line 343 of file config.c. References htab. Referenced by configuration_load(), and load_mysql_configuration_from_file(). |
|
|
Returns the MAC processor for a given MAC address.
Definition at line 321 of file config.c. References modem_conf_struct::calculate_mac_address. |
|
|
Returns the ID of a given MAC address.
Definition at line 281 of file config.c. References get_number_of_modem_conf(). |
|
|
Returns the tag name of a given MAC address, representd by its ID.
Definition at line 297 of file config.c. References modem_conf_struct::tag_name. |
|
|
Returns a value that indicates if a given modem supports auto-configuration.
Definition at line 309 of file config.c. Referenced by main(). |
|
||||||||||||
|
Load a given configuration file.
Definition at line 171 of file config.c. References allochtab, modem_conf_struct::calculate_mac_address, config_compare_user_data(), config_free_user_data(), CONFIG_H_ERROR_SIZE, config_hash_function(), configin, configlex(), modem_conf_struct::dll, dummy_mac_processor(), free_all_configuration_data(), get_number_of_modem_conf(), htab, modem_conf_struct::id, last_error, MODEM_CONF_ACTION_SIZE, MODEM_CONF_AUTOCONF_SIZE, MODEM_CONF_IDENTIFIER_SIZE, MODEM_CONF_TAG_NAME_SIZE, nb_modem, PARSE_CONFIGURATION_DLL_INVALID, PARSE_CONFIGURATION_DLL_OPEN_ERROR, PARSE_CONFIGURATION_DUPLICATED_TAG, PARSE_CONFIGURATION_FILE_NOT_FOUND, PARSE_CONFIGURATION_MODEM_CONF_NOT_VALID, PARSE_CONFIGURATION_NO_MEM, PARSE_CONFIGURATION_OK, and PARSE_CONFIGURATION_SYNTAX_ERROR. Referenced by configuration_load(), and load_mysql_configuration_from_file(). |
1.2.15