monitube2-data_config.h File Reference

Relating to getting and setting the configuration data. More...

Go to the source code of this file.

Functions

void init_config (void)
time_t get_current_time (void)
void clear_config (void)
void update_rule (char *name, uint32_t rate, in_addr_t redirect)
int delete_rule (char *name)
void add_address (char *name, in_addr_t addr, in_addr_t mask)
void delete_address (char *name, in_addr_t addr, in_addr_t mask)
void apply_rule (char *name, uint16_t ssid, uint32_t gennum, uint32_t svcid)
void remove_rule (char *name, uint16_t ssid, uint32_t gennum, uint32_t svcid)
void delete_serviceset (uint16_t ssid, uint32_t gennum, uint32_t svcid)
int get_monitored_rule_info (uint16_t ssid, uint32_t svc_id, in_addr_t address, uint32_t *rate, uint32_t *redirect_addr)


Detailed Description

Relating to getting and setting the configuration data.

These functions will store and provide access to the configuration data which is essentially coming from the mgmt component.

Definition in file monitube2-data_config.h.


Function Documentation

void add_address ( char *  name,
in_addr_t  addr,
in_addr_t  mask 
)

Add an address to the rule

Parameters:
[in] name rule name
[in] addr Address
[in] mask Mask to apply to addr

Definition at line 519 of file monitube2-data_config.c.

References address_s::address, rule_s::addresses, bit_count(), CLOG, list_item_s::data, INSIST_ERR, address_s::mask, address_s::node, pdb_shm_handle, prefix_s::prefix, prefix_s::rnode, prefix_s::rule, rules, ss_info_t, rule_s::ssets, WLOCK, and WUNLOCK.

Referenced by mgmt_client_message().

void apply_rule ( char *  name,
uint16_t  ssid,
uint32_t  gennum,
uint32_t  svcid 
)

Apply rule on a service set

Parameters:
[in] name rule name
[in] ssid service set id
[in] gennum Service set generation number needed for PDB
[in] svcid Service ID needed for PDB

Definition at line 667 of file monitube2-data_config.c.

References CLOG, list_item_s::data, INSIST_ERR, pdb_handle, pdb_shm_handle, plugin_id, PLUGIN_NAME, rules, ss_info_t, and rule_s::ssets.

Referenced by mgmt_client_message().

void clear_config ( void   ) 

Clear the stored configuration data

Definition at line 288 of file monitube2-data_config.c.

References CLOG, ctx, delete_rule(), free_policy(), rule_s::name, pdb_handle, plugin_id, PLUGIN_NAME, rules, and ss_info_t.

Referenced by mgmt_client_connection(), and mgmt_client_message().

void delete_address ( char *  name,
in_addr_t  addr,
in_addr_t  mask 
)

Delete an address from the rule

Parameters:
[in] name rule name
[in] addr Address
[in] mask Mask to apply to addr

Definition at line 591 of file monitube2-data_config.c.

References rule_s::addresses, bit_count(), CLOG, list_item_s::data, address_s::node, prefix_s::rule, rules, ss_info_t, rule_s::ssets, WLOCK, and WUNLOCK.

Referenced by mgmt_client_message().

int delete_rule ( char *  name  ) 

Delete rule

Parameters:
[in] name rule name
Returns:
0 on success; -1 o/w

Definition at line 423 of file monitube2-data_config.c.

References address_s::address, rule_s::addresses, bit_count(), CLOG, list_item_s::data, rule_s::lock, address_s::mask, address_s::node, rule_s::node, pdb_shm_handle, prefix_s::rule, rules, ss_info_t, rule_s::ssets, WLOCK, and WUNLOCK.

Referenced by clear_config(), and mgmt_client_message().

void delete_serviceset ( uint16_t  ssid,
uint32_t  gennum,
uint32_t  svcid 
)

Delete service set

Parameters:
[in] ssid service set id

Definition at line 891 of file monitube2-data_config.c.

References CLOG, ctx, list_item_s::data, free_policy(), pdb_handle, pdb_shm_handle, plugin_id, PLUGIN_NAME, ss_info_t, and rule_s::ssets.

Referenced by mgmt_client_message().

time_t get_current_time ( void   ) 

Get the currently cached time

Returns:
Current time

Definition at line 278 of file monitube2-data_config.c.

References current_time.

Referenced by process_packet().

int get_monitored_rule_info ( uint16_t  ssid,
uint32_t  svcid,
in_addr_t  address,
uint32_t *  rate,
uint32_t *  redirect_addr 
)

Find the monitoring rate and redirect address a rule-match happen one exists. This will be run in the fast path.

Parameters:
[in] ssid The service set id
[in] svcid The service id
[in] address The destination address
[out] rate If null on input, this is ignored. The monitoring rate; 0 if no rate
[out] redirect_addr If null on input, this is ignored. The mirror addr; 0 if no mirroring
Returns:
0 if found a valid rule; or -1 if no match is found

Definition at line 994 of file monitube2-data_config.c.

References DLOG, rule_s::lock, pdb_handle, plugin_id, PLUGIN_NAME, rule_s::rate, rule_s::redirect, RLOCK, prefix_s::rule, RUNLOCK, and ss_info_t.

Referenced by monitube_data_hdlr().

void init_config ( void   ) 

Init the data structures that will store configuration info

Should only be called on startup (one time)

Definition at line 257 of file monitube2-data_config.c.

References CLOG, ctx, current_time, MONITUBE2_MGMT_STRLEN, rules, and update_time().

Referenced by retry_attach_fdb().

void remove_rule ( char *  name,
uint16_t  ssid,
uint32_t  gennum,
uint32_t  svcid 
)

Remove a rule from a service set

Parameters:
[in] name rule name
[in] ssid service set id
[in] gennum Service set generation number needed for PDB
[in] svcid Service ID needed for PDB

Definition at line 787 of file monitube2-data_config.c.

References CLOG, ctx, list_item_s::data, free_policy(), pdb_handle, pdb_shm_handle, plugin_id, PLUGIN_NAME, rules, ss_info_t, and rule_s::ssets.

Referenced by mgmt_client_message().

void update_rule ( char *  name,
uint32_t  rate,
in_addr_t  redirect 
)

Update/create a rule

Parameters:
[in] name rule name
[in] rate monitoring rate
[in] redirect address for mirroring

Definition at line 377 of file monitube2-data_config.c.

References rule_s::addresses, CLOG, INSIST_ERR, rule_s::lock, rule_s::name, rule_s::node, pdb_shm_handle, rule_s::rate, rule_s::redirect, rules, rule_s::ssets, WLOCK, and WUNLOCK.

Referenced by mgmt_client_message().


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:27:09 2010 for SDK Your Net Corporation Monitube2 IPTV Monitoring Example: monitube2-plugin 1.0 by Doxygen 1.5.1