monitube-mgmt_config.h File Reference

Relating to loading the configuration data. More...

#include <jnx/patricia.h>

Go to the source code of this file.

Data Structures

struct  address_s
struct  monitor_s
struct  mirror_s
struct  flowstat_s

Defines

#define STATS_BASE_WINDOW   60
 Window of X seconds to use for MDI stats.
#define MAX_MON_NAME   256
 Application name length.

Typedefs

typedef address_s address_t
typedef monitor_s monitor_t
typedef mirror_s mirror_t
typedef flowstat_s flowstat_t

Functions

void init_config (evContext ctx)
void clear_config (void)
int monitube_config_read (int check)
uint8_t get_replication_interval (void)
monitor_tnext_monitor (monitor_t *data)
mirror_tnext_mirror (mirror_t *data)
address_tnext_address (monitor_t *mon, address_t *data)
flowstat_tnext_flowstat (monitor_t *mon, flowstat_t *data)
monitor_tfind_monitor (char *name)
void set_flow_stat (uint16_t fpc_slot, uint16_t pic_slot, const char *name, in_addr_t flow_addr, uint16_t flow_port, double mdi_df, uint32_t mdi_mlr)
void clear_all_flowstats (void)
int clear_flowstats (char *mon_name)


Detailed Description

Relating to loading the configuration data.

These functions will parse and load the configuration data.

Definition in file monitube-mgmt_config.h.


Typedef Documentation

typedef struct address_s address_t

The structure we use to bundle the patricia-tree node with the data to store for each monitor's network address

typedef struct flowstat_s flowstat_t

The structure we use to bundle the patricia-tree node with the data to store for each flow statistic

typedef struct mirror_s mirror_t

The structure we use to bundle the patricia-tree node with the data to store for each mirror

typedef struct monitor_s monitor_t

The structure we use to bundle the patricia-tree node with the data to store for each monitor


Function Documentation

void clear_all_flowstats ( void   ) 

Clear all flow statistics records

Definition at line 1157 of file monitube-mgmt_config.c.

References delete_all_flowstats(), and next_monitor().

Referenced by monitube_clear_stats().

void clear_config ( void   ) 

Clear and reset the entire configuration, freeing all memory.

Definition at line 843 of file monitube-mgmt_config.c.

References delete_all_mirrors(), and delete_all_monitors().

Referenced by monitube_config_read(), monitube_init(), and monitube_shutdown().

int clear_flowstats ( char *  mon_name  ) 

Clear all flow statistics records associated with a monitor

Parameters:
[in] mon_name Monitor's name
Returns:
0 upon success; -1 if there's no monitor configured with the given name

Definition at line 1183 of file monitube-mgmt_config.c.

References delete_all_flowstats(), and monitors_conf.

Referenced by monitube_clear_stats().

monitor_t* find_monitor ( char *  name  ) 

Get the monitor configuration information by name

Parameters:
[in] name Monitor name
Returns:
The monitor if one exists with the matching name, o/w NULL

Definition at line 1041 of file monitube-mgmt_config.c.

References monitors_conf.

Referenced by monitube_show_stats().

uint8_t get_replication_interval ( void   ) 

Get the current replication_interval

Returns:
the replication interval

Definition at line 955 of file monitube-mgmt_config.c.

References replication_interval.

Referenced by receive_connection().

void init_config ( evContext  ctx  ) 

Init the data structures that will store configuration info

Definition at line 829 of file monitube-mgmt_config.c.

References m_ctx, MAX_MON_NAME, mirrors_conf, monitors_conf, and replication_interval.

Referenced by monitube_init().

int monitube_config_read ( int  check  ) 

Read daemon configuration from the database

Parameters:
[in] check 1 if this function being invoked because of a commit check
Returns:
SUCCESS (0) successfully loaded, EFAIL if not
Note:
Do not use ERRMSG/LOG during config check normally.

Definition at line 861 of file monitube-mgmt_config.c.

References clear_config(), delete_all_mirrors(), delete_all_monitors(), notify_replication_interval(), parse_mirrors(), parse_monitors(), process_notifications(), and replication_interval.

Referenced by main().

address_t* next_address ( monitor_t mon,
address_t data 
)

Given a monitor, get the next address in configuration given the previously returned data

Parameters:
[in] mon Monitor's configuration
[in] data previously returned data, should be NULL first time
Returns:
pointer to an address if one more exists, o/w NULL

Definition at line 1005 of file monitube-mgmt_config.c.

References monitor_s::addresses, and address_s::node.

Referenced by receive_connection().

flowstat_t* next_flowstat ( monitor_t mon,
flowstat_t data 
)

Given a monitor, get the next flowstat in configuration given the previously returned data

Parameters:
[in] mon Monitor's configuration
[in] data previously returned data, should be NULL first time
Returns:
pointer to a flowstat if one more exists, o/w NULL

Definition at line 1025 of file monitube-mgmt_config.c.

References monitor_s::flow_stats, and flowstat_s::node.

Referenced by show_monitor_stats().

mirror_t* next_mirror ( mirror_t data  ) 

Get the next mirror in configuration given the previously returned data

Parameters:
[in] data previously returned data, should be NULL first time
Returns:
pointer to a mirror if one more exists, o/w NULL

Definition at line 985 of file monitube-mgmt_config.c.

References mirrors_conf, and mirror_s::node.

Referenced by receive_connection().

monitor_t* next_monitor ( monitor_t data  ) 

Get the next monitor in configuration given the previously returned data

Parameters:
[in] data previously returned data, should be NULL first time
Returns:
pointer to a monitor if one more exists, o/w NULL

Definition at line 969 of file monitube-mgmt_config.c.

References monitors_conf, and monitor_s::node.

Referenced by clear_all_flowstats(), monitube_show_stats(), and receive_connection().

void set_flow_stat ( uint16_t  fpc_slot,
uint16_t  pic_slot,
const char *  name,
in_addr_t  flow_addr,
uint16_t  flow_port,
double  mdi_df,
uint32_t  mdi_mlr 
)

Given a monitor's name and flow address add or update its statistics record

Parameters:
[in] fpc_slot FPC slot #
[in] pic_slot PIC slot #
[in] name Monitor's name
[in] flow_addr flow address (ID)
[in] flow_port flow port (ID)
[in] mdi_df MDI delay factor
[in] mdi_mlr MDI media loss rate

Definition at line 1072 of file monitube-mgmt_config.c.

References age_out_flow_stat(), flowstat_s::flow_addr, flowstat_s::flow_port, monitor_s::flow_stats, flowstat_s::fpc_slot, flowstat_s::last_mdi_df, flowstat_s::last_mdi_mlr, LOG, m_ctx, MAX_FLOW_AGE, flowstat_s::mon, monitors_conf, flowstat_s::node, flowstat_s::pic_slot, flowstat_s::reports, STATS_BASE_WINDOW, flowstat_s::timer_id, and flowstat_s::window_position.

Referenced by receive_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:03 2010 for SDK Your Net Corporation Monitube IPTV Monitoring Example: monitube-mgmt 1.0 by Doxygen 1.5.1