#include <sync/dpm_ipc.h>
Go to the source code of this file.
Functions | |
status_t | init_configuration (void) |
void | clear_configuration (void) |
void | reset_configuration (uint8_t filter_mode) |
void | configuration_complete (void) |
void | configure_policer (policer_info_t *policer) |
void | configure_managed_interface (int_info_t *interface) |
void | configure_subscriber (sub_info_t *subscriber) |
boolean | validate_credentials (char *username, char *password) |
boolean | user_logged_in (in_addr_t address) |
status_t | apply_policy (char *username, in_addr_t address) |
void | remove_policy (in_addr_t address) |
These functions will store and provide access to the configuration data which is essentailly coming from the mgmt component.
Definition in file dpm-ctrl_config.h.
status_t apply_policy | ( | char * | username, | |
in_addr_t | address | |||
) |
Apply the policy for this user, and add them to the logged in users
[in] | username | The subscriber's name |
[in] | address | The user's IP address |
Definition at line 454 of file dpm-ctrl_config.c.
References user_s::address, apply_subscriber_policer(), int_pol_s::ifl_name, INSIST_ERR, user_s::interface, LOG, sub_info_s::name, user_s::node, subscriber_s::policer, user_s::sub, and subscriber_s::subscriber.
Referenced by login().
void clear_configuration | ( | void | ) |
Clear the configuration data
Definition at line 184 of file dpm-ctrl_config.c.
References LOG, user_s::node, subscriber_s::node, int_pol_s::node, policer_s::node, and int_pol_s::node2.
Referenced by dpm_quit(), mgmt_client_connection(), and reset_configuration().
void configuration_complete | ( | void | ) |
All configuration should now be received
Definition at line 252 of file dpm-ctrl_config.c.
References apply_default_int_policy(), create_policer(), int_pol_s::ifl_name, int_pol_s::input_pol, policer_s::node, int_pol_s::output_pol, reset_all_filters(), and resume_http_server().
Referenced by mgmt_client_message().
void configure_managed_interface | ( | int_info_t * | interface | ) |
Configure a managed interface All policers should be configured first
[in] | interface | The interface configuration received from the mgmt component |
Definition at line 317 of file dpm-ctrl_config.c.
References int_pol_s::ifl_name, int_info_s::index, int_pol_s::index, int_info_s::input_pol, int_pol_s::input_pol, INSIST_ERR, LOG, int_info_s::name, int_pol_s::node, int_pol_s::node2, int_info_s::output_pol, int_pol_s::output_pol, and int_info_s::subunit.
Referenced by mgmt_client_message().
void configure_policer | ( | policer_info_t * | policer | ) |
Configure a policer
[in] | policer | The policer configuration received from the mgmt component |
Definition at line 286 of file dpm-ctrl_config.c.
References INSIST_ERR, LOG, and policer_s::node.
Referenced by mgmt_client_message().
void configure_subscriber | ( | sub_info_t * | subscriber | ) |
Configure a subscriber All policers and managed interfaces should be configured first
[in] | subscriber | The subscriber configuration received from the mgmt component |
Definition at line 366 of file dpm-ctrl_config.c.
References INSIST_ERR, LOG, sub_info_s::name, subscriber_s::node, sub_info_s::policer, subscriber_s::policer, and subscriber_s::subscriber.
Referenced by mgmt_client_message().
status_t init_configuration | ( | void | ) |
Init the data structures that will store configuration info
Definition at line 158 of file dpm-ctrl_config.c.
References LOG, MAX_INT_NAME, MAX_POL_NAME, MAX_SUB_NAME, and VRFINDEX_ERROR.
Referenced by dpm_init().
void remove_policy | ( | in_addr_t | address | ) |
Remove the policy for this user, and remove them from the logged in users
[in] | address | The user's IP address |
Definition at line 533 of file dpm-ctrl_config.c.
References int_pol_s::ifl_name, user_s::interface, LOG, sub_info_s::name, user_s::node, revoke_subscriber_policer(), user_s::sub, and subscriber_s::subscriber.
Referenced by logout().
void reset_configuration | ( | uint8_t | filter_mode | ) |
Reset the configuration
Definition at line 240 of file dpm-ctrl_config.c.
References clear_configuration(), and suspend_http_server().
Referenced by mgmt_client_message().
boolean user_logged_in | ( | in_addr_t | address | ) |
Check for a match with the IP address
[in] | address | The user's IP address |
Definition at line 436 of file dpm-ctrl_config.c.
Referenced by check_access(), and logout().
boolean validate_credentials | ( | char * | username, | |
char * | password | |||
) |
Check for a match with the username-password pair
[in] | username | The subscriber's name |
[in] | password | The subscriber's password |
Definition at line 412 of file dpm-ctrl_config.c.
References sub_info_s::password, and subscriber_s::subscriber.
Referenced by login().