The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes the platforms on which you can use the Cisco Service Control Subscriber Manager C/C++ API. It also explains how to install, compile, and start running the Cisco Service Control Subscriber Manager C/C++ API.
This chapter consists of the following sections:
•Installation Package Contents
•Installing the Cisco Service Control Subscriber Manager C/C++ API
•Compiling and Running the Cisco Service Control Subscriber Manager C/C++ API
The Service Control Management Suite (SCMS) SM C/C++ API was developed and tested on Windows, Solaris, and Linux platforms. It was compiled on Windows by using the Microsoft Visual C++ 6 compiler, on Linux by using the GCC 3.2.3 compiler. On Solaris, the API is complied by using only the GCC 2.95 compiler.
For brevity, the installation directory, sm-c-api-vvv.bb, is referred to as <installdir>, where vvv and bb stand for the Cisco Service Control Subscriber Manager C/C++ API version and build number. Table 1-1 presents the layout of the installation directory.
The <installdir>/winnt folder contains the smapi.dll file, which is the Windows API executable. It also contains additional dynamic link library (DLL) and LIB files required to operate the Windows API.
The <installdir>/solaris folder contains the libsmapi.so file, which is the Solaris API executable.
The <installdir>/linux folder contains the libsmapi.so file, which is the Linux API executable.
The <installdir>/linux-64 folder contains the libsmapi.so file, which is the Linux API Executable for a 64-bit machine.
The <installdir>/include folder contains the API C/C++ header files.
The <installdir>/include/system folder contains the C++ API internal header files.
The Cisco Service Control Subscriber Manager C/C++ API distribution is part of the Cisco Service Control Subscriber Manager Login Event Generator (LEG) distribution file and is located in the sm_api directory. The Cisco Service Control Subscriber Manager C/C++ API is packaged in a UNIX tar file. You can extract the Cisco Service Control Subscriber Manager C/C++ API by using the UNIX tar utility or most Windows compression utilities.
•Installing the Cisco Service Control Subscriber Manager LEG on a UNIX Platform
•Installing the Cisco Service Control Subscriber Manager LEG on a Windows Platform
Step 1 Extract the Cisco Service Control Subscriber Manager LEG distribution file.
Step 2 Locate the C/C++ SM API distribution file, sm-c-api-dist.tar.
Step 3 Extract the C/C++ API package tar file:
#> tar -xvf sm-c-api-dist.tar
Extract the Cisco Service Control Subscriber Manager LEG package by using a zip extractor (such as WinZip).
The API connects to the Proprietary Remote Procedure Call (PRPC) server on the Cisco Service Control Subscriber Manager. For the API to work, the following conditions must be met:
•The Cisco Service Control Subscriber Manager must be operating, and reachable from the machine that hosts the API.
•The PRPC server on the Cisco Service Control Subscriber Manager must be started.
The PRPC server is a proprietary Remote Procedure Call (RPC) protocol designed by Cisco. For additional information, see the Cisco Service Control Management Suite Subscriber Manager User Guide.
•Compiling and Running a Program on Windows
•Compiling and Running a Program on Solaris
•Compiling and Running a Program on Linux
Note You should compile the C/C++ API with either a 32-bit compiler or 64-bit compiler.
Step 1 Ensure that smapi.dll and the other DLL files are in your path or in the directory of your executable.
Step 2 Ensure that the include folder is in your include path of the compilation.
Step 1 Enter the project settings, click the C++ tab, and then choose the Preprocessor category.
Step 2 Add the include directory path in the Additional Include directories line.
Step 3 Ensure that the smapi.lib file is in your linkage path.
Step 4 Enter the project settings and click the Link tab. Add the smapi.lib file to the Object\Library modules line.
Step 5 Include the relevant API header file in your source code, and compile your code.
Step 1 Ensure that the libsmapi.so folder is in your LD_LIBRARY_PATH.
For example, when using the Bash shell type, use the following command line:
bash-2.03$ export set LD_LIBRARY_PATH=$LD LIBRARY_PATH:the-libsmapi.so-folder
Step 2 Ensure that the include folder is in your include path of the compilation.
For example, when using GCC, add the include folder after the -I option, as follows:
>gcc -c -o TestSmApi.o -Ism-api-header-file-folder -Ism-api-header-file-folder/system/ TestSmApi.cpp
Step 3 Ensure that the libsmapi.so file is in your linkage line or load it dynamically.
Link your object file to the pthread and socket library, as follows:
>gcc -o testSmApi TestSmApi.o -lsmapi -lpthread -lsocket
Step 1 Ensure that the libsmapi.so folder is in your LD_LIBRARY_PATH.
For example, when using the Bash shell type, use the following command line:
bash-2.03$ export set LD_LIBRARY_PATH=$LD LIBRARY_PATH:the-libsmapi.so-folder
Step 2 Enter your password if prompted.
Step 3 Ensure that the include folder is in your include path of the compilation.
For example, when using GCC, add the include folder after the -I option, as follows:
>gcc -c -o TestSmApi.o -Ism-api-header-file-folder -Ism-api-header-file-folder/system/ TestSmApi.cpp
Step 4 Ensure that the libsmapi.so file is in your linkage line or load it dynamically.
Specify the location of libsmapi.so using the -L option. Link your object file to the pthread and stdc++ libraries, as follows:
>gcc -o testSmApi TestSmApi.o -lsmapi -lpthread -lstdc++ -L<lib path>