cpd_kcom.c File Reference

Init kcom and register handler. More...

#include <jnx/aux_types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/eventlib.h>
#include <jnx/junos_kcom.h>
#include "cpd_kcom.h"
#include "cpd_config.h"
#include "cpd_http.h"
#include "cpd_logging.h"

Go to the source code of this file.

Defines

#define KCOM_ID_CPD   77
 ID of this app with KCOM.

Functions

static int ifa_async_handler (kcom_ifa_t *msg, void *user_info UNUSED)
static int ifl_iterator (kcom_ifl_t *msg, void *user_info UNUSED)
void check_address_status (void)
int cpd_kcom_init (evContext ctx)


Detailed Description

Init kcom and register handler.

Initialize KCOM and register a handler for ifa changes

Definition in file cpd_kcom.c.


Function Documentation

void check_address_status ( void   ) 

Check for the server address, and if present start the server

Definition at line 162 of file cpd_kcom.c.

References ifl_iterator().

Referenced by client_message().

int cpd_kcom_init ( evContext  ctx  ) 

Init KCOM library and register handlers for asynchronous KCOM messages.

Returns:
KCOM_OK (0) on success, or -1 on error.

Definition at line 176 of file cpd_kcom.c.

References ifa_async_handler(), KCOM_ID_CPD, and LOG.

Referenced by cpd_init().

static int ifa_async_handler ( kcom_ifa_t *  msg,
void *user_info  UNUSED 
) [static]

Gets called for all ifds and calls update_interface with INTERFACE_REFRESH.

Parameters:
[in] msg The ifd we want to know about
[in] user_info User info that was registered to be passed to this callback
Returns:
0 upon successful completion, otherwise -1

Definition at line 55 of file cpd_kcom.c.

References get_cpd_address(), init_http_server(), LOG, and shutdown_http_server().

Referenced by cpd_kcom_init(), and ifl_iterator().

static int ifl_iterator ( kcom_ifl_t *  msg,
void *user_info  UNUSED 
) [static]

Gets called for all iffs and calls update_interface with INTERFACE_REFRESH.

Parameters:
[in] msg The iff we want to know about
[in] user_info User info that was registered to be passed to this callback
Returns:
0 upon successful completion, otherwise -1

Definition at line 132 of file cpd_kcom.c.

References ifa_async_handler(), and LOG.

Referenced by check_address_status().


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