cpd_config.c File Reference

Relating to getting and setting the configuration data coming from the HTTP Server. More...

#include <string.h>
#include "cpd_config.h"
#include "cpd_logging.h"

Go to the source code of this file.

Functions

void init_config (void)
void clear_config (void)
void add_auth_user_addr (in_addr_t addr)
void delete_auth_user_addr (in_addr_t addr)
boolean is_auth_user (in_addr_t addr)
cpd_auth_user_tget_next_auth_user (cpd_auth_user_t *user)
in_addr_t get_pfd_address (void)
void set_pfd_address (in_addr_t addr)
in_addr_t get_cpd_address (void)
void set_cpd_address (in_addr_t addr)

Variables

static in_addr_t pfd_address
 PFD's address in network-byte order.
static in_addr_t cpd_address
 CPD's address in network-byte order.
static patroot root
 patricia tree root


Detailed Description

Relating to getting and setting the configuration data coming from the HTTP Server.

These functions and variables will store and provide access to the configuration data which is the set of authorized users.

Definition in file cpd_config.c.


Function Documentation

void add_auth_user_addr ( in_addr_t  addr  ) 

Add an authorized user from the configured set

Parameters:
[in] addr The user's IP address in network byte order

Definition at line 92 of file cpd_config.c.

References cpd_auth_user_t::address, LOG, cpd_auth_user_t::node, and root.

Referenced by authorize_access().

void clear_config ( void   ) 

Clear the configuration data

Definition at line 68 of file cpd_config.c.

References get_next_auth_user(), LOG, cpd_auth_user_t::node, and root.

Referenced by cpd_ctrl_quit().

void delete_auth_user_addr ( in_addr_t  addr  ) 

Delete an authorized user from the configured set

Parameters:
[in] addr The user's IP address in network byte order

Definition at line 116 of file cpd_config.c.

References LOG, and root.

Referenced by repudiate_access().

in_addr_t get_cpd_address ( void   ) 

Get the CPD address

Returns:
The CPD address in network-byte order

Definition at line 204 of file cpd_config.c.

References cpd_address.

Referenced by client_message(), ifa_async_handler(), and run_http_server().

cpd_auth_user_t* get_next_auth_user ( cpd_auth_user_t user  ) 

Get the next authorized user

Parameters:
[in] user The user returned from the previous call to this function or NULL if it's the first call
Returns:
The next user or NULL if the set of users is empty

Definition at line 165 of file cpd_config.c.

References cpd_auth_user_t::node, and root.

Referenced by clear_config(), and receive_message().

in_addr_t get_pfd_address ( void   ) 

Get the PFD address

Returns:
The PFD address in network-byte order

Definition at line 178 of file cpd_config.c.

References pfd_address.

Referenced by run_http_server().

void init_config ( void   ) 

Init the data structure that will store configuration info, or in other words, the set of authorized users

Definition at line 55 of file cpd_config.c.

References cpd_address, pfd_address, and root.

Referenced by cpd_init().

boolean is_auth_user ( in_addr_t  addr  ) 

Is a user authorized

Parameters:
[in] addr The user's IP address in network byte order
Returns:
TRUE if authorized or FALSE otherwise

Definition at line 150 of file cpd_config.c.

References root.

Referenced by authorize_access(), check_access(), and repudiate_access().

void set_cpd_address ( in_addr_t  addr  ) 

Set the CPD address

Parameters:
[in] addr The new CPD address in network-byte order

Definition at line 217 of file cpd_config.c.

References cpd_address.

Referenced by client_message().

void set_pfd_address ( in_addr_t  addr  ) 

Set the PFD address

Parameters:
[in] addr The new PFD address in network-byte order

Definition at line 191 of file cpd_config.c.

References pfd_address.

Referenced by 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:26:53 2010 for SDK Your Net Corporation Policy Manager Example: Captive Portal Daemon (cpd) 1.0 by Doxygen 1.5.1