equilibrium2-mgmt_kcom.c File Reference

Init kcom and register handler. More...

#include <sync/equilibrium2.h>
#include "equilibrium2-mgmt.h"
#include <stdlib.h>
#include <string.h>
#include <jnx/aux_types.h>
#include <jnx/trace.h>
#include <jnx/junos_trace.h>

Go to the source code of this file.

Defines

#define MSP_IFD_NAME_PATTERN   "ms-"

Functions

static int ifd_async_hdlr (kcom_ifdev_t *msg, void *user_info UNUSED)
 Gets called for all ifds. Watch for MS PIC which we are connected to going down.
static int ssrb_async_hdlr (junos_kcom_pub_blob_msg_t *kpb_msg, void *arg UNUSED)
 Notification handler for SSRB events.
static int get_initial_ssrb (junos_kcom_pub_blob_t *pub_blob, void *arg UNUSED)
 Handler to get initial SSRBs.
static int gencfg_async_hdlr (junos_kcom_gencfg_t *gencfg)
 GENCFG notification handler (does nothing).
int kcom_add_config_blob (config_blob_key_t *key, void *blob)
 Add a configuration blob.
int kcom_del_config_blob (config_blob_key_t *key)
 Delete a configuration blob.
int kcom_get_config_blob (void)
 Get all configuration blobs.
int kcom_init (evContext ctx)
 Init KCOM library and register handlers for asynchronous KCOM messages.
void kcom_close (void)
 Shutdown KCOM library and register handlers for asynchronous KCOM messages.


Detailed Description

Init kcom and register handler.

Initialize KCOM and register handlers

Definition in file equilibrium2-mgmt_kcom.c.


Define Documentation

#define MSP_IFD_NAME_PATTERN   "ms-"

prefix of MS PIC interface names

Definition at line 34 of file equilibrium2-mgmt_kcom.c.

Referenced by ifd_async_hdlr().


Function Documentation

static int gencfg_async_hdlr ( junos_kcom_gencfg_t *  gencfg  )  [static]

GENCFG notification handler (does nothing).

Parameters:
[in] gencfg GENCFG message
Returns:
KCOM_OK (0) always

Definition at line 173 of file equilibrium2-mgmt_kcom.c.

References EQ2_TRACE.

Referenced by kcom_init().

static int get_initial_ssrb ( junos_kcom_pub_blob_t *  pub_blob,
void *arg  UNUSED 
) [static]

Handler to get initial SSRBs.

Parameters:
[in] pub_blob SSR blob
[in] arg Cookie passed in registration
Returns:
KCOM_OK (0) on success, -1 on failure

Definition at line 142 of file equilibrium2-mgmt_kcom.c.

References CONFIG_SSRB_ADD, config_ssrb_op(), EQ2_LOG, and EQ2_TRACE.

Referenced by kcom_init().

static int ifd_async_hdlr ( kcom_ifdev_t *  msg,
void *user_info  UNUSED 
) [static]

Gets called for all ifds. Watch for MS PIC which we are connected to going down.

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 on success, -1 on failure

Definition at line 55 of file equilibrium2-mgmt_kcom.c.

References EQ2_TRACE, and MSP_IFD_NAME_PATTERN.

Referenced by kcom_init().

int kcom_add_config_blob ( config_blob_key_t key,
void *  blob 
)

Add a configuration blob.

Parameters:
[in] key Pointer to the blob key
[in] blob Pointer to the blob
Returns:
0 on success, -1 on failure

Definition at line 206 of file equilibrium2-mgmt_kcom.c.

References CONFIG_BLOB_SVC_SET, CONFIG_BLOB_SVR_GROUP, EQ2_LOG, eq2_provider_id, EQ2_TRACE, blob_svr_group_set_s::gs_cksum, blob_svr_group_set_s::gs_size, svc_if_s::if_name, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, config_blob_key_s::key_tag, blob_svc_set_s::ss_cksum, blob_svc_set_s::ss_if_name, blob_svc_set_s::ss_size, svc_if_count, and svc_if_head.

Referenced by add_svc_set_blob(), and config_post_proc().

int kcom_del_config_blob ( config_blob_key_t key  ) 

Delete a configuration blob.

Parameters:
[in] key Pointer to the blob key
Returns:
0 on success, -1 on failure

Definition at line 289 of file equilibrium2-mgmt_kcom.c.

References EQ2_LOG, eq2_provider_id, EQ2_TRACE, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, and config_blob_key_s::key_tag.

Referenced by config_svc_set_blob_proc(), and config_svr_group_blob_proc().

int kcom_get_config_blob ( void   ) 

Get all configuration blobs.

Returns:
0 on success, -1 on failure

Definition at line 320 of file equilibrium2-mgmt_kcom.c.

References CONFIG_BLOB_SVC_SET, CONFIG_BLOB_SVR_GROUP, config_svc_set_blob_proc(), config_svr_group_blob_proc(), EQ2_LOG, eq2_provider_id, EQ2_TRACE, config_blob_key_s::key_name, config_blob_key_s::key_plugin_id, and config_blob_key_s::key_tag.

Referenced by config_post_proc().

int kcom_init ( evContext  ctx  ) 

Init KCOM library and register handlers for asynchronous KCOM messages.

Parameters:
[in] ctx Event context
Returns:
KCOM_OK (0) on success, -1 on failure

Definition at line 401 of file equilibrium2-mgmt_kcom.c.

References EQ2_LOG, eq2_origin_id, EQ2_TRACE, gencfg_async_hdlr(), get_initial_ssrb(), ifd_async_hdlr(), and ssrb_async_hdlr().

Referenced by main_init().

static int ssrb_async_hdlr ( junos_kcom_pub_blob_msg_t *  kpb_msg,
void *arg  UNUSED 
) [static]

Notification handler for SSRB events.

Parameters:
[in] kpb_msg KCOM Public Blob Message, contains the SSRB
[in] arg Cookie passed in registration
Returns:
KCOM_OK (0) on success, -1 on failure

Definition at line 91 of file equilibrium2-mgmt_kcom.c.

References CONFIG_SSRB_ADD, CONFIG_SSRB_CHANGE, CONFIG_SSRB_DEL, config_ssrb_op(), EQ2_LOG, and EQ2_TRACE.

Referenced by kcom_init().


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:58 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-mgmt 1.0 by Doxygen 1.5.1