IPDR C Conversion Library
This is release 2.0.0 of the IPDR C Conversion Library which is compliant
with the NDM-U 3.5 specification from ipdr.org. This new release of the
IPDR C Conversion Library adds support for structures, arrays, nested elements,
and derived types. This release of the IPDR C Conversion Library does
NOT support either the Supplier/Partner Settlement document or the IPDR
Streaming Protocol.
The latest version is available from http://www.sourceforge.net/projects/ipdr
The goal of the IPDR C Conversion Library is to provide software
implementers of the IPDR standards with libraries and tools to reduce
construction cost, increase quality, and increase interoperability of their
IPDR facilities. This library simplifies the tasks of reading and writing
IPDR data. The library will be useful to both consumers and producers
of IPDR records who wish to encode or decode XML or XDR documents.
This software is governed by the licensing terms mentioned in
LICENSE.txt found at the top of the source code tree.
This package contains IPDR C Conversion Library written in ANSI C along with
supporting documentation, sample programs as well as test tools.
Release Structure
The structure of this release is as follows
docs
This folder contains following documents
1. Installation Steps on Windows,
2. Installation Steps on Unix,
3. Integration Test Cases,
4. Developer Guide,
5. C API documentation
include
Contains header files for reference and third party packages
source
Contains entire source code
test
Contains test tools and test scripts to test the libraries
example
Contains a sample read and write program that demonstrates producing and consuming an IPDR XDR and XML
doc using the reference libraries.
The libraries can be downloaded from www.sourceforge.net/projects/ipdr
Once downloaded refer to Installation Steps on Unix or Installation Steps on Windows for detailed instructions on
the build process.
Known Limitations
1. The ReadTool and WriteTool will fail, if the elements definition and their references
order in the schema (e.g.: SM3.0-A.3.xsd) file is not matching. The ReadTool and
WriteTool exits with “order mismatch” error, if it encounters this type of schema file.
Below is an example from a Schema file:
The Valid Schema with proper order
<?xml version = "1.0" encoding = "UTF-8"?>
<!--Generated by Turbo XML 2.3.0.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
targetNamespace = "http://www.ipdr.org/namespaces/ipdr"
xmlns:ipdr = "http://www.ipdr.org/namespaces/ipdr"
version = "3.0-A.0"
elementFormDefault = "qualified"
attributeFormDefault = "unqualified">
<annotation>
<documentation>
Identifies a unique subscriber in the system.
Ip address, account number etc
</documentation>
</annotation>
<include schemaLocation = "IPDRDoc3.0.xsd"/>
<element name = "averageBandwidth" type = "long">
<annotation>
<appinfo>
<ipdr:units>bps</ipdr:units>
</appinfo>
<documentation>
Average bandwidth used for stream.
</documentation>
</annotation>
</element>
<element name = "totalVolume" type = "long">
<annotation>
<appinfo>
<ipdr:units>bytes</ipdr:units>
</appinfo>
<documentation>
Total volume used for stream.
</documentation>
</annotation>
</element>
<complexType name = "IPDR-SM-Type">
<complexContent>
<extension base = "ipdr:IPDRType">
<sequence>
<element ref = "ipdr:averageBandwidth" minOccurs = "0"/>
<element ref = "ipdr:totalVolume" minOccurs = "0"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
This schema works as written, however it would be unusable by the C libraries if the order of the elements in the ComplexType were different from the order of the elements preceding it.
So if we replaced the <complexType> above with this, the schema would cause the libraries to fail:
<complexType name = "IPDR-SM-Type">
<complexContent>
<extension base = "ipdr:IPDRType">
<sequence>
<element ref = "ipdr:totalVolume" minOccurs = "0"/>
<element ref = "ipdr:averageBandwidth" minOccurs = "0"/>
</sequence>
</extension>
</complexContent>
</complexType>
the problem is that averageBandwidth was defined before totalVolume earlier in the schema, therefore libraries always expect this order to be retained in the ComplexType declaration
2. For structure data types, direct reference to <complexType> kind of data elements cannot
be made inside a <complexContent>.Instead, an explicit declaration of an element which
refers to this complex type needs to be made and used inside the <complexContent>.
For e.g.: in the xml extract below: the qosVolumeEvent data element cannot be directly
used in the <complexContent>. Hence an explicit declaration (in BOLD) needs to be made
and used.
- <complexType name="qosVolumeEvent">
- <sequence>
<element ref="startTime" />
<element ref="endTime" />
<element ref="qosLevel" />
</sequence>
</complexType>
<element name="qosVolume" type="qosVolumeEvent" />
<complexType name="IPDR-Structure-Type">
<complexContent>
<extension base="ipdr:IPDRType">
<sequence>
<element ref="startTime" />
<element ref="endTime" />
<element ref="movieTitle" />
<element ref="qosVolume" />
</sequence>
</extension>
</complexContent>
</complexType>
3. The C libraries may occasionally make slight changes to the value of floating point
numbers due to precision issues. E.g. 2.7778 might become 2.7777975
Below is an example:
The actual value in the CSV file:
SM:charge
4796.78
The value in the generated CSV, after running the ReadTool.
SM:charge
4796.779785
4. The C libraries do not support the "derived type" encoding feature in XDR, ie the C libraries do not make use of
the 3rd byte in XDR typeIDs to specifiy the derived type, thereby conveying that information in the document and
removing the need to parse the XML schema to get that information. Please refer to section 4.3.1.2 in the
XDR3.5.1.doc for more information on this feature.
5. The C libraries do not support the macAddress derived type, which was added in
SSG3.5.1.doc.
6. The C libraries do not support the IPDR Supplier/Partner Settlement (S/PS) specification.
7. The C libraries do not support the IPDR Streaming specification.
New Features that were added to the libraries in this release:
Support for Arrays and Structures
Support for both version 3.1 and 3.5 of the NDM-U (by passing 3.1 or 3.5 on the commandline, or reading the value
from the IPDRDoc.xsd schema)
Support for the new XDR primitive types
Installation and building C-libraires on unix/linux:
gunzip c_ipdrbase_2.0.0.tar.gz
tar xvf c_ipdrbase_2.0.0.tar
or use unzip c_ipdrbase_2.0.0.zip
cd c_ipdrbase_2.0.0
autoconf
automake
./configure
cd source
make
cp */*.a ../libs
cd ../test
make
For more details please refer the Installation Steps on Unix
Installation and building C-libraires on Windows:
Use winzip to extract the c_ipdrbase_2.0.0.zip
Open the ipdr .dsw (workspace) file at c_ipdrbase_2.0.0/ipdr/ipdr.dsw and build.
Open the test .dsw file at c_ipdrbase_2.0.0/test/test.dsw and build both the readtest and writetest projects
Create a bin directory in IPDR. Copy the IPDRReadTest.exe(from c_ipdrbase_2.0.0/ test/IPDRReadToolDir/Debug) and
IPDRWriteTest.exe (from c_ipdrbase_2.0.0/ test/IPDRWriteToolDir/Debug) files to this directory.
Also copy the ipdr.dll (from c_ipdrbase_2.0.0/ libs) file to this directory, finally copy the libcurl.dll and
expat.dll to this directory.
For more details please refer the Installation Steps on Windows
Systems in which the libraries have been built and tested:
RedHat9.0 Linux compilers: gcc(version 3.2.2)
Fedora Core compilers: gcc(version 3.3.2)
HP-UX 11 compilers: gcc(version 3.3.2)
Solaris compilers: gcc(version 3.3.2)
Windows XP compilers:Visual C++ 6.0