helloworldd_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 "helloworldd_config.h"

Go to the source code of this file.

Functions

static int delete_message (helloworld_data_t *data)
static helloworld_data_tadd_message (const char *message)
static int clear_messages (void)
void init_messages_ds (void)
helloworld_data_tfirst_message (void)
helloworld_data_tnext_message (helloworld_data_t *data)
int helloworld_config_read (int check __unused)

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 helloworldd_config.c.


Function Documentation

static helloworld_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 or NULL on error

Definition at line 77 of file helloworldd_config.c.

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

Referenced by helloworld_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 helloworldd_config.c.

References delete_message(), and first_message().

Referenced by helloworld_config_read().

static int delete_message ( helloworld_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 helloworldd_config.c.

References root.

Referenced by clear_messages().

helloworld_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 helloworldd_config.c.

References root.

Referenced by clear_messages(), and helloworld_show_message().

int helloworld_config_read ( int check  __unused  ) 

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 helloworldd_config.c.

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

Referenced by main().

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 helloworldd_config.c.

References MESSAGE_STR_SIZE, and root.

Referenced by helloworld_init().

helloworld_data_t* next_message ( helloworld_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 helloworldd_config.c.

References helloworld_data_s::node, and root.

Referenced by helloworld_show_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:26:59 2010 for SDK Your Net Corporation Helloworld Example 1.0 by Doxygen 1.5.1