kcom_gencfg.c File Reference

KCOM GENCFG-related functions. More...


Defines

#define KCOM_GENCFG_FNAME   "/tmp/gencfgfilter_%d.txt"
#define KCOM_GENCFG_FNAME_LEN   32
#define KCOM_GENCFG_FILTER_LEN   2048
#define GENCFG_TYPE_OK(t)   ((t) >= GENCFG_TYPE_MIN && (t) < GENCFG_TYPE_MAX)

Functions

void kcom_gencfg_register_mpsdk_cfg_handler (kcom_mpsdk_cfg_handler_ptr handler)
int junos_kcom_gencfg (junos_kcom_gencfg_t *user_p)
 Main entry routine for all SDK gencfg-related user calls.
int junos_kcom_gencfg_build_blob_id (junos_kcom_gencfg_t *user_p, provider_origin_id_t origin_id, u_int16_t blob_id)
 Build a blob ID in a KCOM GENCFG request structure from an origin ID and blob ID.
int junos_kcom_gencfg_extract_blob_id (junos_kcom_gencfg_t *user_p, provider_origin_id_t *origin_id_p, u_int16_t *blob_id_p)
 Extract origin ID and blob ID from a KCOM GENCFG request structure.

Variables

bool kcom_gencfg_init_called = FALSE


Detailed Description

KCOM GENCFG-related functions.

This file contains code related to KCOM GENCFG. It contains the entry point used, as well as almost all routines to transform the user request into specific calls, and transform the responses to the user.


Function Documentation

int junos_kcom_gencfg junos_kcom_gencfg_t user_p  ) 
 

Main entry routine for all SDK gencfg-related user calls.

This routine dispatches to other specific handlers based on the request.

The routine performs some basic checks and actual actions in all cases. It does translations in most. Error codes are returned in all.

Note: For JUNOS_KCOM_GENCFG_OPCODE_BLOB_GET and JUNOS_KCOM_GENCFG_OPCODE_BLOB_GETNEXT, peer_info of user_p may be dynamically allocated inside the library to hold peer info. Caller needs to call this API with opcode JUNOS_KCOM_GENCFG_OPCODE_GET_FREE to free this dynamic memory.

Parameters:
[in] user_p Pointer to user request structure.
Returns:
The following return codes are possible:
  • 0 Everything OK.
  • E2BIG Holder buffer size exceeded.
  • EACCES Permission denied.
  • EEXIST Blob already in chain.
  • EFAULT Bad or mismatched address.
  • EINVAL Invalid parameter.
  • EMSGSIZE Attempt to add more than 65472 bytes with opcode JUNOS_KCOM_GENCFG_OPCODE_BLOB_ADD.
  • ENOMEM No memory left.
  • EPERM Call made in incorrect state.

int junos_kcom_gencfg_build_blob_id junos_kcom_gencfg_t user_p,
provider_origin_id_t  origin_id,
u_int16_t  blob_id
 

Build a blob ID in a KCOM GENCFG request structure from an origin ID and blob ID.

Parameters:
[in] user_p Pointer to user request structure.
[in] origin_id Origin ID
[in] blob_id GENCFG blob ID
Returns:
The following return codes are possible:
  • 0 Everything OK.
  • EINVAL Invalid parameter.

int junos_kcom_gencfg_extract_blob_id junos_kcom_gencfg_t user_p,
provider_origin_id_t *  origin_id_p,
u_int16_t *  blob_id_p
 

Extract origin ID and blob ID from a KCOM GENCFG request structure.

Parameters:
[in] user_p Pointer to user request structure.
[out] origin_id_p Pointer to location to store origin ID.
[out] blob_id_p Pointer to location to store blob ID.
Returns:
The following return codes are possible:
  • 0 Everything OK.
  • EINVAL Invalid parameter.


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:24:36 2010 for libjunos-sdk by Doxygen 1.4.5