Using the GENCFG/SSRB Library

Files In This Example

When you create your application sandbox, the source code for this example is available in the following locations:

For information about creating your application sandbox, see "Creating Reference and Development Sandboxes" in the Installation Guide.

Using the GENCFG Subsystem

The kernel communication functions are in your backing sandbox at sandbox/src/junos/lib/libjunos-sdk/h/jnx/junos_kcom.h.

Before using GENCFG, your application must always invoke the junos_app_init() function, as described in the Hello World topic (Application Flow). Subsequently, the function junos_kcom_gencfg() must be called with the initialization opcode JUNOS_KCOM_GENCFG_OPCODE_INIT. All interaction with the GENCFG subsystem is accomplished using this function:

int  junos_kcom_gencfg ( junos_kcom_gencfg_t* user_p );

The junos_kcom_gencfg() function uses an opcode, which you will store in the junos_kcom_gencfg_t structure, to determine the action you wish to take. Valid opcodes are:

JUNOS_KCOM_GENCFG_OPCODE_INIT          Initialize GENCFG.  
JUNOS_KCOM_GENCFG_OPCODE_BLOB_ADD      Add user data to the kernel space.  
JUNOS_KCOM_GENCFG_OPCODE_BLOB_DEL      Delete data from the kernel space.  
JUNOS_KCOM_GENCFG_OPCODE_BLOB_GET      Get data from the kernel space.  
JUNOS_KCOM_GENCFG_OPCODE_BLOB_GETNEXT  Get the next data item in the tree.  
JUNOS_KCOM_GENCFG_OPCODE_FILTER_ADD    Add a filter request.  
JUNOS_KCOM_GENCFG_OPCODE_FILTER_DEL    Delete an added filter.  
JUNOS_KCOM_GENCFG_OPCODE_GET_FREE      Free allocated resources.  

Using the GENCFG subsystem amounts to declaring a variable of type junos_kcom_gencfg_t, setting the opcode and other applicable fields (applicable fields depend on the opcode), and then passing a pointer to the structure to the junos_kcom_gencfg() function.

Initializing GENCFG


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:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5