counterd_config.c File Reference

Relating to loading and storing the configuration data. More...

#include <ddl/dax.h>
#include <jnx/patricia.h>
#include <jnx/junos_trace.h>
#include "counterd_config.h"
#include "counterd_message.h"

Go to the source code of this file.

Functions

static int delete_message (counter_data_t *data)
static counter_data_tadd_message (const char *message)
static int clear_messages (void)
void init_messages_ds (void)
counter_data_tfirst_message (void)
counter_data_tnext_message (counter_data_t *data)
int counterd_config_read (int check)

Variables

static patroot root
 patricia tree root


Detailed Description

Relating to loading and storing the configuration data.

These functions and variables will parse, load, hold, and return the configuration data.

Definition in file counterd_config.c.


Function Documentation

static counter_data_t* add_message ( const char *  message  )  [static]

Add a message to the configuration data in the patricia tree

Parameters:
message the message to add
Returns:
pointer to the new data entry added

Definition at line 77 of file counterd_config.c.

References counter_data_s::message, MESSAGE_STR_SIZE, counter_data_s::node, and root.

Referenced by counterd_config_read().

static int clear_messages ( void   )  [static]

Clear the configuration info completely from the patricia tree

Returns:
SUCCESS or EFAIL on failure to delete some contents

Definition at line 107 of file counterd_config.c.

References delete_message(), and first_message().

Referenced by counterd_config_read().

int counterd_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) if successfully loaded; otherwise EFAIL (1)
Note:
Do not use ERRMSG during config check.

Definition at line 173 of file counterd_config.c.

References add_message(), clear_messages(), MESSAGE_STR_SIZE, and reset_message().

Referenced by main().

static int delete_message ( counter_data_t data  )  [static]

Remove a message from the configuration...used only internally when emptying the patricia tree (in clear_messages)

Parameters:
[in] data Message/Data to delete from the configuration data storage
Returns:
SUCCESS or EFAIL on failure to delete (from patricia tree)

Definition at line 55 of file counterd_config.c.

References root.

Referenced by clear_messages().

counter_data_t* first_message ( void   ) 

Get the first of the messages that this daemon stores

Returns:
pointer to the first data entry if one exists, o/w NULL

Definition at line 140 of file counterd_config.c.

References root.

Referenced by clear_messages(), and get_message().

void init_messages_ds ( void   ) 

Init the data structure that will store configuration info, or in other words, the message(s)

Definition at line 128 of file counterd_config.c.

References MESSAGE_STR_SIZE, and root.

Referenced by counterd_init().

counter_data_t* next_message ( counter_data_t data  ) 

Get the next message that this daemon stores given the previously returned data (from first_message or next_message)

Parameters:
data previously return data
Returns:
pointer to the first data entry if one exists, o/w NULL

Definition at line 156 of file counterd_config.c.

References counter_data_s::node, and root.


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:26:53 2010 for SDK Your Net Corporation Counter Example 1.0 by Doxygen 1.5.1