CPNR SDK Kit

The Cisco Network Registrar software development kit lets you develop client programs that can access a server and manipulate its configuration data. Several sample programs are included to introduce the basic concepts needed to successfully access or modify configuration data

Here is what you theoretically need for writing a client program using the SDK. The core runtime libraries are required for running the clients.

The API message specifications would be helpful, especially if you are writing a C or Tcl client. The java client SDK has java methods for all of the API messages, so you don't need to know the internals of the message encoding. We do not have a similar layer for C or Tcl, so you need to explicitly create your request messages and explicitly extract return values from response messages.

Java

javadoc for the com.cisco.cnr.sdk and com.cisco.cnr.sdk.client packages. Note that com.cisco.cnr.sdk.client.Session provides a base class for a client connection/session to an SCP server and the derived classes (such as DHCPSession) provide java methods for a corresponding SCP interface (dhcp-admin). There may be a few extra utility methods in the Session-derived classes, but eventually, they will move to a corresponding Util class. This will allow us to use the Session-derived classes, and their javadoc, as a intermediate message specification -- there will be a one to one correspondence between the methods provided for a Session-derived class and the messages supported by its corresponding SCP interface.

C

You can generate a standalone C development kit by using the scripts and makefiles in cnr-sdk/gen-dist. Header files for scp01 and aic libraries.

  • the scp01 shared library has a single header file scp.h
  • the aic shared library has many header files, all of which will be in destiny/local/include after a standard sandbox build. ** we should pull out the required ones (perhaps by starting with the includes in scp.h) as a separate SDK list. ** Eventually, scp.h should proved enough stubs that you don't need the internal library headers.

Memory Usage

By default, the Network Registrar SDK will allocate memory from the Java heap. In versions before 8.0, the SDK would dynamically allocate memory using both the C run time library (RTL) and Java heaps.

The Java heap memory management may impact the performance, maximum memory consumption, and memory consumption behavior of CNR SDK applications in ways which are difficult to predict in advance. Furthermore, behavior will vary among different Java VM implementations and even between different versions of one Java VM. SDK application developers should monitor the performance and memory consumption of their application when using the default (Java heap-based) memory management method in the CNR SDK.

To revert to previous behavior using the C RTL memory heap, specify the ScpLib.SCPLIB_NO_JAVA_HEAP flag when initalizing the ScpLib library:

ScpLib.init(ScpLib.SCPLIB_NO_JAVA_HEAP);

Note this method must be invoked before any other CNR SDK methods are invoked.

When using the C RTL memory management, Java garbage collection should be explicitly invoked periodically by the application, through invocation of System.gc() calls. This is required because small Java objects allocated by the CNR SDK can maintain handles to larger memory blocks allocated through the C RTL memory management interface. The Java VM is aware of the smaller blocks allocated from the Java heap, but is not aware of the larger blocks allocated through the C RTL. It does not consider the larger blocks when performing garbage collection, and a long-running application could grow to consume large amounts of memory before Java VM garbage collection would be triggered.

Coding practices that minimize the amount of memory required by the application should also be applied. For example:

  1. Set application variables to null when they are no longer needed.
  2. Use cursor methods in place of arrays to reduce the number of objects actively processed.