Go to the source code of this file.
Functions | |
status_t | init_server (evContext ctx) |
void | close_connections (void) |
void | mspic_offline (const char *name) |
void | notify_delete_all_policy (void) |
void | notify_delete_serviceset (uint16_t ss_id, uint32_t gen_num, uint32_t svc_id, uint16_t fpc_slot, uint16_t pic_slot) |
void | notify_apply_rule (char *rule_name, uint16_t ss_id, uint32_t gen_num, uint32_t svc_id, uint16_t fpc_slot, uint16_t pic_slot) |
void | notify_remove_rule (char *rule_name, uint16_t ss_id, uint32_t gen_num, uint32_t svc_id, uint16_t fpc_slot, uint16_t pic_slot) |
void | notify_config_rule (char *rule_name, uint32_t rate, in_addr_t redirect, uint16_t fpc_slot, uint16_t pic_slot) |
void | notify_delete_rule (char *rule_name, uint16_t fpc_slot, uint16_t pic_slot) |
void | notify_config_rule_prefix (char *rule_name, in_addr_t addr, in_addr_t mask, bool delete, uint16_t fpc_slot, uint16_t pic_slot) |
void | process_notifications (void) |
These functions and types will manage the connections.
Definition in file monitube2-mgmt_conn.h.
void close_connections | ( | void | ) |
Close existing connections and shutdown server
Definition at line 357 of file monitube2-mgmt_conn.c.
References mgmt_server, MONITUBE_PORT_NUM, and session_s::session.
status_t init_server | ( | evContext | ctx | ) |
Initialize the server socket connection
[in] | ctx | Newly created event context |
Definition at line 324 of file monitube2-mgmt_conn.c.
References LOG, m_ctx, mgmt_server, MONITUBE_MGMT_SERVER_MAX_CONN, MONITUBE_PORT_NUM, receive_connection(), and receive_message().
Referenced by monitube_init().
void mspic_offline | ( | const char * | name | ) |
Notification about an MS-PIC interface going down
[in] | name | name of interface that has gone down |
Definition at line 390 of file monitube2-mgmt_conn.c.
References session_s::session.
Referenced by ifd_down_async_handler().
void notify_apply_rule | ( | char * | rule_name, | |
uint16_t | ss_id, | |||
uint32_t | gen_num, | |||
uint32_t | svc_id, | |||
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component about a rule application
[in] | rule_name | The rule name |
[in] | ss_id | Service set id |
[in] | gen_num | Generation number of service set |
[in] | svc_id | Service id |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 524 of file monitube2-mgmt_conn.c.
References apply_rule_s::gen_num, MSG_APPLY_RULE, notification_msg_t, apply_rule_s::rule_name, apply_rule_s::rule_name_len, apply_rule_s::ss_id, and apply_rule_s::svc_id.
Referenced by apply_rules(), receive_connection(), ss_change(), and verify_service_interfaces().
void notify_config_rule | ( | char * | rule_name, | |
uint32_t | rate, | |||
in_addr_t | redirect, | |||
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component about a rule configuration
[in] | rule_name | The rule name |
[in] | rate | Monitoring rate |
[in] | redirect | Mirror/redirect IP address |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 639 of file monitube2-mgmt_conn.c.
References MSG_CONF_RULE_ACTION, notification_msg_t, update_rule_action_s::rate, update_rule_action_s::redirect, update_rule_action_s::rule_name, and update_rule_action_s::rule_name_len.
Referenced by apply_rules(), parse_addresses(), parse_rules(), receive_connection(), and verify_service_interfaces().
void notify_config_rule_prefix | ( | char * | rule_name, | |
in_addr_t | addr, | |||
in_addr_t | mask, | |||
bool | delete, | |||
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component about a rule's prefix configuration
[in] | rule_name | The rule name |
[in] | addr | IP prefix |
[in] | mask | Mask for prefix length |
[in] | delete | Are we deleting the prefix or adding it |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 741 of file monitube2-mgmt_conn.c.
References rule_addr_s::addr, rule_addr_s::mask, MSG_CONF_RULE_MATCH_ADDR, MSG_DELETE_RULE_MATCH_ADDR, notification_msg_t, rule_addr_s::rule_name, and rule_addr_s::rule_name_len.
Referenced by apply_rules(), parse_addresses(), receive_connection(), and verify_service_interfaces().
void notify_delete_all_policy | ( | void | ) |
Enqueue a message to go to the data component to delete all policy
Message relayed to all PICs
Definition at line 428 of file monitube2-mgmt_conn.c.
References MSG_DELETE_ALL, and notification_msg_t.
Referenced by delete_all_servicesets().
void notify_delete_rule | ( | char * | rule_name, | |
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component about a rule delete
[in] | rule_name | The rule name |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 687 of file monitube2-mgmt_conn.c.
References MSG_DELETE_RULE, notification_msg_t, delete_rule_s::rule_name, and delete_rule_s::rule_name_len.
Referenced by delete_rule(), and parse_addresses().
void notify_delete_serviceset | ( | uint16_t | ss_id, | |
uint32_t | gen_num, | |||
uint32_t | svc_id, | |||
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component to delete policy for a service set given the service set id
[in] | ss_id | service set id |
[in] | gen_num | Generation number of service set |
[in] | svc_id | Service id |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 468 of file monitube2-mgmt_conn.c.
References del_ss_s::gen_num, MSG_DELETE_SS, notification_msg_t, del_ss_s::ss_id, and del_ss_s::svc_id.
Referenced by apply_rules(), delete_serviceset(), and verify_service_interfaces().
void notify_remove_rule | ( | char * | rule_name, | |
uint16_t | ss_id, | |||
uint32_t | gen_num, | |||
uint32_t | svc_id, | |||
uint16_t | fpc_slot, | |||
uint16_t | pic_slot | |||
) |
Enqueue a message to go to the data component about a rule removal
[in] | rule_name | The rule name |
[in] | ss_id | Service set id |
[in] | gen_num | Generation number of service set |
[in] | svc_id | Service id |
[in] | fpc_slot | FPC slot # of the MS PIC to send this to |
[in] | pic_slot | PIC slot # of the MS PIC to send this to |
Definition at line 583 of file monitube2-mgmt_conn.c.
References apply_rule_s::gen_num, MSG_REMOVE_RULE, notification_msg_t, apply_rule_s::rule_name, apply_rule_s::rule_name_len, apply_rule_s::ss_id, and apply_rule_s::svc_id.
Referenced by apply_rules().
void process_notifications | ( | void | ) |
Go through the buffered messages and send them to the data component if it's connected.
Definition at line 786 of file monitube2-mgmt_conn.c.
References LOG, notification_msg_t, and session_s::session.
Referenced by clear_config(), monitube_config_read(), and receive_connection().