counterd_message.c File Reference

Contains message manipulation functions. More...

#include "counterd_config.h"
#include "counterd_message.h"
#include "counterd_kcom.h"
#include "counterd_logging.h"

Go to the source code of this file.

Data Structures

struct  msg_data_s


typedef msg_data_s msg_data_t


boolean reset_message (char *new_message)
char * get_message (void)
uint32_t get_times_viewed (void)


static uint32_t times_viewed = 0

Detailed Description

Contains message manipulation functions.

Contains the message manipulation functions

Definition in file counterd_message.c.

Typedef Documentation

typedef struct msg_data_s msg_data_t

The data structure we store in GENCFG quasi-persistent storage

Function Documentation

char* get_message ( void   ) 

Get Message (for viewing) and increment the message-viewed counter.

message or NULL if it doesn't exist

Definition at line 115 of file counterd_message.c.

References counterd_add_data(), first_message(), msg_data_s::message, counter_data_s::message, msg_data_s::times_viewed, and times_viewed.

Referenced by counterd_show_messages().

uint32_t get_times_viewed ( void   ) 

Get the number of times the message has been viewed

the number of times the message has been viewed

Definition at line 142 of file counterd_message.c.

References times_viewed.

Referenced by counterd_show_messages().

boolean reset_message ( char *  new_message  ) 

Reset the message stored in persistent storage. This function will compare the current contents of what is in storage to the new message, and if they are the same, then it takes sets the local message-viewed counter to the one in storage and continues counting from there. Otherwise, the message is different and we reset the local counter too.

[in] new_message The new configured message
TRUE if new_message was different than what was found in storage; FALSE if there exists an identical message already in storage

Definition at line 71 of file counterd_message.c.

References counterd_add_data(), counterd_get_data(), MESSAGE_STR_SIZE, and times_viewed.

Referenced by counterd_config_read().

Variable Documentation

uint32_t times_viewed = 0 [static]

Number of times the message has been viewed

Definition at line 47 of file counterd_message.c.

Referenced by get_message(), get_times_viewed(), and reset_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:53 2010 for SDK Your Net Corporation Counter Example 1.0 by Doxygen 1.5.1