diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml deleted file mode 100644 index 57c1021d..00000000 --- a/.github/workflows/c-cpp.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: C/C++ CI - -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get -y install git wget build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev gawk libcurl4-openssl-dev libxml2-dev libyaml-dev make python3 python3-dev python3-pip python3-setuptools libxml2-dev libxml2 libpcap0.8-dev libpcap0.8 libidn2-0-dev - ( cd /tmp; wget -qO - http://libnf.net/packages/libnf-1.25.tar.gz | tar -xzf - && cd libnf-1.25 && ./configure -q && sudo make -j3 install; ) - - name: init repository - run: ( git submodule init; git submodule update --recursive; cd modules; git submodule init; git submodule update --recursive; ) - - name: autoreconf - run: autoreconf -i - - name: configure - run: ./configure --enable-repobuild --prefix=/usr --bindir=/usr/bin/nemea/ - - name: make - run: make -j10; sudo make install; sudo ldconfig - - name: Install python components - run: ( cd nemea-framework/pytrap; sudo python3 setup.py install; cd ../pycommon; sudo python3 setup.py install; ) - - name: make check - run: make check || find -name '*.sh.log' -exec cat {} + - diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c1a8669b..00000000 --- a/.gitmodules +++ /dev/null @@ -1,13 +0,0 @@ -[submodule "nemea-framework"] - path = nemea-framework - url = https://github.com/CESNET/Nemea-Framework - -[submodule "nemea-supervisor"] - path = nemea-supervisor - url = https://github.com/CESNET/Nemea-Supervisor -[submodule "modules"] - path = modules - url = https://github.com/CESNET/Nemea-Modules -[submodule "detectors"] - path = detectors - url = https://github.com/CESNET/Nemea-Detectors diff --git a/CNAME b/CNAME new file mode 100644 index 00000000..1528a4ca --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +nemea.liberouter.org \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index f7aae787..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,29 +0,0 @@ -## How to contribute - -#### **Did you find a bug?** - -* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/CESNET/NEMEA/issues). - -* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/CESNET/NEMEA/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. - -#### **Did you write a patch that fixes a bug?** - -* For patches in the C language, check if the patch meets the [coding style](https://github.com/CESNET/Nemea-Framework/blob/master/libtrap/CodingStyle.md). - -* Open a new GitHub pull request with the patch. - -* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. - -#### **Do you intend to add a new feature or change an existing one?** - -* Suggest your change in the [NEMEA mailing list](https://random.cesnet.cz/mailman/listinfo/nemea) and start writing code. - -* Do not open an issue on GitHub until you have collected positive feedback about the change. - -#### **Do you have questions about the source code?** - -* Ask any question about how to use NEMEA or its parts in the [NEMEA mailing list](https://random.cesnet.cz/mailman/listinfo/nemea). - -Thanks for any patch or feedback! - -NEMEA Team diff --git a/COPYING b/COPYING deleted file mode 100644 index 36bbc711..00000000 --- a/COPYING +++ /dev/null @@ -1,31 +0,0 @@ -COPYRIGHT AND PERMISSION NOTICE - -Copyright (C) 2012-2016 CESNET, z.s.p.o. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. - 3. Neither the name of the Company nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -ALTERNATIVELY, provided that this notice is retained in full, this product -may be distributed under the terms of the GNU General Public License (GPL) -version 2 or later, in which case the provisions of the GPL apply INSTEAD OF -those given above. - -This software is provided "as is", and any express or implied warranties, -including, but not limited to, the implied warranties of merchantability -and fitness for a particular purpose are disclaimed. In no event shall the -company or contributors be liable for any direct, indirect, incidental, -special, exemplary, or consequential damages (including, but not limited to, -procurement of substitute goods or services; loss of use, data, or profits; -or business interruption) however caused and on any theory of liability, -whether in contract, strict liability, or tort (including negligence or -otherwise) arising in any way out of the use of this software, even if -advised of the possibility of such damage. diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index ad4c3c9e..00000000 --- a/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -SUBDIRS=nemea-framework - -if ENABLE_SUPERVISOR -SUBDIRS+=nemea-supervisor -endif - -if ENABLE_MODULES -SUBDIRS+=modules -endif - -if ENABLE_DETECTORS -SUBDIRS+=detectors -endif - -# because of supervisor, disable systemd checking and installation during -# distcheck -DISTCHECK_CONFIGURE_FLAGS="--without-systemd" - diff --git a/README-on_biflow.md b/README-on_biflow.md deleted file mode 100644 index 5c766c5c..00000000 --- a/README-on_biflow.md +++ /dev/null @@ -1,32 +0,0 @@ -This documents briefly explains "biflow" representation and how it is used in -[ipfixprobe](https://github.com/CESNET/ipfixprobe) and how it should be used in -NEMEA. Biflow is an abbreviation of bidirectional flow (record) which -represents both directions of one connection between two devices in form of one -"message"/flow record. - -Interpretation of UniRec record (how to work with UniRec template and UniRec -message): - -1. If the UniRec template contains both fields: `BYTES_REV` and `PACKETS_REV`, - it is considered as biflow template. Otherwise, it is not (i.e., it is - probably unidirectional flow record). Note: ipfixprobe ALWAYS export both - fields for biflow. -2. If the UniRec template is not biflow (due to missing fields in 1.), the - UniRec messages should be paired/aggregated "manually" to get biflow. -3. If a biflow message contains `PACKETS_REV == 0`, it is still a biflow - record, however, it contains only one direction of the communication. This - means one of the cases: - 1. the communication was really unidirectional (e.g., broadcast messages, UDP streams), - 2. the communication was bidirectional, but the flow exporter observed only - one direction of it, - 3. the communication was bidirectional, but the flow exporter was not able - to pair/aggregated both directions. - -3.2 can happen in case of assymetric routing, where packets of different -directions might be routed via different links. -3.3 can happen in case of splitting flow records due to timeouts or limited -flow cache. - -In any case, it is highly recommended to do pairing/aggregation of UniRec -message before processing. - diff --git a/README.ifcspec.md b/README.ifcspec.md new file mode 100644 index 00000000..56ee0c44 --- /dev/null +++ b/README.ifcspec.md @@ -0,0 +1,219 @@ +--- +layout: page +title: TRAP Interface Specifier +menuentry: TRAP IFC +public: false +docmenu: true +permalink: /trap-ifcspec/ +--- + +Format of TRAP interface specifier (IFC_SPEC): +============================================== + +TRAP interface specifier is an argument of `-i` option used by every NEMEA module. It specifies a configuration of module's TRAP interfaces (IFC), i.e. what kind of IFC to use and where to connect. + +Configurations of individual IFCs are separated by comma `,`, e.g. `,,...,`. Input IFCs must be specified first, output IFCs follow. The number of input and output IFCs depends on the specific module (you should be able to find it in the module's help or README). + +Parameters of each IFC are separated by colon `:`, e.g. `:::...:`. The first parameter is always one character specifying the type of the IFC to use, other parameters differ for individual types (see below). + +Example of startup of a module with 1 input and 1 output IFC: +``` +traffic_repeater -i t:example.org:1234,u:my_socket +``` +The example makes the repeater to use a TCP socket as its input IFC and connect it to 'example.org', port 1234; and to create an UNIX domain socket identified as 'my_socket' as its output IFC. + +Supported interface types: +========================== + +TCP interface ('t') +------------------- + +Communicates through a TCP socket. Output interface listens on a given port, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data. + +Parameters when used as INPUT interface: + +``` +t:: +``` + +or + +``` +t: +``` + +If you skip `:`, IFC assumes you want to use localhost as the hostname. + +Parameters when used as OUTPUT interface: + +``` +: +``` + +Maximal number of connected clients (input interfaces) is optional (64 by default). + +## TLS interface ('T') + +Communicates through a TCP socket after establishing encrypted connection. You have to provide certificate, key and CA chain file with trusted CAs. Otherwise same as in TCP: Output interface listens on a given port, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data. + +Parameters when used as INPUT interface: + +``` +T::::: +``` + +or + +``` +T:::: +``` + +If you skip `:`, IFC assumes you want to use localhost as a hostname. + +Parameters when used as OUTPUT interface: + +``` +:::: +``` + +Maximal number of connected clients (input interfaces) is optional (64 by default). + +Parameters keyfile, certfile, CAfile expect a path to apropriate files in PEM format. + +UNIX domain socket ('u') +------------------------ + +Communicates through a UNIX socket. Output interface creates a socket and listens, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data. + +Parameters when used as INPUT interface: + +``` + +``` + +Socket name can be any string usable as a file name. + +Parameters when used as OUTPUT interface: + +``` +: +``` + +Socket name can be any string usable as a file name. +Maximal number of connected clients (input interfaces) is optional (64 by default). + + +Blackhole interface ('b') +------------------------- + +Can be used as OUTPUT interface only. Does nothing, everything sent to this interface is dropped. It has no parameters. + + +File interface ('f') +-------------------- + +Input interface reads data from given files, output interface stores data to multiple files. Recommended file name extension for files with captured TRAP traffic is `.trapcap`. Tilde (`~`) can be used to specify home directory when specifying path, e.g. `~/nemea/data.trapcap`. + +Input interface: + +Files to be read by input interface can be specified with globbing. +E.g. lets say, we have multiple data files captured on 18th of April 2016, with names like data.201604180900, data.201604181000. +Following syntax can be used: + +``` + // e.g. data.201604180900 - reads data only from file "data.201604180900" + // e.g. data.20160418* - reads data from all files in directory that were captured on 18th of April. +``` + +Name of file (path to the file) must be specified. +Input file interface can also read from /dev/stdin. + +Output interface: + +``` +::: +``` + +Name of file (path to the file) must be specified. + +Mode is optional. There are two types of mode: `a` - append (default), `w` - write. +If the specified file exists, mode write overwrites it, mode append creates a new file with an integer suffix, e.g. `data.trapcap.0` (or `data.trapcap.1` if the former exists, and so on, it simply finds the first unused number). + +If parameter `time=` is set, the output interface will split captured data to individual files as often, as value of this parameter indicates. +Output interface assumes the value of parameter `time=` is in minutes. +If parameter `time=` is set, the output interface creates unique file name for each file according to current timestamp in format: filename.YYYYmmddHHMM +Parameter `time=` is optional and is not set by default. + +If parameter `size=` is set, the output interface will split captured data to individual files after size of current file exceeds given threshold. +Output interface assumes the value of parameter `size=` is in MB. +If parameter `size=` is set, numeric suffix as added to original file name for each file in ascending order starting with 0. +Parameter `size=` is optional and is not set by default. + +If both `time=` and `size=` are specified, the data are split primarily by time, and only if a file of one time interval exceeds the size limit, it is further splitted. The index of size-splitted file is appended after the time, e.g. `data.trapcap.201604181000.0`. + +Example: + +``` +-i "f:~/nemea/data.trapcap:w" // stores all captured data to one file (overwrites current file if it exists) +-i "f:~/nemea/data.trapcap:w:time=30" // creates individual files each 30 minutes, e.g. "data.trapcap.201604180930", "data.trapcap.201604181000" etc. +-i "f:~/nemea/data.trapcap:w:size=100" // creates file "data.trapcap" and when its size reaches 100 MB, a new file named "data.trapcap.0", then "data.trapcap.1" etc. +-i "f:~/nemea/data.trapcap:w:time=30:size=100" // creates set of files "data.trapcap.201604180930", "data.trapcap.201604180930.0" etc. and after 30 minutes, "data.trapcap.201604181000" +``` + +Output file interface and negotiation: +Whenever new format of data is created, output interface creates new file with numeric suffix. +Example: `-i "f:~/nemea/data.trapcap:w"` following sequence of files will be created if data format changes: data.trapcap, data.trapcap.0, data.trapcap.1 etc. + +When mode `a` is specified, the interface finds first non-existing file in which it writes data. + +Example: +Assume we have already files "data.trapcap" and "data.trapcap.0", the following command: + +``` +-i "f:~/nemea/data.trapcap:a" +``` + +checks for existing files and first captured data will be stored to file "data.trapcap.1". + +Output file interface can also write data to /dev/stdout and /dev/null, however mode `w` must be specified. + +## Common IFC parameters + +The following parameters can be used with any type of IFC. There are parameters of libtrap IFC that are normally let default or set in source codes of a module. It is possible to override them by user via IFC_SPEC. The available parameters are: + +* timeout - time in microseconds that an IFC can block waiting for message send / receive + * possible values: number of microseconds or one of the special values: + * "WAIT" - block indefinitely + * "NO_WAIT" - don't block + * "HALF_WAIT" (output IFC only) - block only if some client (input IFC) is connected + * default: WAIT +* buffer (OUTPUT only) - buffering of data and sending in larger bulks (increases throughput) + * possible values: on, off + * default: on +* autoflush - normally data are not sent until the buffer is full. When autoflush is enabled, even non-full buffers are sent every X microseconds. + * possible values: off, number of microseconds + * default: 500000 (0.5s) + +Example: + +``` +-i u:inputsocket:timeout=WAIT,u:outputsocket:timeout=500000:buffer=off:autoflush=off +``` + + +## More examples: + +my_module with 1 input interface and 2 output interfaces: + +``` +./my_module -i "t:localhost:12345,b:,t:23456:5" +``` + +The input interface will connect to localhost:12345 (TCP). The first output interface is unused (all data send there will be dropped), the second output interface will provide data on TCP port 23456, to which another module can connect its input interface. + +nfdump_reader module that reads nfdump file and drops records via Blackhole IFC type: + +``` +./modules/nfreader/nfdump_reader -i b: ./file.nfdump +``` + diff --git a/_backup.html b/_backup.html new file mode 100644 index 00000000..536370f8 --- /dev/null +++ b/_backup.html @@ -0,0 +1,722 @@ + + + + + + + + + + + Nemea + + + + + +
+
+ View on GitHub + +

Nemea

+

System for network traffic analysis and anomaly detection.

+ +
+ Download this project as a .zip file + Download this project as a tar.gz file +
+
+
+ + +
+
+

+README outline

+ + + +

+Project status

+ +

Travis CI build: Build Status

+ +

+NEMEA System

+ +

NEMEA (Network Measurements Analysis) system is a stream-wise, flow-based and modular detection system for network traffic analysis. It consists of many independent modules which are interconnected via communication interfaces and each of the modules has its own task. Communication between modules is done by message passing where the messages contain flow records, alerts, some statistics or preprocessed data.

+ +

+Parts of the system

+ +

The following picture shows all important parts of the system.

+ +

NEMEA parts

+ +
    +
  1. Modules - basic building blocks; separate system processes; receive stream of data on their input interfaces, process it and send another stream of data to their output interfaces; all modules are simply divided into two groups according to their task: + +
      +
    • +Detectors (red) - detect some malicious traffic, e.g. DNS tunnel, DoS, scanning +
    • +
    • +Modules (yellow) - export&storage of flow data, preprocess or postprocess the data (filter, aggregate, merge etc.)
    • +
    +
  2. +
  3. NEMEA Framework - set of libraries implementing features common for all modules + +
      +
    • +TRAP (Traffic Analysis Platform) (blue) - implements communication interfaces and functions for sending/receiving the messages between interfaces
    • +
    • +UniRec (Unified Record) (orange) - implements efficient data format of the sent/received messages
    • +
    • +Common library (purple) - implements common algorithms and data structures used in modules
    • +
    +
  4. +
  5. +Supervisor (green) - central management and monitoring tool of the NEMEA system. It takes care of running modules according to a specified configuration.
  6. +
+ +

+Repositories

+ +

The project is divided into four repositories added as submodules:

+ + + +

+Dependencies

+ +

+Building environment

+ +
    +
  • autoconf
  • +
  • automake
  • +
  • gcc
  • +
  • gcc-c++
  • +
  • libtool
  • +
  • libxml2-devel
  • +
  • libxml2-utils (contains xmllint on Debian)
  • +
  • make
  • +
  • pkg-config
  • +
+ +

+Optional dependencies of modules and detectors

+ + + +

+How to install dependencies:

+ +
yum install -y autoconf automake gcc gcc-c++ libtool libxml2-devel make pkg-config libpcap libidn bison flex
+
+ +

Note: Latest systems (e.g. Fedora) use dnf instead of yum.

+ +

+Installation

+ +

There are three different ways of installation of the NEMEA system covered +in this document: vagrant, binary packages and source codes.

+ +

+Vagrant

+ +

To try the system "out-of-box", you can use Vagrant. +For more information see ./vagrant/.

+ +

+Binary packages

+ +

The NEMEA system can be installed from binary RPM packages. +To add CESNET repository containing the packages, run (as root/sudo):

+ +
rpm -ivh https://homeproj.cesnet.cz/rpm/liberouter/devel/x86_64/liberouter-devel-1.0.0-1.noarch.rpm
+
+ +

After that, NEMEA can be installed as any other package (run as root/sudo):

+ +
yum install nemea
+
+ +

Note: Latest systems (e.g. Fedora) use dnf instead of yum.

+ +

For development purposes, there is nemea-framework-devel package that installs +all needed development files and docs.

+ +

Currently, we do not have .deb packages (for Debian/Ubuntu/...) but we are working on it. Please follow installation from source codes

+ +

+Source codes

+ +

The whole system is based on GNU/Autotools build system that makes dependency checking and +building process much more easier.

+ +

To clone the NEMEA repositories, use:

+ +
git clone --recursive https://github.com/CESNET/nemea
+
+ +

After successful clone and dependencies installation (!), use:

+ +
./bootstrap.sh
+
+ +

that will create configure scripts and other needed files.

+ +

The configure script supplies various possibilities of +configuration and it uses some environmental variables that influence the build +and compilation process. For more information see:

+ +
./configure --help
+
+ +

We recommend to set paths according to the used operating system, e.g.:

+ +
./configure --prefix=/usr --bindir=/usr/bin/nemea --sysconfdir=/etc/nemea --libdir=/usr/lib64
+
+ +

After finishing ./configure, build process can be started by:

+ +
make
+
+ +

The make(1) tool has various parameters, to build the NEMEA package faster on +multicore systems, we recommend to use parameter -j with the number of jobs +that should be run in parallel.

+ +

When the compilation process ends without any error, the package can be installed +into paths that were set by configure. It is recommended NOT to change +target paths by passing variables directly to make(1). +The installation can be done by (usually it requires root / sudo):

+ +
make install
+
+ +

Congratulations, the whole NEMEA system should be installed right now... :-)

+ +

+Quick start and how to

+ +

+Try out NEMEA modules

+ +

+Execute a module

+ +

NEMEA modules using have two implicit arguments. module -h for help +(optional) and module -i IFC_SPEC for communication interface (IFC) +specification. The -i parameter is mandatory for all NEMEA modules.

+ +

Module help -h

+ +

The example below shows part of help output of logger. +It contains module's name, description, number of input and output IFC, modules +parameters and TRAP library parameters (common for all modules).

+ +
TRAP module, libtrap version: 0.7.6 b258bb4
+===========================================
+Name: Logger
+Inputs: variable
+Outputs: 0
+Description:
+  This module logs all incoming UniRec records to standard output or into a specified file. Each record
+  is written as one line containing values of its fields in human-readable format separated by chosen
+  delimiters (CSV format). If you use more than one input interface you have to specify output format by
+  parameter "-o".
+
+Usage:  logger [COMMON]... [OPTIONS]...
+
+Parameters of module [OPTIONS]:
+-------------------------------
+  -w  --write <string>             Write output to FILE instead of stdout (rewrite the file).
+
+  -a  --append <string>            Write output to FILE instead of stdout (append to the end).
+
+  -t  --title                      Write names of fields on the first line.
+
+  -c  --cut <uint32>               Quit after N records are received, 0 can be useful in combination
+                                   with -t to print UniRec.
+
+Common TRAP parameters [COMMON]:
+--------------------------------
+  -h [trap,1]                      If no argument, print this message. If "trap" or 1 is given, print
+                                   TRAP help.
+
+  -i IFC_SPEC                      Specification of interface types and their parameters, see "-h trap"
+                                   (mandatory parameter).
+
+  -v                               Be verbose.
+
+Environment variables that affects output:
+------------------------------------------
+  LIBTRAP_OUTPUT_FORMAT            If set to "json", information about module is printed in JSON format.
+
+  PAGER                            Show the help output in the set PAGER.
+
+ +

Interface specifier -i

+ +

The -i parameter with the interface specifier IFC_SPEC (module -i IFC_SPEC) +specifies modules interfaces - their types and parameters. The interface +specifier has the following format:

+ +

<IFC 1>,<IFC 2>,...,<IFC N>

+ +

where <IFC x> looks like

+ +

<type>:<par1>:<par2>:...:<parN>.

+ +

<type> can be one of the following: t - TCP socket (for remote +communication), u - UNIX socket (for local communication), b - blackhole to +drop all messages during sending, f - File IFC.

+ +

Interfaces are separated by , and their parameters are separated by :. +Input IFCs must be specified at first, output IFCs follow. Examples below show

+ +

Example:

+ +
module1 -i t:address:port1,t:port2
+
+ +

module1 uses TCP interfaces (for machine to machine communication). Let's +assume it has one input and one output interface (number of input and output +IFCs is given by programmer of the module). Therefore, input IFC will connect +to address:port1 and output IFC will listen on port2.

+ +

TCP type of IFC expects mandatory parameter port and optionally, additional +parameter address (as it is used in example). Default value of address is +localhost.

+ +

Example:

+ +
module2 -i u:sock1,u:sock2
+
+ +

UNIX type of IFC expects unique identifier of the socket. For compatibility +with TCP IFC, address can be specified but it has no effect!

+ +

Important findings:

+ +
    +
  • TCP interface for machine to machine communication, UNIX-SOCKET for communication on the same machine
  • +
  • input interface behaves as a client, output interfaces behaves as a server
  • +
+ +

Detailed information and another examples of IFC_SPEC can be found in libtrap/README.ifcspec.md.

+ +

+Interconnect two modules

+ +

Let´s try to interconnect +logreplay and +logger modules to +see them communicate. +Logreplay module has one output IFC. It reads CSV file created by logger +module and sends it in UniRec format. Logger has one input interface and it +logs all incoming UniRec records to standard output or into specified file in +CSV format. These two modules can be interconnected using one input IFC and +one output IFC.

+ +

use-cases/logger-repeater.sh +can be used for the demonstration. With no parameter, it prints help with +description. With generate parameter, the script creates a CSV file with header and 3 +flow records (see +use-cases/logger-repeater.sh#L53). +Thereafter it executes logreplay and logger modules

+ +
logreplay -i "u:my_socket"` -f CSV_file
+
+ +

and

+ +
logger -i "u:my_socket" -t
+
+ +

Logreplay has one UNIX output IFC listening on my_socket and logger has one UNIX input IFC which connects to my_socket.

+ +

To see the effect, go to use-cases/ and execute the script:

+ +
./logger-repeater.sh generate
+
+ +

It should print exactly the same output as generated CSV tmp input (header and +3 records). In +use-cases there are +more examples with basic modules. +logreplay is one of possible ways of getting data into the NEMEA system.

+ +

Other data sources are discussed later in Get flows to your system.

+ +

+Deploy NEMEA

+ +

This section shows how to deploy NEMEA in four steps.

+ +

It only covers the basics needed to run the system in its default +configuration. Keep in mind that NEMEA was designed as a very flexible +framework, so every user can (and should) adjust the configuration of NEMEA +modules to their own purposes.

+ +

+1. Installation

+ +

First of all, the whole system (NEMEA Framework, Modules, Detectors and +Supervisor) has to be installed. Follow installation instructions to +install the system from RPM or from source codes.

+ +

+2. Prepare configurations

+ +

To avoid manual control of the system, there is NEMEA Supervisor. +It is a central management and monitoring tool of the system and it takes care of running +modules according to a specified XML configuration.

+ +

We need to prepare XML configuration file for Supervisor. Fortunately, almost +everything is already done.

+ +

After installation (from RPM or from source codes with recommended configure +parameters), there are 2 important paths with configurations:

+ +
    +
  • +/ush/share/nemea-supervisor/ - contains default prepared XML configuraions of all NEMEA modules (like nemea-supervisor/configs/)
  • +
  • +/etc/nemea/ - contains XML configuration file for Supervisor and directories with used modules configurations (they are empty after installation)
  • +
+ +

Note: these two paths depend on datarootdir and sysconfdir parameters of the configure script during the installation.

+ +

The only thing we have to do is this (probably with sudo / root):

+ +
cp -r /usr/share/nemea-supervisor/*/ /etc/nemea
+
+ +

After this command, supervisor will use default configurations of the modules. +It is shown in nemea-supervisor/configs/supervisor_config_template.xml.in#L8 +that the paths from sysconfdir (/etc/nemea/ in our case) are included in the +configuration file. For detailed information about supervisor configuration +see README of Supervisor.

+ +

+3. Start and control modules

+ +

Once the configurations are prepared, modules can be managed by Supervisor. It can be easily started as a systemd service with

+ +

service nemea-supervisor start (recommended, probably with root / sudo)

+ +

or manually

+ +

/usr/bin/nemea/supervisor --daemon -T /etc/nemea/supervisor_config_template.xml -L /var/log/nemea-supervisor +Note: manual approach does not change UID that supervisor runs with. +Contrary, using service, NEMEA runs as nemead UID and nemead GID.

+ +

See all service commands in +README and all +program parameters with /usr/bin/nemea/supervisor -h. You can also check +whether the process is running or not with ps -ef | grep supervisor. +If Supervisor has not started successfully, it should print error info directly +to system log (in case of service), which can be browsed with journalctl -xe, +or to stdout (in case of manual start). Runtime errors and events can be +found in supervisor_log file located in the -L directory +(/var/log/nemea-supervisor by default).

+ +

Now we can connect to running supervisor with supervisor client simply with +command supcli. The menu with options is described in detail +in README. +After pressing number 4 and enter, it prints current status of the system. +By default, all detectors and loggers (except flow_meter logger) should be +enabled and running.

+ +

The modules are running, but they don't receive any data yet. We need to send +some flow data to the system...

+ +

+4. Get flows to your system

+ +

IPFIXcol

+ +

(recommended) Use IPFIXcol to collect NetFlow/IPFIX data from routers/probes +and an IPFIXcol unirec plugin +to re-send the data to NEMEA.

+ +
    +
  • needed to install IPFIXcol and the plugin and to set up the routers/probes
  • +
  • default and recommended solution for production
  • +
+ +

FlowMeter

+ +

Use NEMEA internal flow exporter (flow_meter module).

+ +
    +
  • it reads data directly from network interface (via libpcap), measures flows and export it to other NEMEA modules
  • +
  • simple, but not very performing solution (flow_meter was not designed for performance), suitable only for testing or very small networks + +
      +
    • +TODO: measure how much traffic can flow_meter handle and make recommendation what "very small network" means?
    • +
    +
  • +
+ +

NfReader

+ +

NfReader reads +nfdump files and sends flow records in UniRec format on its output TRAP +interface.

+ +

LogReplay

+ +

LogReplay +converts CSV format of data, from logger module to UniRec format and sends it +to the output interface.

+ +

+Create your own module in C

+ +

Important: Nemea-Framework has to be installed in advance. Follow +installation instructions

+ +

+Use Example module as a template

+ +

Let ~/mighty-module/ be the directory we want to develop our module in (replace path ~/mighty-module/ in all commands with another directory if needed) and mighty_module the name of our module. We will use example module as a template - copy the directory nemea-framework/examples/module/ to ~/mighty-module/.

+ +

In ~/mighty-module/configure.ac update the following lines

+ +
AC_INIT([example_module], [1.0.0], [traffic-analysis@cesnet.cz])
+AC_CONFIG_SRCDIR([example_module.c])
+
+ +

with

+ +
AC_INIT([migty_module], [1.0.0], [YOUR EMAIL ADDRESS])
+AC_CONFIG_SRCDIR([mighty_module.c])
+
+ +

In /data/mighty-module/Makefile.am update the following lines

+ +
bin_PROGRAMS=example_module
+example_module_SOURCES=example_module.c fields.c fields.h
+example_module_LDADD=-lunirec -ltrap
+
+ +

with

+ +
bin_PROGRAMS=mighty_module
+mighty_module_SOURCES=mighty_module.c fields.c fields.h
+mighty_module_LDADD=-lunirec -ltrap
+
+ +

Finally, execute

+ +
mv /data/mighty-module/example_module.c /data/mighty-module/mighty_module.c
+
+ +

to rename the source file.

+ +

+Build the module

+ +

Execute the following commands in ~/might-module/:

+ +

1) Let Autotools process the configuration files.

+ +
autoreconf -i
+
+ +

2) Configure the module directory.

+ +
./configure
+
+ +

3) Build the module.

+ +
make
+
+ +

4) (Optional) Install the module. The command should be performed as root (e.g. using sudo).

+ +
make install
+
+ +

+Code explanation

+ +

The example module already links TRAP (libtrap) and UniRec libraries. +It is a simple module with one input and one output interface which receives on +input inteface a message in UniRec format with two numbers and sends them +together with their sum to output interface.

+ +

The code contains comments but here is the list of important operations:

+ +

+Libtrap

+ +

Generated doxygen doc for module developers: https://rawgit.com/CESNET/Nemea-Framework/master/libtrap/doc/doxygen/html/index.html

+ +

Generated doxygen doc for libtrap developers: https://rawgit.com/CESNET/Nemea-Framework/master/libtrap/doc/devel/html/index.html

+ +
    +
  1. +Basic module information - specify name, description and number of input / output interfaces of the module
  2. +
  3. +Module parameters - define parameters the module accepts as program arguments
  4. +
  5. +Module info structure initialization - initialize a structure with information from the two previous points
  6. +
  7. +TRAP initialization - initialize module interfaces
  8. +
  9. +GETOPT macro - parse program arguments
  10. +
  11. Main loop: + + +
  12. +
  13. +TRAP and module info clean-up - free everything, libtrap finalization
  14. +
+ +

+UniRec

+ +

Generated doxygen doc: https://rawgit.com/CESNET/Nemea-Framework/master/unirec/doc/html/index.html

+ +
    +
  1. +UniRec fields definition - define data types and names of the fields which will be used in UniRec messages (both received and sent messages), e.g. uint32 PACKETS +
  2. +
  3. +Templates creation - create UniRec templates separately for every interface (a template defines set of fields in the message) note: two input interfaces receiving same messages can use one template
  4. +
  5. +Output record allocation - allocate a memory for message sent via output interface
  6. +
  7. Main loop (fields manipulation): + +
      +
    • +get field - get a value of specified field from received message according to UniRec template
    • +
    • +set field - set a value of specified field in message which will be sent according to UniRec template
    • +
    • +copy fields - copy values of fields in received message to fields in message which will be sent according to UniRec templates of both interfaces (only fields that are common for both interfaces are copied)
    • +
    +
  8. +
  9. +UniRec cleanup - free everything, UniRec finalization
  10. +
+ +

+Execute the module

+ +

+Module help

+ +

After executing /data/mighty-module/mighty_module -h, program prints help which contains information from module info structure:

+ +
    +
  • module basic information - name, description, number of input / output interfaces
  • +
  • module parameters - short opt, long opt, description, argument data type
  • +
  • TRAP library parameters - parameters common for all modules using libtrap
  • +
+ +

+Develop the module

+ +

Now just modify the algorithm in the main loop and the job is done :-)

+ +

+Add new module to running configuration

+ +

This section is for those who has already deployed the system (Deploy NEMEA +section) and wants to add their module to the running configuration. It can be done in 3 steps:

+ +
    +
  1. Create a .sup config file for your module. You can use this empty template and fill it according to this example (example with comments).
  2. +
  3. Add the new .sup file to directory included in the Supervisor configuration file. If you have used recommended parameters of the configure script during the installation, both the configuration file and the directories should be located in /etc/nemea, otherwise check the paths in the configuration file the Supervisor is running with. Than copy the file to one of the directories you want e.g. cp ./your_module.sup /etc/nemea/others.
  4. +
  5. Connect to Supervisor using supcli command and select option 6 reload configuration. New module should be added and if the enabled flag is set to true, it should be also running.
  6. +
+ +

For detailed information about Supervisor configuration see its README.

+ +

+NEMEA Related Publications

+ + +
+
+ + + + + + + + diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..374ede4d --- /dev/null +++ b/_config.yml @@ -0,0 +1,24 @@ +# Welcome to Jekyll! +# +# This config file is meant for settings that affect your whole blog, values +# which you are expected to set up once and rarely need to edit after that. +# For technical reasons, this file is *NOT* reloaded automatically when you use +# 'jekyll serve'. If you change this file, please restart the server process. + +# Site settings +title: NEMEA +email: your-email@domain.com +description: > # this means to ignore newlines until "baseurl:" + System for network traffic analysis and anomaly detection. +baseurl: "" # the subpath of your site, e.g. /blog +url: "//nemea.liberouter.org/" # the base hostname & protocol for your site +twitter_username: NEMEA_System +github_username: + +# Build settings +markdown: kramdown +include: + - _static + - _modules + - _sources + diff --git a/_includes/comment.html b/_includes/comment.html new file mode 100644 index 00000000..8536de7e --- /dev/null +++ b/_includes/comment.html @@ -0,0 +1,36 @@ +{% if page.nocomments %} +{% else %} +{% if site.disqus_shortname %} +
+
+ +
+{% endif %} +{% if site.duoshuo_shortname %} +
+ +
+ + + + +
+{% endif %} +{% endif %} \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 00000000..48e43c8e --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,7 @@ + + diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 00000000..26ff5338 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,14 @@ + + + + + + {% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %} + + + + + + + + diff --git a/_includes/header.html b/_includes/header.html new file mode 100644 index 00000000..78de3119 --- /dev/null +++ b/_includes/header.html @@ -0,0 +1,12 @@ +
+
+ {{ site.title }} + +
+
\ No newline at end of file diff --git a/_includes/icon-github.html b/_includes/icon-github.html new file mode 100644 index 00000000..e501a16b --- /dev/null +++ b/_includes/icon-github.html @@ -0,0 +1 @@ +{% include icon-github.svg %}{{ include.username }} diff --git a/_includes/icon-github.svg b/_includes/icon-github.svg new file mode 100644 index 00000000..4422c4f5 --- /dev/null +++ b/_includes/icon-github.svg @@ -0,0 +1 @@ + diff --git a/_includes/icon-twitter.html b/_includes/icon-twitter.html new file mode 100644 index 00000000..e623dbd6 --- /dev/null +++ b/_includes/icon-twitter.html @@ -0,0 +1 @@ +{{ include.username }} diff --git a/_includes/icon-twitter.svg b/_includes/icon-twitter.svg new file mode 100644 index 00000000..dcf660e7 --- /dev/null +++ b/_includes/icon-twitter.svg @@ -0,0 +1 @@ + diff --git a/packer/centos-7.1/template.json-vagrant-box b/_includes/sidebar.html similarity index 100% rename from packer/centos-7.1/template.json-vagrant-box rename to _includes/sidebar.html diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 00000000..f9b7f4bd --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,96 @@ + + + + {% include head.html %} + + + + + +
+
+ View on GitHub + +

NEMEA

+

System for network traffic analysis and anomaly detection.

+ + + + + +
+{% for page in site.pages %}{% if page.docmenu %}{% if page.menuentry %}{{ page.menuentry }}{% else %}{{ page.title }}{% endif %}{% endif %}{% endfor %} +
+
+
+ +
+
+ +
+
+ {{ content }} +
+
+ + +
+
+ + {% include footer.html %} + + + + + + + diff --git a/_layouts/page.html b/_layouts/page.html new file mode 100644 index 00000000..9b863dbc --- /dev/null +++ b/_layouts/page.html @@ -0,0 +1,16 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+
+ +
+ {{ content }} +
+ + {% include comment.html %} + +
diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 00000000..93d15a58 --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,17 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+ +
+ +
+ {{ content }} +
+ + {% include comment.html %} + +
diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 7c590a31..00000000 --- a/bootstrap.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -autoreconf -i diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d55773a2..00000000 --- a/configure.ac +++ /dev/null @@ -1,53 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.63]) -AC_INIT([nemea], [2.6.0], [nemea@cesnet.cz]) -AM_INIT_AUTOMAKE([foreign subdir-objects]) -RELEASE=1 -AC_SUBST(RELEASE) -USERNAME=`git config --get user.name` -USERMAIL=`git config --get user.email` -AC_SUBST(USERNAME) -AC_SUBST(USERMAIL) -# Check for rpmbuild -AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild, [""]) - -AC_SUBST(RPMBUILD) -if test -z "$RPMBUILD"; then - AC_MSG_WARN([Due to missing rpmbuild you will not able to generate RPM package.]) -fi - -RPM_RELEASE=1 -AC_SUBST(RPM_RELEASE) -AM_CONDITIONAL(MAKE_RPMS, test x$RPMBUILD != x) - -AC_ARG_ENABLE([supervisor], AC_HELP_STRING([--disable-supervisor], [Disable supervisor.]), - [AM_CONDITIONAL([ENABLE_SUPERVISOR], [test "x$enableval" = xyes])], - [AM_CONDITIONAL([ENABLE_SUPERVISOR], [true])]) - -AC_ARG_ENABLE([modules], AC_HELP_STRING([--disable-modules], [Disable NEMEA modules.]), - [AM_CONDITIONAL([ENABLE_MODULES], [test "x$enableval" = xyes])], - [AM_CONDITIONAL([ENABLE_MODULES], [true])]) - -AC_ARG_ENABLE([detectors], AC_HELP_STRING([--disable-detectors], [Disable NEMEA detectors.]), - [AM_CONDITIONAL([ENABLE_DETECTORS], [test "x$enableval" = xyes])], - [AM_CONDITIONAL([ENABLE_DETECTORS], [true])]) - -AC_CONFIG_FILES([Makefile - nemea.spec]) -AC_CONFIG_SUBDIRS([nemea-framework nemea-supervisor modules detectors]) - -# By default, users expects "repobuild" behavior, i.e., use relative path to NEMEA framework. -# If there is some "repobuild" arg of configure, do not add "--enable-repobuild". -if test -z "$ac_configure_args" || echo "$ac_configure_args" | grep -q -v -e 'repobuild'; then -ac_configure_args="$ac_configure_args --enable-repobuild" -fi - -AC_OUTPUT - -echo "Components:" -echo " NEMEA modules....................: `if [[ -z "$ENABLE_MODULES_TRUE" ]]; then echo enabled; else echo disabled; fi`" -echo " NEMEA detectors..................: `if [[ -z "$ENABLE_DETECTORS_TRUE" ]]; then echo enabled; else echo disabled; fi`" -echo " NEMEA supervisor.................: `if [[ -z "$ENABLE_SUPERVISOR_TRUE" ]]; then echo enabled; else echo disabled; fi`" - diff --git a/detectors b/detectors deleted file mode 160000 index 84f6f1b1..00000000 --- a/detectors +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 84f6f1b15f43f0b81e34c4859ff1ada6fb6e8270 diff --git a/developers/CodingStyle.md b/developers/CodingStyle.md new file mode 100644 index 00000000..53914d91 --- /dev/null +++ b/developers/CodingStyle.md @@ -0,0 +1,516 @@ +--- +layout: page +title: Coding Style for C sources +menuentry: Developer +public: false +docmenu: false +permalink: /developer/coding-style-c +--- + +Nemea Coding Style +================== + +This file describes the coding style used in most C files in this project. + +The following GNU indent options approximate this style: + + -npro -bad -bap -bbb -br -blf -brs -cdw -ce -fca -cli0 -npcs -i3 \ + -nbfda -nut -saf -sai -saw -sbi3 -ncdb -pi3 -cs -di1 -lp -il0 -hnl \ + -npsl -l100 -lc100 + +You should take care of indent(1) output manually because it is not able +to figure out e.g. data types defined by typedef. The example of issues +with the output is '&' or '*' that are interpreted as operators instead of +reference and dereference. + +BASICS +------ + +Recommended limit of line size is 100 characters. If you need longer lines, +you should really think about your code (and yourself). + +Do not use tabs for indentation. Use 3 spaces instead. + +Avoid trailing spaces on lines. +(You can use clean_source_codes.sh or set up favourite editor.) + + +NAMING +------ + +Use names that explain the purpose of a function or object. + +Use underscores to separate words in an identifier: multi_word_name. + +Use lowercase for most names. Use uppercase for macros, macro +parameters, and members of enumerations. + +Give arrays names that are plural. + +Avoid negative names: `"found"` is a better name than "not_found". + + +COMMENTS +-------- + +Comments should be written as full sentences that start with a +capital letter and end with a period. Put two spaces between +sentences. + +Write block comments as shown below. You may put the /\* and \*/ on +the same line as comment text if you prefer. + + /* + * We redirect stderr to /dev/null because we often want to remove all + * traffic control configuration on a port so its in a known state. If + * this done when there is no such configuration, tc complains, so we just + * always ignore it. + */ + +Each function and each variable declared outside a function, and +each struct, union, and typedef declaration should be preceded by a +Doxygen comment. See FUNCTION DEFINITIONS below for function comment +guidelines. + +Each struct and union member should each have an inline comment that +explains its meaning. structs and unions with many members should be +additionally divided into logical groups of members by block comments, +e.g.: + + /** + * An event that will wake the following call to poll_block(). + */ + struct poll_waiter { + struct list node; ///< Node of list of file descriptors. + int fd; ///< File descriptor. + short int events; ///< Events to wait for (POLLIN, POLLOUT). + poll_fd_func *function; ///< Callback function, if any, or null. + void *aux; ///< Argument to callback function. + struct backtrace *backtrace; ///< Event that created waiter, or null. + /** Pointer to element of the pollfds array + * (null if added from a callback). */ + struct pollfd *pollfd; + }; + +Use XXX, FIXME or TODO comments to mark code that needs work. + +Don't comment out or #if 0 out code. Just remove it. The code that +was there will still be in version control history. + + +FUNCTIONS +--------- + +Put the return type, function name, and the braces that surround the +function's code on the same line, all starting in column 0. + +Before each function definition (or declaration in header file with +API), write a Doxygen comment that describes the function's purpose, +including each parameter, the return value, and side effects. +The comment does not need to describe how a function does its work, +unless this information is needed to use the function correctly +(this is often better done with comments *inside* the function). +On the other hand, comment must describe how the function can be used +and what are its results. + +All function declarations and definitions should include a +prototype. Empty parentheses, e.g. `"int foo();"`, do not include a +prototype (they state that the function's parameters are unknown); +write `"void"` in parentheses instead, e.g. `int foo(void);`. + +In the absence of good reasons for another order, the following +parameter order is preferred. One notable exception is that data +parameters and their corresponding size parameters should be paired. + +1. The primary object being manipulated, if any (equivalent to the + `"this"` pointer in C++). +2. Input-only parameters. +3. Input/output parameters. +4. Output-only parameters. +5. Status parameter. + +Example: + + /** + * Get features of the network device interface. + * + * \param[in] netdev pointer to the network device. + * \param[out] *current current features of the device. + * \param[out] *advertised advertised features of the device. + * \param[out] *supported supported features of the device. + * \param[out] *peer peer features of the device. + * \returns 0 on success, otherwise a positive errno value. + */ + int netdev_get_features(struct netdev *netdev, uint32_t *current, + uint32_t *advertised, uint32_t *supported, + uint32_t *peer) + { + ... + } + +Functions that destroy an instance of a dynamically-allocated type +should accept and ignore a null pointer argument. Code that calls +such a function (including the C standard library function free()) +should omit a null-pointer check. We find that this usually makes +code easier to read. + +Functions in .c files should not normally be marked `"inline"`, because +it does not usually help code generation and it does suppress +compilers warnings about unused functions. (Functions defined in .h +usually should be marked inline.) + + +FUNCTION PROTOTYPES +------------------- + +Put the return type and function name on the same line in a function +prototype: + + static const struct option_class *get_option_class(int code); + + +STATEMENTS +---------- + +Indent each level of code with 3 spaces. Use BSD-style brace +placement: + + if (a()) { + b(); + d(); + } + +Put a space between `if`, `while`, `for`, etc. and the expressions +that follow them. + +Enclose single statements in braces: + + if (a > b) { + return a; + } else { + return b; + } + +Use comments and blank lines to divide long functions into logical +groups of statements. + +Try to avoid assignments inside `if` and `while` conditions. + +If it helps to clarify meaning of `if` and `else` branches (what can reader +expect in the branch), write comment into the branch's block. + +Write only one statement per line. + +Indent `switch` statements like this: + + switch (conn->state) { + case S_RECV: + error = run_connection_input(conn); + break; + + case S_PROCESS: + error = 0; + break; + + case S_SEND: + error = run_connection_output(conn); + break; + + default: + OVS_NOT_REACHED(); + } + +Use `for (;;)` or `while (1)` to write an infinite loop. + +In an if/else construct where one branch is the `normal` or `common` +case and the other branch is the `uncommon` or `error` case, put the +common case after the `if`, not the `else`. This is a form of +documentation. It also places the most important code in sequential +order without forcing the reader to visually skip past less important +details. (Some compilers also assume that the `if` branch is the more +common case, so this can be a real form of optimization as well.) + + +MACROS +------ + +Don't define an object-like macro if an enum can be used instead. + +Don't define a function-like macro if a `static inline` function +can be used instead. + +If a macro's definition contains multiple statements, enclose them +with `do { ... } while (0)` to allow them to work properly in all +syntactic circumstances. + +Do use macros to eliminate the need to update different parts of a +single file in parallel, e.g. a list of enums and an array that gives +the name of each enum. For example: + + /* Logging importance levels. */ + #define VLOG_LEVELS \ + VLOG_LEVEL(EMER, LOG_ALERT) \ + VLOG_LEVEL(ERR, LOG_ERR) \ + VLOG_LEVEL(WARN, LOG_WARNING) \ + VLOG_LEVEL(INFO, LOG_NOTICE) \ + VLOG_LEVEL(DBG, LOG_DEBUG) + enum vlog_level { + #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) VLL_##NAME, + VLOG_LEVELS + #undef VLOG_LEVEL + VLL_N_LEVELS + }; + + /* Name for each logging level. */ + static const char *level_names[VLL_N_LEVELS] = { + #define VLOG_LEVEL(NAME, SYSLOG_LEVEL) #NAME, + VLOG_LEVELS + #undef VLOG_LEVEL + }; + + +SOURCE FILES +------------ + +Each source file should contain a Doxygen comment explaining the purpose +of the code and stating the date of creation or modifications and authors. +The comment must be followed by BSD license. + +The first non-comment line in a .c source file should be: + + #include + +\#include directives should appear in the following order: + +1. \#include + +2. The module's own headers, if any. Including this before any + other header (besides ) ensures that the module's + header file is self-contained (see HEADER FILES) below. + +3. Standard C library headers and other system headers, preferably + in alphabetical order. (Occasionally one encounters a set of + system headers that must be included in a particular order, in + which case that order must take precedence.) + +4. Libtrap / nemea-common / UniRec headers if needed enclosed by <> + + +HEADER FILES +------------ + +Each header file should start with its BSD license, as described under +SOURCE FILES above, followed by a `header guard` to make the header +file idempotent, like so: + + #ifndef NETDEV_H + #define NETDEV_H 1 + + ... + + #endif /* netdev.h */ + +Header files should be self-contained; that is, they should #include +whatever additional headers are required, without requiring the client +to #include them for it. + +Don't define the members of a struct or union in a header file, +unless client code is actually intended to access them directly or if +the definition is otherwise actually needed (e.g. inline functions +defined in the header need them). + +Similarly, don't #include a header file just for the declaration of +a struct or union tag (e.g. just for `struct name;`). Just declare +the tag yourself. This reduces the number of header file +dependencies. + + +TYPES +----- + +Use typedefs sparingly. Code is clearer if the actual type is +visible at the point of declaration. + +A function type is a good use for a typedef because it can clarify +code. The type should be a function type, not a pointer-to-function +type. That way, the typedef name can be used to declare function +prototypes. (It cannot be used for function definitions, because that +is explicitly prohibited by C89 and C99.) + +You may assume that `char` is exactly 8 bits and that `int` and +`long` are at least 32 bits. + +Don't assume that `long` is big enough to hold a pointer. If you +need to cast a pointer to an integer, use `intptr_t` or `uintptr_t` +from ``. + +Use the `int_t` and `uint_t` types from `` for exact-width +integer types. Use the `PRId`, `PRIu`, and `PRIx` macros from +`` for formatting them with `printf()` and related functions. + +For compatibility with antique `printf()` implementations: + +- Instead of `%zu`, use `"%"PRIuSIZE`. + +- Instead of `%td`, use `"%"PRIdPTR`. + +- Instead of `%ju`, use `"%"PRIuMAX`. + +Other variants exist for different radixes. For example, use +`"%"PRIxSIZE` instead of `%zx` or `%x` instead of `%hhx`. + +Also, instead of `%hhd`, use `%d`. Be cautious substituting `%u`, +`%x`, and `%o` for the corresponding versions with `hh`: cast the +argument to unsigned char if necessary, because printf(`%hhu`, -1) +prints 255 but printf(`%u`, -1) prints 4294967295. + +Use bit-fields sparingly. Do not use bit-fields for layout of +network protocol fields or in other circumstances where the exact +format is important. + +Declare bit-fields to be signed or unsigned integer types or `_Bool` +(aka `bool`). Do *not* declare bit-fields of type `int`: C99 allows +these to be either signed or unsigned according to the compiler's +whim. (A 1-bit bit-field of type `int` may have a range of -1...0!) + +Try to order structure members such that they pack well on a system +with 2-byte `short`, 4-byte `int`, and 4- or 8-byte `long` and pointer +types. Prefer clear organization over size optimization unless you +are convinced there is a size or speed benefit. + +Pointer declarators bind to the variable name, not the type name. +Write `int *x`, not `int* x` and definitely not `int * x`. + + +EXPRESSIONS +----------- + +Put one space on each side of infix binary and ternary operators: + +``` +* / % ++ - +<< >> +< <= > >= +== != +& +^ +| +&& +|| +?: += += -= *= /= %= &= ^= |= <<= >>= +``` + +Avoid comma operators. + +Do not put any white space around postfix, prefix, or grouping +operators: + +``` +() [] -> . +! ~ ++ -- + - * & +``` + +Exception: Put a space between the `()` used in a cast and the +expression whose type is cast: `(void *) 0`. + +Break long lines before the ternary operators `?` and `:`, rather than +after them, e.g. + +```C +return (out_port != VIGP_CONTROL_PATH + ? alpheus_output_port(dp, skb, out_port) + : alpheus_output_control(dp, skb, fwd_save_skb(skb), + VIGR_ACTION)); +``` + + +Do not parenthesize the operands of && and || unless operator +precedence makes it necessary, or unless the operands are themselves +expressions that use && and ||. Thus: + +``` +if (!isdigit((unsigned char) s[0]) + || !isdigit((unsigned char) s[1]) + || !isdigit((unsigned char) s[2])) { + printf("string %s does not start with 3-digit code\n", s); +} +``` + +but + +``` +if (rule && (!best || rule->priority > best->priority)) { + best = rule; +} +``` + +Do parenthesize a subexpression that must be split across more than +one line, e.g.: + +``` +*idxp = ((l1_idx << PORT_ARRAY_L1_SHIFT) + | (l2_idx << PORT_ARRAY_L2_SHIFT) + | (l3_idx << PORT_ARRAY_L3_SHIFT)); +``` + +Try to avoid casts. + +When using a relational operator like `<` or `==`, put an expression +or variable argument on the left and a constant argument on the +right, e.g. `x == 0`, *not* `0 == x`. + + +BLANK LINES +----------- + +Put one blank line between top-level definitions of functions and +global variables (or more blank lines if there is so much functions/variables +that they are themselves split to logical groups by blank lines). + + +C DIALECT +--------- + +Most C99 features are OK because they are widely implemented: + +* Flexible array members (e.g. struct { int foo[]; }). + +* `static inline` functions (but no other forms of `inline`, for + which GCC and C99 have differing interpretations). + +* `long long` + +* `` and ``. + +* bool and ``, but don't assume that bool or `_Bool` can + only take on the values 0 or 1, because this behavior can't be + simulated on C89 compilers. + Also, don't assume that a conversion to bool or `_Bool` follows + C99 semantics. I.e. use `(bool) (some_value != 0)` rather than + `(bool) some_value`. The latter might produce unexpected results + on non-C99 environments. For example, if bool is implemented as + a typedef of char and `some_value = 0x10000000`. + +* Designated initializers (e.g. `struct foo foo = {.a = 1};` and + `int a[] = {[2] = 5};`). + +* Mixing of declarations and code within a block. Please use this + judiciously; keep declarations nicely grouped together in the + beginning of a block if possible. + +* Use of declarations in iteration statements (e.g. + `for (int i = 0; i < 10; i++)`). + +* Use of a trailing comma in an enum declaration (e.g. + `enum { x = 1, };`). + +As a matter of style, avoid `//` comments. + +Avoid using GCC or Clang extensions unless you also add a fallback +for other compilers. You can, however, use C99 features or GCC +extensions also supported by Clang in code that compiles only on +GNU/Linux, because GCC is the system compiler there. + + diff --git a/developers/git-policy.md b/developers/git-policy.md new file mode 100644 index 00000000..da6f0819 --- /dev/null +++ b/developers/git-policy.md @@ -0,0 +1,59 @@ +--- +layout: page +title: Git commit policy +menuentry: Developer +public: false +docmenu: false +permalink: /developer/git-policy +--- + +* A commit has its purpose. It SHOULD be just a SINGLE purpose. Commits should be "atomic", i.e., one commit is a single change of one funcionality/feature/module. It is usually up to developer's intuition whether a commit is or is not atomic... So think about changes you put in one commit. + +* Commit message must explain what the changes do or what they should have done. Commit message helps reviewer to decide whether the change does the right thing or there is some error. Therefore, pay attention on writting a proper message in the following format: + +``` +libtrap: TLS ifc: bugfix double close() + +There was no prevention from calling close() repeatedly for the already +closed socket descriptor. + +This patch sets the closed socket descriptor to `-1` and checks this value +before closing. + +The patch relates to issue #123. +``` + +Explained in more details: + +`libtrap: TLS ifc: bugfix double close()` generally consists of 2 parts: +the first one **identifies** scope of this patch (such as `libtrap: TLS ifc:`). +It can be just `libtrap` or more precisly `libtrap: TLS ifc` as it is in the +example. The second part identifies the problem that is being solved by this +commit. + +The first line should be short enough but it should be informative. + +After this first line, skip one empty line. This is a common practice for git messages. +It is important because tools count on it. Github can show the first lines + +The rest of this example (as well as your commit messages) contains details about this +commit. + +Don't forget to reference issue number. Hashtag of the issue should be enough. +This helps Github to present all related work at a single page of the issue. + +## Keywords in commit messages + +*This part is just a draft by now.* + +We are planning to prepare ChangeLogs somehow automatically. Therefore, we +need to mark commits with some keywords. + +Add a line into the detailed description: + +* `changelog: Add module .` (`` was added into the package) +* `changelog: Add feature to .` (`` was added into ``) +* `changelog: Fix in .` (`` was fixed into ``) +* `changelog: Bugfixes in .` + + diff --git a/developers/github-workflow.md b/developers/github-workflow.md new file mode 100644 index 00000000..c6ba4f35 --- /dev/null +++ b/developers/github-workflow.md @@ -0,0 +1,35 @@ +--- +layout: page +title: Information for current and future developers +menuentry: Developer +public: false +docmenu: false +permalink: /developer/github-workflow +--- + +For efficient collaboration, please bear in mind the following advices: + +0. If you are not a member of NEMEA team, please fork the project on Github. Otherwise, you can probably push into the repo thus skip to 1. + +1. Before you start hacking, please switch to a new branch with some self-explanation name: + +`git branch flow_meter-cifs; git checkout flow_meter-cifs` + +2. Make your idea real! This is the most funny part - programming. Please, follow our [Git commit policy](/developer/git-policy) to make code reviews easier for us. + +3. Write documentation immediatelly. It is really necessary for reviewers to see what parameters and return values your functions/methods have. And description of functionality is needed as well - it is possible to find errors in the code thanks to such brief description of your idea (what it should do vs. what it does). + +4. Push your branch either into your forked repo or into our repo, into a NEW branch: + +`git push origin flow_meter-cifs:flow_meter-cifs` + +5. Create a Pull Request (PR) using the Github web interface (it is quite intuitive) from your branch into `master` (base). + +6. Wait for our code review, please don'ŧ get angry because of the feedback, we don't want to insult you, we just need a perfect code and consistent project. In case there is something we need to fix in the PR, it will be very kind of you to help us. + +Final notes: + +When the PR is merged into master, we usually delete the original branch that is no longer needed. +For the next PR, we always use a new branch. + + diff --git a/developers/how-to-contribute.md b/developers/how-to-contribute.md new file mode 100644 index 00000000..5b6035be --- /dev/null +++ b/developers/how-to-contribute.md @@ -0,0 +1,18 @@ +# How to contribute + +1. Open an issue +2. if you are new to this project: + + 2.1 fork the project (if you don't have it yet) + + 2.2 Clone your own forked repository (`git clone ...`) + +3. Checkout the latest version of the base branch (if it is different from master - rare but possible situation) +4. Create a new branch and checkout it - this will be the place where you can solve the issue. +5. Write patches, commit them and push them into your forked repo. + * PLEASE, DO NOT FORGET to reference the issue (e.g. ref #123 or closes #123). + * PLEASE, BEAR IN MIND our CodingStyle and commit policy. +6. When you think you are done, create a Pull Request using GitHub web interface. +7. After merging your Pull Request, your temporary branch is useless. Checkout the base branch (usually `master`) and prune deleted branches (`git fetch --all -p`) + + diff --git a/developers/index.md b/developers/index.md new file mode 100644 index 00000000..3e3f4967 --- /dev/null +++ b/developers/index.md @@ -0,0 +1,18 @@ +--- +layout: page +title: Information for current and future developers +menuentry: Developer +public: true +docmenu: false +permalink: /developer/ +--- + +This section contains useful information for developers: + +* [Coding Style C](/developer/coding-style-c) +* [Coding Style Python](https://www.python.org/dev/peps/pep-0008/) +* [Git Commit Policy](/developer/git-policy) +* [Github Workflow](/developer/github-workflow) +* [Releasing Packages](/developer/packaging) + + diff --git a/developers/package-releasing.md b/developers/package-releasing.md new file mode 100644 index 00000000..bbaafb19 --- /dev/null +++ b/developers/package-releasing.md @@ -0,0 +1,12 @@ +--- +layout: page +title: Guide to releasing packages +menuentry: Developer +public: false +docmenu: false +permalink: /developer/packaging +--- + +TODO + + diff --git a/doc/aggregation.md b/doc/aggregation.md new file mode 100644 index 00000000..8a2b947e --- /dev/null +++ b/doc/aggregation.md @@ -0,0 +1,200 @@ +--- +layout: page +title: Aggregation module +menuentry: Aggregation +public: false +docmenu: true +permalink: /doc/aggregation/ +--- + +## Description + +Universal aggregation module (`agg`) for UniRec records. The main goal of this module is to aggregate receiving UniRec records due to rules specified by user. Rules can be combination of any implemented function with **only one** restriction, that **only one** aggregation function can be assigned to a field. This restriction is a result of module in place processing design. + +User has to specify parameters for processing including aggregation key fields and other with aggregation function which will be applied to it. [There](#aggregation-functions) you can find list currently available functions. + +Module work with 4 different timeout types, which describe how records should be handled and where should be send out from module. + +- **Active** (Default with `TIMEOUT` length set to 10 seconds.) + + Every received record is compared with the stored one of the equal aggregation key (if exists). If the `TIME_FIRST` field value of received record is greater than `TIME_FIRST` field value + `TIMEOUT` of stored record, the stored record is sent out from module and replaced with the new one. Otherwise the record fields values are updated due to specified rules. + +- **Passive** + + Every stored record is periodically checked every `TIMEOUT` second. In case that `TIME_LAST` field value is `TIMEOUT` seconds old (untouched) or older, the record is sent out and removed from storage. No action is taken otherwise. + +- **Global** + + Each stored records are periodically sent out every `TIMEOUT` second. + +- **Mixed** + + This type presents combination of *Active* and *Passive* timeout types. Both can have different `TIMEOUT` length value and both values are used separately for given type. When specifying ordered values need to be used in form `-t M:Active,Passive`. + + Module receives UniRec and sends UniRec containing fields which take part in aggregation process (`TIME_FIRST`, `TIME_LAST`, `COUNT`, key fields and all with aggregation function assigned), other fields are discarded by module. + +## Interfaces + +- Input: One input interface represented by *libtrap*. + + Used UniRec template **always has to** contain fields `TIME_FIRST` and `TIME_LAST`. + +- Output: One output interface represented by *libtrap*. + + Output UniRec template is generated from module configuration specified by user (`TIME_FIRST`, `TIME_LAST`, `COUNT` are always included). + +## Aggregation key specification + +Key is specified the same way as other aggregation function. +`-k FIELD_NAME` or `--key FIELD_NAME`. Every field needs to be specified with own pair of function and field name (`-k DST_IP -k SRC_IP ...`). + +## Aggregation functions + +Functions are specified as pair of prefix and field name. Prefix determines the type of aggregation function to be assigned to given field name. Every field definition needs to be specified with own pair of prexix and field name the same way as key above + +- **Sum** + + Makes total sum of field values. Function is assigned using `-s FIELD_NAME` or `--sum FIELD_NAME`. + +- **Avg** + + Makes average of field values. Every record stores its sum and in postprocessing phase before the record is sent, the average is computed. Function is assigned using `-a FIELD_NAME` or `--avg FIELD_NAME`. + +- **Min** + + Keep minimal value of field across all received records. Function is assigned using `-m FIELD_NAME` or `--min FIELD_NAME`. + +- **Max** + + Keep maximal value of field across all received records. Function is assigned using `-M FIELD_NAME` or `--max FIELD_NAME`. + +- **First** + + Keep the first obtained value of field. Function is assigned using `-f FIELD_NAME` or `--first FIELD_NAME`. + +- **Last** + + Update the field with every new received record. Function is assigned using `-l FIELD_NAME` or `--last FIELD_NAME`. + +- **Bitwise OR** + + Makes bitwise OR of field with every new received record. Function is assigned using `-o FIELD_NAME` or `--or FIELD_NAME`. + +- **Bitwise AND** + + Makes bitwise AND of field with every new received record. Function is assigned using `-n FIELD_NAME` or `--and FIELD_NAME`. + +## Input + +User defined configuration specifying + +* **key for aggregation** (fields which have to match to aggregate records together with specified operations.) *When no key specified all records are considered to have the equal key for processing.* +* **field and function** (pair of aggregation function prefix and field name) +* **time window** - Pair of timeout type and length described in [module description](#description). Available use for aggregation time window length 60 is `-t A:60` of `-t Active:60` for *Active*, `-t G:60` or `-t Global:60` for *Global*, `-t P:60` or `-t Passive:60` for *Passive*, `-t M:60,60` or `-t Mixed:60,60` for *Mixed*. + +## Output + +New UniRec record containing + +* aggregation key fields +* processed fields +* `COUNT` +* `TIME_FIRST`, `TIME_LAST` fields + +## Use cases + +### Overall sum of bytes/packets/flows in given time window + +(eg. making graphs) + +* Key + +`Nothing` or `LINK_BIT_FIELD` (sums for different links) + +* Aggregation + +``` +sum:BYTES, sum:PACKETS, min:TIME_FIRST, max:TIME_LAST +``` + +#### Module configuration + +``` +./agg -i u:input,u:output -s BYTES -s PACKETS +./agg -i u:input,u:output -k LINK_BIT_FIELD -s BYTES -s PACKETS +``` + +Fields `TIME_FIRST` and `TIME_LAST` are always automaticaly handled by module using minimal `TIME_FIRST` value and maximal `TIME_LAST` value for given key. + +### Blacklist filter output aggregation. + +Requests from one source in specific time interval are aggregated to one record, which is in report system converted to IDEA message. + +* Key + +``` +SRC_IP, DST_IP, DST_BLACKLIST +``` + +* Aggregation + +``` +sum:BYTES, sum:PACKETS, count:FLOWS, min:TIME_FIRST. max:TIME_LAST +``` + +#### Module configuration + +``` +./agg -i u:input,u:output -k SRC_IP -k DST_IP -k DST_BLACKLIST -s BYTES -s PACKETS +``` + +Fields `TIME_FIRST`, `TIME_LAST`, COUNT are always automaticaly handled by module using minimal `TIME_FIRST` value, maximal `TIME_LAST` value and count of processed records for given key. + +### Clasic flow aggreagation + +Flows divided into more records (in case of too short probe active timeout) are combined into one. + +* Key + +``` +SRC_IP, DST_IP, SRC_PORT, DST_PORT, PROTOCOL [, TOS, LINK_BIT_FIELD, DIR_BIT_FIELD] +``` + +* Aggregation + +``` +sum:BYTES, sum:PACKETS, min:TIME_FIRST, max:TIME_LAST, or:TCP_FLAGS +``` + +### Module configuration + +``` +./agg -i u:input,u:output -k SRC_IP -k DST_IP -k SRC_PORT -k DST_PORT -k PROTOCOL -s BYTES -s PACKETS -o TCP_FLAGS +``` + +Fields `TIME_FIRST` and `TIME_LAST` are always automaticaly handled by module using minimal `TIME_FIRST` value and maximal `TIME_LAST` value for given key. + +### DNS amplification attack detection + +**Functions mentioned there are not present in current solution.** In combination with input filter on `SRC_Port=53` and output filter with tresholds. + +* Key + +``` +SRC_IP, DST_IP +``` + +* Aggregation + +``` +sum:BYTES, sum:PACKETS, avg:BYTES_AVG, stdev:BYTES +``` + +### Module configuration + +``` +./agg -i u:input,u:output -k SRC_IP -k DST_IP -s BYTES -s PACKETS -a BYTES_AVG +``` + +Current module implementation cannot apply 2 different aggregation functions on the same record field. The field `BYTES_AVG` has to be part of input record to be used like this. Function standard deviation (stdev) is not implemented in module (*Featured*). + diff --git a/doc/filter.md b/doc/filter.md new file mode 100644 index 00000000..330a97e3 --- /dev/null +++ b/doc/filter.md @@ -0,0 +1,229 @@ +--- +layout: page +title: Filtering of UniRec messages +menuentry: Filter +public: false +docmenu: true +permalink: /filter/ +--- +# Introduction + +To filter UniRec data, there is an universal NEMEA module called `unirecfilter` +(it can be found at https://github.com/CESNET/Nemea-Modules/tree/master/unirecfilter). + +The `unirecfilter` module can work with filter expression given by `-F` +parameter from command line, or with multiple expressions (and multiple output +IFC) given in a text file passed by `-f`. + +Filter can contain any UniRec field and data type (except UniRec arrays), and +supports all traditional comparison operators with optimized `IN` operator. + +General filter format is: `FIELD OPERATOR VALUE` + +UniRec messages that match the given filter are forwarded via output IFC, others are dropped. + +`unirecfilter` allows to specify output UniRec template `-O`, so the output can contain only a subset of fields. +It is also possible to specify fields that do not need to be present in the input UniRec template; such fields can be set to default value in the output template (e.g., `-O "ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT, string MESSAGE=\"this_is_message\""`). + +`unirecfilter` can be stopped after receiving *N* messages (`-c N`). + + +# Filter + +Filter is a logical expression composed of terms joined together by +logical operators, possibly with the use of brackets (`(`, `)`) and negation (`NOT`). Term is a +triplet `field cmp_operator value`, e.g. `FOO == 1` or `SRC_IP == 10.0.0.1`. + +### Keywords + +It is possible to use the following *keywords* instead of actual UniRec field +name from input template. The keywords are a shortcut (and simplification) for +compound expressions: + +- `host` - stands for `SRC_IP` or `DST_IP` +- `port` - stands for `SRC_PORT` or `DST_PORT` + +The semantics can be explain using the following example of filter: + +``` +host == 192.168.0.0/24 +``` + +which returns true if and only if: + +``` +SRC_IP == 192.168.0.0/24 or DST_IP == 192.168.0.0/24 +``` + +Note: it means any IP address in the range 192.168.0.0-192.168.0.255 matches. + +### Operators + +Available comparison operators are: + +- `>` greater than +- `<` lesser than +- `>=`, `=>` greater than or equal +- `<=`, `=<` lesser than or equal +- `=`, `==` equal/matches subnet +- `!=`, `<>` not equal +- `=~`, `~=` matches regular expression +- `in`, `IN` In-Array function, see the "In Array" section below + +Available logical operators are: + +- `||`, `OR` - or +- `&&`, `AND` - and +- `!`, `NOT` - not + +### Data types + +Almost all data types from unirec are supported: + +- `int8` 8bit signed integer +- `int16` 16bit signed integer +- `int32` 32bit signed integer +- `int32` 32bit signed integer +- `int64` 64bit signed integer +- `uint8` 8bit unsigned integer +- `uint16` 16bit unsigned integer +- `uint32` 32bit unsigned integer +- `uint64` 64bit unsigned integer +- `char` a single ASCII character +- `float` single precision floating point number (IEEE 754) +- `double` double precision floating point number (IEEE 754) +- `ipaddr` special type for IPv4/IPv6 addresses, see unirec README + (note - IPv6 address in a filter loaded from a file has to be + surrounded by double quotes because of syntax issues) +- `string` variable-length array of (mostly) printable characters, + surrounded by double quotes +- `bytes` variable-length array of bytes (not expected to be printable + characters), surrounded by double quotes +- `time` UniRec timestamp, such as `TIME_FIRST`, `TIME_LAST`. The time + column can be compared with date&time specified in format: + `YYYY-mm-ddTHH:MM:SS.sss`, where `.sss` represents miliseconds and + is an optional part (Ex. `2018-01-10T21:17:00`). Note that the + timestamp should be in UTC timezone. + +**Subnets** + +UniRec fields of `ipaddr` type (such as `SRC_IP`, `DST_IP`) can be +compared with host IP addresses or with a subnet in the notation +`IP/BITS`, where `BITS` represents a number of leading '1' bits in the +netmask. + +Example: `-F "SRC_IP == 10.0.0.0/8"` + +Note: `IP` need not to be necessarily a network address (it can be any +IP address) because it is masked during the initiation of the filter +(e.g., `10.1.1.1/8` becomes `10.0.0.0`). + +Operator `==` returns true if and only if an `SRC_IP` belong to the +given subnet. + +**In Array** + +It is possible to abbreviate (and optimize) filter when a field is to be matched +with a set of values. +For example, it is possible to rewrite this: + +`DST_PORT == 1 or DST_PORT == 234 or DST_PORT == 123 or DST_PORT == 80 or DST_PORT == 443` + +into more readable this: + +`DST_PORT in [1, 234, 123, 80, 443]` + +Internally, the array (which is specified in brackets `[` and `]`) is parsed, sorted, +and the filter matching is done using binary search, i.e., it is faster +according to a measurement (mainly for longer arrays). + +The following UniRec types are currently supported by this In Array feature: +`int8`, `int16`, `int32`, `int64`, `uint8`, `uint16`, `uint32`, `uint64`, +`ipaddr`, `time`, `float`, `double`, and "subnets" (i.e., `ipaddr` with prefix +length such as `192.168.0.0/24`) + +### Format + +#### Command line + +Filter specified on command line with `-F` flag is a single expression +which is evaluated for the output interface. For example: `-F "SRC_PORT == 23"` + +#### File + +Filter specified in a file provides more flexibility and allows to use more than +one output interface. + +Format of the file is `TEMPLATE_1:FILTER_1; ...; TEMPLATE_N:FILTER_N;` +where each semicolon separated item corresponds to one output interface. +Line breaks along the separators as well as within a filter are allowed. +One-line comments starting with `#` can be used. +The semicolon at the end is necessary. + +Template can be empty, meaning to use the same template as on input. + +Examples: +``` +ipaddr SRC_IP,ipaddr DST_IP: SRC_IP == 1.2.0.0/16; +``` + +``` +# ifc0: HTTP(S) traffic +:PROTOCOL == 6 && (SRC_PORT in [80, 443] || DST_PORT in [80, 443]); +# ifc1: DNS traffic +:SRC_PORT == 53 || DST_PORT == 53; +``` + +To reload the filter while unirecfilter is running, send signal SIGUSR1 (10) +to the process. + +## Default values + +You can use syntax FIELD=value in the template to specify default +value used if field is not present on the input (f.e. uint32 BAR=1). +Example below. + +`./unirecfilter -i u:test_ifc_in,u:test_ifc_out -O "ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT, string MESSAGE=\"this_is_message\""` + +## Examples + +`./unirecfilter -i IFC_SPEC [-O TMPLT] [-F FLTR]` + +`./unirecfilter -i IFC_SPEC [-f FILE]` + +Here are some examples of running unirecfilter. + +*"Forward only `SRC_IP`, `DST_IP`, `SRC_PORT`, `DST_PORT` fields no matter what is the input template."* + +`./unirecfilter -i u:test_ifc_in,u:test_ifc_out -O "ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT"` + +*"Forward flow the first 100 records with `SRC_PORT higher than 20."* + +`./unirecfilter -i u:test_ifc_in,u:test_ifc_out -c 100 -F "SRC_PORT > 20"` + +*"Forward flow records that have `SRC_IP` or `DST_IP` from the given IP prefixes, and `SRC_PORT` or `DST_PORT` are lower than 200 except 80, 53, 123."* + +`./unirecfilter -i u:test_ifc_in,u:test_ifc_out -F "host IN [195.113.232.0/24, 147.32.0.0/16, 82.208.0.0/16] and port < 200 and not port in [80, 53, 123]"` + +*"Specify output template and forward flow the first 100 records with `SRC_PORT equal to 443 or 53. (Note: filter can be rewritten with IN operator)"* + +`./unirecfilter -i u:test_ifc_in,u:test_ifc_out -c 100 -O "ipaddr SRC_IP, ipaddr DST_IP, uint16 DST_PORT, uint16 SRC_PORT" -F "SRC_PORT == 443 || SRC_PORT == 53"` + +Below is an example of config file "filter.txt" to be used with the `-f` parameter, everything after `#` is considered as comment: + +``` +ipaddr DST_IP,ipaddr SRC_IP:SRC_PORT == 443; #port matching number 443 +uint16 SRC_PORT:SRC_PORT >= 23 || DST_PORT >= 23; #usage of or +string BAR=not_present:BAR ~= "not_present"; #regex usage +``` + +You can then use filter file as shown below: + +`unirecfilter -i u:test_ifc_in,u:test_ifc_out:timeout=HALF_WAIT,u:test_ifc_in,u:test_ifc_out2:timeout=HALF_WAIT -f "filter.txt"` + +Especially notice interface option `:timeout=HALF_WAIT`. It will +enable the module to run even for interfaces that are not listening. +Meaning the module will not hang while waiting for someone to connect. +It will drop the message and move on to sending next one. These +dropped messages will count toward -c option (when this option is +enabled). diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 00000000..e36f4328 --- /dev/null +++ b/doc/index.md @@ -0,0 +1,188 @@ +--- +layout: page +title: Documentation +menuentry: Docs +public: true +permalink: /doc/ +--- + +Related pages: [TRAP IFCSPEC](/trap-ifcspec/), [Reporters](/reporting/), [installation](/doc/installation/) + +This page is written from the high-level view by system users to the low-level +API needed by developers of the NEMEA Modules/Detectors and by developers of +the libraries contained in the NEMEA Framework + +## Usage by User + +The recommended installation of the NEMEA system is done as a part of [STaaS collector](https://github.com/CESNET/STaaS), where Ansible is used. +The installation is described in the [separate page](/doc/installation). + +A default path of the installed modules is in `/usr/bin/nemea/`. +Users can read documentation of the modules in `/usr/share/doc/nemea-modules/` +or `/usr/share/doc/nemea-detectors/`. + +Each module has `-h` parameters to print the module's help. The header of the help +shows number of communication interfaces (IFC). All IFCs are configured at the startup +of a module using `-i` parameter with an argument. +The `-i` parameter is also described in the module's help in a separate section: `-h 1` or `-h trap`. +It is also described at [TRAP IFCSPEC](/trap-ifcspec/) page. + +**Example of help header of a module** + +``` +$ /usr/bin/nemea/vportscan_detector -h +TRAP module, libtrap version: 0.11.2 +=========================================== +Name: vportscan_detector +Inputs: 1 +Outputs: 1 +Description: + Vportscan detector is a simple, threshold-based detector for vertical scans + detection. The detection algorithm uses information from basic flow records + (source and destination IP addresses and ports, protocol, #packets, #bytes). + +... +``` + +This output says that `vportscan_detector` has 1 input IFC and 1 output IFC. + +**Example of a command to start the module** + +``` +/usr/bin/nemea/vportscan_detector -i u:flow_data_source,u:vportscan_out +``` + +This command starts `vportscan_detector`. The input IFC is set to `u` type (UNIX socket) +and `flow_data_source` is and identifier of the IFC. +Comma is a separater of IFCs, so that the second IFC is also of `u` type and the identifier +is `vportscan_out`. + +Note: any input IFC can be connected to one output IFC, this can be done by specifying the +same IFC type and identifier. + +Note2: See [TRAP IFCSPEC](/trap-ifcspec) for more detailed information about IFC configuration +and types. + + +## Usage by Programmer + +This section covers documentation of the [NEMEA Framework](https://github.com/CESNET/Nemea-Framework), +which is the main part of the NEMEA System shared within all NEMEA Modules and Detectors. +It consists of (GitHub links): + +* **libtrap:** [https://github.com/CESNET/Nemea-Framework/tree/master/libtrap](https://github.com/CESNET/Nemea-Framework/tree/master/libtrap) +* **UniRec:** [https://github.com/CESNET/Nemea-Framework/tree/master/unirec](https://github.com/CESNET/Nemea-Framework/tree/master/unirec) +* **nemea-common:** [https://github.com/CESNET/Nemea-Framework/tree/master/common](https://github.com/CESNET/Nemea-Framework/tree/master/common) +* **pytrap:** [https://github.com/CESNET/Nemea-Framework/tree/master/pytrap](https://github.com/CESNET/Nemea-Framework/tree/master/pytrap) +* **pycommon:** [https://github.com/CESNET/Nemea-Framework/tree/master/pycommon](https://github.com/CESNET/Nemea-Framework/tree/master/pycommon) + +These components are described in the following subsections. + +### libtrap + +**Description** + +`libtrap` is a library (shared object) written in C. +The aim of `libtrap` is to provide implementation of various types of communication interfaces (IFC) +that can be used by modules to send or receive data messages. +A developer may choose a number of output and input IFCs. + +Configuration of IFCs is given by a user (not by a developer) when a module is being started. +From the developer'đ point of view, it does not matter what type of IFC is used or what parameters +are used. + +A developer of a module must take care of initialization and finalization of the libtrap context, +however, it can be copied from an existing examples. +Basically, there are two main functions of libtrap that are used by repeatedly used by a developer: +`trap_send()` to send a message via an output IFC and `trap_recv()` to receive a message via an input +IFC. + +**Doxygen** + +[Public API for module developers](./libtrap/) + +[Internal API for developers of libtrap](./libtrap-devel/) + +### UniRec + +**Description** + +UniRec is a definition of binary data representation (format) and an implementation +of functions to work with it. +To understand UniRec, we have to split two terms: `template` and `message`. +A template is a definition of fields that are present in every message. +A field is defined by name and type. + +There is a list of currently used UniRec fields: [unirec_fields.md](https://github.com/CESNET/Nemea/blob/master/unirec_fields.md). +Developers can easily define any field. + +| UniRec Field Type | CPP Constant | C Type | Size in Bytes | +| --------- | -------------- | ---------- | --:| +| char | UR_TYPE_CHAR | char | 1 | +| uint8 | UR_TYPE_UINT8 | uint8_t | 1 | +| int8 | UR_TYPE_INT8 | int8_t | 1 | +| uint16 | UR_TYPE_UINT16 | uint16_t | 2 | +| int16 | UR_TYPE_INT16 | int16_t | 2 | +| uint32 | UR_TYPE_UINT32 | uint32_t | 4 | +| int32 | UR_TYPE_INT32 | int32_t | 4 | +| uint64 | UR_TYPE_UINT64 | uint64_t | 8 | +| int64 | UR_TYPE_INT64 | int64_t | 8 | +| float | UR_TYPE_FLOAT | float | 4 | +| double | UR_TYPE_DOUBLE | double | 8 | +| ipaddr | UR_TYPE_IP | ip_addr_t | 16 | +| macaddr | UR_TYPE_MAC | mac_addr_t | 6 | +| time | UR_TYPE_TIME | ur_time_t | 8 | +| string | UR_TYPE_STRING | char | -1 (variable size) | +| bytes | UR_TYPE_BYTES | char | -1 (variable size) | + + +**Doxygen** + +[Generated documentation of API for module developers](/doc/unirec/) + +### nemea-common + +**Description** + +`nemea-common` is a collection of various functions and data structures +that are generally useful in modules. There are e.g. prefix tree, B+ tree, +hashing functions, hash table, ... + +**Doxygen** + +[Generated documentation of API for module developers](/doc/nemea-common/) + +### pytrap + +**Description** + +`pytrap` is a native module for Python 2 and 3 that wraps API of `libtrap` and `UniRec`. +It allows writing new NEMEA modules in the Python language. + +Examples can be found at [https://github.com/CESNET/Nemea-Framework/tree/master/examples/python](https://github.com/CESNET/Nemea-Framework/tree/master/examples/python) + +**Docs** + +[Generated documentation of Python API for module developers](/doc/pytrap/index.html) + +### pycommon + +**Description** + +The main part of `pycommon` is a python module `report2idea` for reporting +alerts generated by NEMEA detectors. + +There is currently no development documentation for this module. + +For user documentation of the configuration of reporter modules see [Reporting Modules and Alert Filtering](/reporting/). + +### Prepared Examples + +**C** + +* [https://github.com/CESNET/Nemea-Framework/tree/master/examples/c](https://github.com/CESNET/Nemea-Framework/tree/master/examples/c) + +**Python** + +* [https://github.com/CESNET/Nemea-Framework/tree/master/examples/python](https://github.com/CESNET/Nemea-Framework/tree/master/examples/python) + diff --git a/doc/installation.md b/doc/installation.md new file mode 100644 index 00000000..9c6fe571 --- /dev/null +++ b/doc/installation.md @@ -0,0 +1,109 @@ +--- +layout: page +title: Installation +menuentry: Installation +public: false +docmenu: true +permalink: /doc/installation/ +--- + +# Installation of NEMEA + +There are three different ways of installation of the NEMEA system covered +in this document: **vagrant**, **binary packages** and **source codes**. + + +## Vagrant + +To try the system "out-of-box", you can use [Vagrant](https://www.vagrantup.com/). +For more information see [./vagrant/](./vagrant/). + + +## Binary packages + +Latest RPM packages can be found in COPR: https://copr.fedorainfracloud.org/groups/g/CESNET/coprs/ +The NEMEA repository is at https://copr.fedorainfracloud.org/coprs/g/CESNET/NEMEA/ + +After installation of COPR repository, NEMEA can be installed as any other package (run as root/sudo): + +``` +yum install nemea +``` + +Note: Latest systems (e.g. Fedora) use `dnf` instead of `yum`. + + +For development purposes, there is `nemea-framework-devel` package that installs +all needed development files and docs. + +Currently, we do not have .deb packages (for Debian/Ubuntu/...) but we are working on it. Please follow installation from [source codes](#source-codes) + +## Source codes + +The whole system is based on GNU/Autotools build system that makes dependency checking and +building process much more easier. + +To clone the NEMEA repositories, use: + +``` +git clone --recursive https://github.com/CESNET/nemea +``` + +After successful clone and [dependencies](#dependencies) installation (**!**), use: + +``` +./bootstrap.sh +``` + +that will create `configure` scripts and other needed files. + +The `configure` script supplies various possibilities of +configuration and it uses some environmental variables that influence the build +and compilation process. For more information see: + +``` +./configure --help +``` + +We recommend to set paths according to the used operating system, e.g.: + +``` +./configure --enable-repobuild --prefix=/usr --bindir=/usr/bin/nemea --sysconfdir=/etc/nemea --libdir=/usr/lib64 +``` + +After finishing `./configure`, build process can be started by: + +``` +make +``` + +The make(1) tool has various parameters, to build the NEMEA package faster on +multicore systems, we recommend to use parameter -j with the number of jobs +that should be run in parallel. + +When the compilation process ends without any error, the package can be installed +into paths that were set by `configure`. It is recommended NOT to change +target paths by passing variables directly to make(1). +The installation can be done by (usually it requires root / sudo): + +``` +make install +``` + +Congratulations, the whole NEMEA system should be installed right now... :-) + + +# Dependencies + +RHEL/CentOS/Fedora (CentOS7 is mainly supported): +``` +yum install -y bc autoconf automake gcc gcc-c++ libtool libxml2-devel make pkg-config libpcap-devel libidn-devel bison flex +``` + +Note: Latest systems (e.g. Fedora) use `dnf` instead of `yum`. + +Debian/Ubuntu: +``` +apt-get install -y gawk bc autoconf automake gcc g++ libtool libxml2-dev make pkg-config libpcap-dev libidn11-dev bison flex +``` + diff --git a/doc/libtrap-devel/annotated.html b/doc/libtrap-devel/annotated.html new file mode 100644 index 00000000..432f5ffc --- /dev/null +++ b/doc/libtrap-devel/annotated.html @@ -0,0 +1,102 @@ + + + + + + + +Libtrap: Internal development docs: Data Structures + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + +
 Cautoflush_timeoutsList of autoflush timeouts of output interfaces
 Cbuffer_sOutput buffer structure
 Cclient_sStructure for TCP/IP IFC client information
 Cfile_buffer_s
 Cfile_private_s
 Cgenerator_private_s
 Chello_msg_header_s
 Cmsg_header_s
 Creader_threads_s
 Ctcpip_receiver_private_s
 Ctcpip_sender_private_sStructure for TCP/IP IFC private information
 Ctcpip_socket_addr
 Ctls_receiver_private_s
 Ctls_sender_private_sStructure for TLS IFC private information
 Ctls_socket_addr
 Ctlsclient_sStructure for TLS IFC client information
 Ctrap_buffer_header_s
 Ctrap_ctx_priv_s
 Ctrap_ifc_spec_s
 Ctrap_input_ifc_s
 Ctrap_output_ifc_s
+
+
+ + + + diff --git a/doc/libtrap-devel/arrowdown.png b/doc/libtrap-devel/arrowdown.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/doc/libtrap-devel/arrowdown.png differ diff --git a/doc/libtrap-devel/arrowright.png b/doc/libtrap-devel/arrowright.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/doc/libtrap-devel/arrowright.png differ diff --git a/doc/libtrap-devel/bc_s.png b/doc/libtrap-devel/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/doc/libtrap-devel/bc_s.png differ diff --git a/doc/libtrap-devel/bdwn.png b/doc/libtrap-devel/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/doc/libtrap-devel/bdwn.png differ diff --git a/doc/libtrap-devel/classes.html b/doc/libtrap-devel/classes.html new file mode 100644 index 00000000..61435a2c --- /dev/null +++ b/doc/libtrap-devel/classes.html @@ -0,0 +1,101 @@ + + + + + + + +Libtrap: Internal development docs: Data Structure Index + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Data Structure Index
+
+
+
a | b | c | f | g | h | m | r | t
+ + + + + + + + + + + + +
  a  
+
  f  
+
  m  
+
tcpip_sender_private_s   trap_ifc_spec_s   
tcpip_socket_addr   trap_input_ifc_s   
autoflush_timeouts   file_buffer_s   msg_header_s   tls_receiver_private_s   trap_output_ifc_s   
  b  
+
file_private_s   
  r  
+
tls_sender_private_s   
  g  
+
tls_socket_addr   
buffer_s   reader_threads_s   tlsclient_s   
  c  
+
generator_private_s   
  t  
+
trap_buffer_header_s   
  h  
+
trap_ctx_priv_s   
client_s   tcpip_receiver_private_s   
hello_msg_header_s   
+
a | b | c | f | g | h | m | r | t
+
+ + + + diff --git a/doc/libtrap-devel/closed.png b/doc/libtrap-devel/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/doc/libtrap-devel/closed.png differ diff --git a/doc/libtrap-devel/deprecated.html b/doc/libtrap-devel/deprecated.html new file mode 100644 index 00000000..ab5c0b8b --- /dev/null +++ b/doc/libtrap-devel/deprecated.html @@ -0,0 +1,85 @@ + + + + + + + +Libtrap: Internal development docs: Deprecated List + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Deprecated List
+
+
+
+
Global TRAP_DEFAULT_GET_DATA_ERROR_HANDLING (ret_code, timeout_cmd, error_cmd)
+
This macro should be replaced by TRAP_DEFAULT_RECV_ERROR_HANDLING.
+
Global TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING (ret_code, timeout_cmd, error_cmd)
+
This macro should be replaced by TRAP_DEFAULT_SEND_ERROR_HANDLING.
+
Global trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
+
This function should be replaced by trap_send().
+
+
+ + + + diff --git a/doc/libtrap-devel/devel-ifc.html b/doc/libtrap-devel/devel-ifc.html new file mode 100644 index 00000000..35d92b02 --- /dev/null +++ b/doc/libtrap-devel/devel-ifc.html @@ -0,0 +1,110 @@ + + + + + + + +Libtrap: Internal development docs: Development of libtrap interface + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Development of libtrap interface
+
+
+

+General information

+

There are two types of libtrap interfaces (unidirectional) — input and output. After successful initialization of libtrap (trap_ctx_init()), all interfaces are stored in libtrap context in the array trap_ctx_priv_s::in_ifc_list or trap_ctx_priv_s::out_ifc_list. That means every IFC must initialize its structure trap_input_ifc_s or trap_output_ifc_s as it is listed in Steps section below.

+

Libtrap interface (IFC) is a source code file that is compiled with the rest of libtrap. Every IFC implements functions:

+
+typedef void (*ifc_terminate_func_t)(void *);
+typedef void (*ifc_destroy_func_t)(void *);
+typedef void (*ifc_create_dump_func_t)(void *, uint32_t, const char *);
+

and one or both functions:

+
+typedef int (*ifc_recv_func_t)(void *, void *, uint32_t *, int);
+typedef int (*ifc_send_func_t)(void *, const void *, uint32_t, int);
+

The full list of required functions of IFC can be found in IFC API.

+

Additionally, IFC should implement it's own constructor function.

+

+What to do to develop IFC

+

To add new IFC into libtrap some steps should be done:

+
    +
  1. +choose new IFC type letter by defining new macro in Types of IFC.
  2. +
  3. +add new IFC type into trap_ifc_type_supported
  4. +
  5. +add call to constructor into trapifc_in_construct() resp. trapifc_out_construct() for input resp. output IFC
  6. +
  7. +write own implementation of IFC functions (IFC API)
  8. +
  9. +write own constructor of new IFC
  10. +
  11. +set pointers to functions in trap_input_ifc_s or trap_output_ifc_s, the setting of pointers should be done in IFC's constructor
  12. +
+

Simplified example of input IFC can be found in ifc_dummy.c. This file implements blackhole and generator. Blackhole is the output IFC that drops every message that is sent by module. Generator is the input IFC generates messages that are received by module.

+

More complex example is TCPIP and UNIX socket IFCs implemented in ifc_tcpip.c.

+
+ + + + diff --git a/doc/libtrap-devel/develop-interface_8txt.html b/doc/libtrap-devel/develop-interface_8txt.html new file mode 100644 index 00000000..953d1a00 --- /dev/null +++ b/doc/libtrap-devel/develop-interface_8txt.html @@ -0,0 +1,77 @@ + + + + + + + +Libtrap: Internal development docs: doc/develop-interface.txt File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
doc/develop-interface.txt File Reference
+
+
+
+ + + + diff --git a/doc/libtrap-devel/dir_000002_000000.html b/doc/libtrap-devel/dir_000002_000000.html new file mode 100644 index 00000000..0580db72 --- /dev/null +++ b/doc/libtrap-devel/dir_000002_000000.html @@ -0,0 +1,77 @@ + + + + + + + +Libtrap: Internal development docs: src -> include Relation + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+ + + + + diff --git a/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 00000000..b8ded644 --- /dev/null +++ b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,147 @@ + + + + + + + +Libtrap: Internal development docs: src Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
src Directory Reference
+
+
+
+Directory dependency graph for src:
+
+
src
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  help_trapifcspec.c [code]
 
file  ifc_dummy.c [code]
 TRAP dummy interfaces (generator and blackhole)
 
file  ifc_dummy.h [code]
 TRAP dummy interfaces (generator and blackhole)
 
file  ifc_file.c [code]
 TRAP file interfaces.
 
file  ifc_file.h [code]
 TRAP file interfaces.
 
file  ifc_socket_common.h [code]
 This file contains common functions and structures used in socket based interfaces (tcp-ip / tls).
 
file  ifc_tcpip.c [code]
 TRAP TCP/IP interfaces.
 
file  ifc_tcpip.h [code]
 TRAP TCP/IP interfaces.
 
file  ifc_tcpip_internal.h [code]
 TRAP TCP/IP interfaces private structures.
 
file  ifc_tls.c [code]
 TRAP TCP with TLS interfaces.
 
file  ifc_tls.h [code]
 
file  ifc_tls_internal.h [code]
 TRAP TCP/IP interfaces private structures.
 
file  trap.c [code]
 TRAP library base.
 
file  trap_error.c [code]
 Error handling for TRAP.
 
file  trap_error.h [code]
 Error handling for TRAP.
 
file  trap_ifc.h [code]
 Interface of TRAP interfaces.
 
file  trap_internal.c [code]
 Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
 
file  trap_internal.h [code]
 Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
 
+
+ + + + diff --git a/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map new file mode 100644 index 00000000..75fa4a3e --- /dev/null +++ b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 new file mode 100644 index 00000000..14d6c14a --- /dev/null +++ b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 @@ -0,0 +1 @@ +aaadd1261b803dafe2ae4b850e60c1fc \ No newline at end of file diff --git a/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png new file mode 100644 index 00000000..3a8e0804 Binary files /dev/null and b/doc/libtrap-devel/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png differ diff --git a/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f.html b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f.html new file mode 100644 index 00000000..bb61e218 --- /dev/null +++ b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f.html @@ -0,0 +1,88 @@ + + + + + + + +Libtrap: Internal development docs: include/libtrap Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
libtrap Directory Reference
+
+
+ + + + + +

+Files

file  trap.h [code]
 Interface of TRAP library.
 
+
+ + + + diff --git a/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.map b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.map new file mode 100644 index 00000000..d3c063a8 --- /dev/null +++ b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.md5 b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.md5 new file mode 100644 index 00000000..67afe646 --- /dev/null +++ b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.md5 @@ -0,0 +1 @@ +d71e517506a61146c940d2612c0080be \ No newline at end of file diff --git a/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.png b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.png new file mode 100644 index 00000000..c7d1ac7b Binary files /dev/null and b/doc/libtrap-devel/dir_d10f943620c8cf996cd13f7b110dc16f_dep.png differ diff --git a/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23.html b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 00000000..cac69c2f --- /dev/null +++ b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,87 @@ + + + + + + + +Libtrap: Internal development docs: include Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
include Directory Reference
+
+
+ + + + +

+Directories

directory  libtrap
 
+
+ + + + diff --git a/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.map b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.map new file mode 100644 index 00000000..4db83ec5 --- /dev/null +++ b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 new file mode 100644 index 00000000..f60d2cc7 --- /dev/null +++ b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 @@ -0,0 +1 @@ +1cdd81e6e1e166aa434242c2fcdca93a \ No newline at end of file diff --git a/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.png b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.png new file mode 100644 index 00000000..453f07b2 Binary files /dev/null and b/doc/libtrap-devel/dir_d44c64559bbebec7f509842c48db8b23_dep.png differ diff --git a/doc/libtrap-devel/doc.png b/doc/libtrap-devel/doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/doc/libtrap-devel/doc.png differ diff --git a/doc/libtrap-devel/dot_inline_dotgraph_1.png b/doc/libtrap-devel/dot_inline_dotgraph_1.png new file mode 100644 index 00000000..82a9670b Binary files /dev/null and b/doc/libtrap-devel/dot_inline_dotgraph_1.png differ diff --git a/doc/libtrap-devel/dot_inline_dotgraph_2.png b/doc/libtrap-devel/dot_inline_dotgraph_2.png new file mode 100644 index 00000000..2f135402 Binary files /dev/null and b/doc/libtrap-devel/dot_inline_dotgraph_2.png differ diff --git a/doc/libtrap-devel/doxygen.css b/doc/libtrap-devel/doxygen.css new file mode 100644 index 00000000..266c8b3a --- /dev/null +++ b/doc/libtrap-devel/doxygen.css @@ -0,0 +1,1596 @@ +/* The standard CSS for doxygen 1.8.14 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +/* +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTableHead tr { +} + +table.markdownTableBodyLeft td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft { + text-align: left +} + +th.markdownTableHeadRight { + text-align: right +} + +th.markdownTableHeadCenter { + text-align: center +} +*/ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + + +/* @end */ diff --git a/doc/libtrap-devel/doxygen.png b/doc/libtrap-devel/doxygen.png new file mode 100644 index 00000000..3ff17d80 Binary files /dev/null and b/doc/libtrap-devel/doxygen.png differ diff --git a/doc/libtrap-devel/dynsections.js b/doc/libtrap-devel/dynsections.js new file mode 100644 index 00000000..537e3e49 --- /dev/null +++ b/doc/libtrap-devel/dynsections.js @@ -0,0 +1,127 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +Libtrap: Internal development docs: File List + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + +
  include
  libtrap
 trap.hInterface of TRAP library
  src
 help_trapifcspec.c
 ifc_dummy.cTRAP dummy interfaces (generator and blackhole)
 ifc_dummy.hTRAP dummy interfaces (generator and blackhole)
 ifc_file.cTRAP file interfaces
 ifc_file.hTRAP file interfaces
 ifc_socket_common.hThis file contains common functions and structures used in socket based interfaces (tcp-ip / tls)
 ifc_tcpip.cTRAP TCP/IP interfaces
 ifc_tcpip.hTRAP TCP/IP interfaces
 ifc_tcpip_internal.hTRAP TCP/IP interfaces private structures
 ifc_tls.cTRAP TCP with TLS interfaces
 ifc_tls.h
 ifc_tls_internal.hTRAP TCP/IP interfaces private structures
 trap.cTRAP library base
 trap_error.cError handling for TRAP
 trap_error.hError handling for TRAP
 trap_ifc.hInterface of TRAP interfaces
 trap_internal.cInternal functions and macros for libtrap Verbose and debug macros from libcommlbr
 trap_internal.hInternal functions and macros for libtrap Verbose and debug macros from libcommlbr
+
+
+ + + + diff --git a/doc/libtrap-devel/folderclosed.png b/doc/libtrap-devel/folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/doc/libtrap-devel/folderclosed.png differ diff --git a/doc/libtrap-devel/folderopen.png b/doc/libtrap-devel/folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/doc/libtrap-devel/folderopen.png differ diff --git a/doc/libtrap-devel/ftv2blank.png b/doc/libtrap-devel/ftv2blank.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/doc/libtrap-devel/ftv2blank.png differ diff --git a/doc/libtrap-devel/ftv2cl.png b/doc/libtrap-devel/ftv2cl.png new file mode 100644 index 00000000..132f6577 Binary files /dev/null and b/doc/libtrap-devel/ftv2cl.png differ diff --git a/doc/libtrap-devel/ftv2doc.png b/doc/libtrap-devel/ftv2doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/doc/libtrap-devel/ftv2doc.png differ diff --git a/doc/libtrap-devel/ftv2folderclosed.png b/doc/libtrap-devel/ftv2folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/doc/libtrap-devel/ftv2folderclosed.png differ diff --git a/doc/libtrap-devel/ftv2folderopen.png b/doc/libtrap-devel/ftv2folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/doc/libtrap-devel/ftv2folderopen.png differ diff --git a/doc/libtrap-devel/ftv2lastnode.png b/doc/libtrap-devel/ftv2lastnode.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/doc/libtrap-devel/ftv2lastnode.png differ diff --git a/doc/libtrap-devel/ftv2link.png b/doc/libtrap-devel/ftv2link.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/doc/libtrap-devel/ftv2link.png differ diff --git a/doc/libtrap-devel/ftv2mlastnode.png b/doc/libtrap-devel/ftv2mlastnode.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/doc/libtrap-devel/ftv2mlastnode.png differ diff --git a/doc/libtrap-devel/ftv2mnode.png b/doc/libtrap-devel/ftv2mnode.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/doc/libtrap-devel/ftv2mnode.png differ diff --git a/doc/libtrap-devel/ftv2mo.png b/doc/libtrap-devel/ftv2mo.png new file mode 100644 index 00000000..4bfb80f7 Binary files /dev/null and b/doc/libtrap-devel/ftv2mo.png differ diff --git a/doc/libtrap-devel/ftv2node.png b/doc/libtrap-devel/ftv2node.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/doc/libtrap-devel/ftv2node.png differ diff --git a/doc/libtrap-devel/ftv2ns.png b/doc/libtrap-devel/ftv2ns.png new file mode 100644 index 00000000..72e3d71c Binary files /dev/null and b/doc/libtrap-devel/ftv2ns.png differ diff --git a/doc/libtrap-devel/ftv2plastnode.png b/doc/libtrap-devel/ftv2plastnode.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/doc/libtrap-devel/ftv2plastnode.png differ diff --git a/doc/libtrap-devel/ftv2pnode.png b/doc/libtrap-devel/ftv2pnode.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/doc/libtrap-devel/ftv2pnode.png differ diff --git a/doc/libtrap-devel/ftv2splitbar.png b/doc/libtrap-devel/ftv2splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/doc/libtrap-devel/ftv2splitbar.png differ diff --git a/doc/libtrap-devel/ftv2vertline.png b/doc/libtrap-devel/ftv2vertline.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/doc/libtrap-devel/ftv2vertline.png differ diff --git a/doc/libtrap-devel/functions.html b/doc/libtrap-devel/functions.html new file mode 100644 index 00000000..db72d2a7 --- /dev/null +++ b/doc/libtrap-devel/functions.html @@ -0,0 +1,93 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- a -

+
+ + + + diff --git a/doc/libtrap-devel/functions_b.html b/doc/libtrap-devel/functions_b.html new file mode 100644 index 00000000..d092673d --- /dev/null +++ b/doc/libtrap-devel/functions_b.html @@ -0,0 +1,106 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- b -

+
+ + + + diff --git a/doc/libtrap-devel/functions_c.html b/doc/libtrap-devel/functions_c.html new file mode 100644 index 00000000..b544ff24 --- /dev/null +++ b/doc/libtrap-devel/functions_c.html @@ -0,0 +1,162 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- c -

+
+ + + + diff --git a/doc/libtrap-devel/functions_d.html b/doc/libtrap-devel/functions_d.html new file mode 100644 index 00000000..d18c5dfc --- /dev/null +++ b/doc/libtrap-devel/functions_d.html @@ -0,0 +1,135 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- d -

+
+ + + + diff --git a/doc/libtrap-devel/functions_e.html b/doc/libtrap-devel/functions_e.html new file mode 100644 index 00000000..92273872 --- /dev/null +++ b/doc/libtrap-devel/functions_e.html @@ -0,0 +1,91 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- e -

+
+ + + + diff --git a/doc/libtrap-devel/functions_f.html b/doc/libtrap-devel/functions_f.html new file mode 100644 index 00000000..d4bf7572 --- /dev/null +++ b/doc/libtrap-devel/functions_f.html @@ -0,0 +1,107 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- f -

+
+ + + + diff --git a/doc/libtrap-devel/functions_g.html b/doc/libtrap-devel/functions_g.html new file mode 100644 index 00000000..d7d35077 --- /dev/null +++ b/doc/libtrap-devel/functions_g.html @@ -0,0 +1,90 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- g -

+
+ + + + diff --git a/doc/libtrap-devel/functions_h.html b/doc/libtrap-devel/functions_h.html new file mode 100644 index 00000000..21af6bbc --- /dev/null +++ b/doc/libtrap-devel/functions_h.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- h -

+
+ + + + diff --git a/doc/libtrap-devel/functions_i.html b/doc/libtrap-devel/functions_i.html new file mode 100644 index 00000000..f2beb78c --- /dev/null +++ b/doc/libtrap-devel/functions_i.html @@ -0,0 +1,128 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- i -

+
+ + + + diff --git a/doc/libtrap-devel/functions_k.html b/doc/libtrap-devel/functions_k.html new file mode 100644 index 00000000..9c0b11f7 --- /dev/null +++ b/doc/libtrap-devel/functions_k.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- k -

+
+ + + + diff --git a/doc/libtrap-devel/functions_l.html b/doc/libtrap-devel/functions_l.html new file mode 100644 index 00000000..de66fab3 --- /dev/null +++ b/doc/libtrap-devel/functions_l.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- l -

+
+ + + + diff --git a/doc/libtrap-devel/functions_m.html b/doc/libtrap-devel/functions_m.html new file mode 100644 index 00000000..ef259394 --- /dev/null +++ b/doc/libtrap-devel/functions_m.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- m -

+
+ + + + diff --git a/doc/libtrap-devel/functions_n.html b/doc/libtrap-devel/functions_n.html new file mode 100644 index 00000000..6da403ec --- /dev/null +++ b/doc/libtrap-devel/functions_n.html @@ -0,0 +1,86 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- n -

+
+ + + + diff --git a/doc/libtrap-devel/functions_o.html b/doc/libtrap-devel/functions_o.html new file mode 100644 index 00000000..d2c36e42 --- /dev/null +++ b/doc/libtrap-devel/functions_o.html @@ -0,0 +1,80 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- o -

+
+ + + + diff --git a/doc/libtrap-devel/functions_p.html b/doc/libtrap-devel/functions_p.html new file mode 100644 index 00000000..030e1104 --- /dev/null +++ b/doc/libtrap-devel/functions_p.html @@ -0,0 +1,91 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- p -

+
+ + + + diff --git a/doc/libtrap-devel/functions_r.html b/doc/libtrap-devel/functions_r.html new file mode 100644 index 00000000..e8caab63 --- /dev/null +++ b/doc/libtrap-devel/functions_r.html @@ -0,0 +1,89 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- r -

+
+ + + + diff --git a/doc/libtrap-devel/functions_s.html b/doc/libtrap-devel/functions_s.html new file mode 100644 index 00000000..5ec3965e --- /dev/null +++ b/doc/libtrap-devel/functions_s.html @@ -0,0 +1,126 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- s -

+
+ + + + diff --git a/doc/libtrap-devel/functions_t.html b/doc/libtrap-devel/functions_t.html new file mode 100644 index 00000000..6eff6f91 --- /dev/null +++ b/doc/libtrap-devel/functions_t.html @@ -0,0 +1,130 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- t -

+
+ + + + diff --git a/doc/libtrap-devel/functions_u.html b/doc/libtrap-devel/functions_u.html new file mode 100644 index 00000000..47bc3604 --- /dev/null +++ b/doc/libtrap-devel/functions_u.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- u -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars.html b/doc/libtrap-devel/functions_vars.html new file mode 100644 index 00000000..e8416f67 --- /dev/null +++ b/doc/libtrap-devel/functions_vars.html @@ -0,0 +1,93 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- a -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_b.html b/doc/libtrap-devel/functions_vars_b.html new file mode 100644 index 00000000..92b1967c --- /dev/null +++ b/doc/libtrap-devel/functions_vars_b.html @@ -0,0 +1,106 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- b -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_c.html b/doc/libtrap-devel/functions_vars_c.html new file mode 100644 index 00000000..3ab103af --- /dev/null +++ b/doc/libtrap-devel/functions_vars_c.html @@ -0,0 +1,162 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- c -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_d.html b/doc/libtrap-devel/functions_vars_d.html new file mode 100644 index 00000000..8dbbce9f --- /dev/null +++ b/doc/libtrap-devel/functions_vars_d.html @@ -0,0 +1,135 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- d -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_e.html b/doc/libtrap-devel/functions_vars_e.html new file mode 100644 index 00000000..ba7a7c3f --- /dev/null +++ b/doc/libtrap-devel/functions_vars_e.html @@ -0,0 +1,91 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- e -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_f.html b/doc/libtrap-devel/functions_vars_f.html new file mode 100644 index 00000000..bfa5cd3d --- /dev/null +++ b/doc/libtrap-devel/functions_vars_f.html @@ -0,0 +1,107 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- f -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_g.html b/doc/libtrap-devel/functions_vars_g.html new file mode 100644 index 00000000..685f12d3 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_g.html @@ -0,0 +1,90 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- g -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_h.html b/doc/libtrap-devel/functions_vars_h.html new file mode 100644 index 00000000..68ed7678 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_h.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- h -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_i.html b/doc/libtrap-devel/functions_vars_i.html new file mode 100644 index 00000000..636de20c --- /dev/null +++ b/doc/libtrap-devel/functions_vars_i.html @@ -0,0 +1,128 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + + + + + diff --git a/doc/libtrap-devel/functions_vars_k.html b/doc/libtrap-devel/functions_vars_k.html new file mode 100644 index 00000000..c86d9ef0 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_k.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- k -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_l.html b/doc/libtrap-devel/functions_vars_l.html new file mode 100644 index 00000000..cfba9980 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_l.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + + + + + diff --git a/doc/libtrap-devel/functions_vars_m.html b/doc/libtrap-devel/functions_vars_m.html new file mode 100644 index 00000000..510a04f7 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_m.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- m -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_n.html b/doc/libtrap-devel/functions_vars_n.html new file mode 100644 index 00000000..b2f50f16 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_n.html @@ -0,0 +1,86 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- n -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_o.html b/doc/libtrap-devel/functions_vars_o.html new file mode 100644 index 00000000..f77d526d --- /dev/null +++ b/doc/libtrap-devel/functions_vars_o.html @@ -0,0 +1,80 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- o -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_p.html b/doc/libtrap-devel/functions_vars_p.html new file mode 100644 index 00000000..2e62d585 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_p.html @@ -0,0 +1,91 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- p -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_r.html b/doc/libtrap-devel/functions_vars_r.html new file mode 100644 index 00000000..2a4d1ee5 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_r.html @@ -0,0 +1,89 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- r -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_s.html b/doc/libtrap-devel/functions_vars_s.html new file mode 100644 index 00000000..7be32e63 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_s.html @@ -0,0 +1,126 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- s -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_t.html b/doc/libtrap-devel/functions_vars_t.html new file mode 100644 index 00000000..7c952c27 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_t.html @@ -0,0 +1,130 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- t -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_u.html b/doc/libtrap-devel/functions_vars_u.html new file mode 100644 index 00000000..5e7f7eea --- /dev/null +++ b/doc/libtrap-devel/functions_vars_u.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- u -

+
+ + + + diff --git a/doc/libtrap-devel/functions_vars_w.html b/doc/libtrap-devel/functions_vars_w.html new file mode 100644 index 00000000..a28db4f9 --- /dev/null +++ b/doc/libtrap-devel/functions_vars_w.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- w -

+
+ + + + diff --git a/doc/libtrap-devel/functions_w.html b/doc/libtrap-devel/functions_w.html new file mode 100644 index 00000000..88c92a36 --- /dev/null +++ b/doc/libtrap-devel/functions_w.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- w -

+
+ + + + diff --git a/doc/libtrap-devel/globals.html b/doc/libtrap-devel/globals.html new file mode 100644 index 00000000..5d44d516 --- /dev/null +++ b/doc/libtrap-devel/globals.html @@ -0,0 +1,112 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- _ -

+
+ + + + diff --git a/doc/libtrap-devel/globals_a.html b/doc/libtrap-devel/globals_a.html new file mode 100644 index 00000000..31cf6c8d --- /dev/null +++ b/doc/libtrap-devel/globals_a.html @@ -0,0 +1,88 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- a -

+
+ + + + diff --git a/doc/libtrap-devel/globals_b.html b/doc/libtrap-devel/globals_b.html new file mode 100644 index 00000000..9a98b109 --- /dev/null +++ b/doc/libtrap-devel/globals_b.html @@ -0,0 +1,107 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- b -

+
+ + + + diff --git a/doc/libtrap-devel/globals_c.html b/doc/libtrap-devel/globals_c.html new file mode 100644 index 00000000..e38dae44 --- /dev/null +++ b/doc/libtrap-devel/globals_c.html @@ -0,0 +1,154 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- c -

+
+ + + + diff --git a/doc/libtrap-devel/globals_d.html b/doc/libtrap-devel/globals_d.html new file mode 100644 index 00000000..1306488d --- /dev/null +++ b/doc/libtrap-devel/globals_d.html @@ -0,0 +1,118 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- d -

+
+ + + + diff --git a/doc/libtrap-devel/globals_defs.html b/doc/libtrap-devel/globals_defs.html new file mode 100644 index 00000000..ed8abbe3 --- /dev/null +++ b/doc/libtrap-devel/globals_defs.html @@ -0,0 +1,446 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- x -

+
+ + + + diff --git a/doc/libtrap-devel/globals_e.html b/doc/libtrap-devel/globals_e.html new file mode 100644 index 00000000..b4c5311d --- /dev/null +++ b/doc/libtrap-devel/globals_e.html @@ -0,0 +1,86 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- e -

+
+ + + + diff --git a/doc/libtrap-devel/globals_enum.html b/doc/libtrap-devel/globals_enum.html new file mode 100644 index 00000000..fbe30b7a --- /dev/null +++ b/doc/libtrap-devel/globals_enum.html @@ -0,0 +1,93 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/libtrap-devel/globals_eval.html b/doc/libtrap-devel/globals_eval.html new file mode 100644 index 00000000..0d91288f --- /dev/null +++ b/doc/libtrap-devel/globals_eval.html @@ -0,0 +1,141 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/libtrap-devel/globals_f.html b/doc/libtrap-devel/globals_f.html new file mode 100644 index 00000000..29c23aab --- /dev/null +++ b/doc/libtrap-devel/globals_f.html @@ -0,0 +1,142 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- f -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func.html b/doc/libtrap-devel/globals_func.html new file mode 100644 index 00000000..56cb6b53 --- /dev/null +++ b/doc/libtrap-devel/globals_func.html @@ -0,0 +1,105 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- _ -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_a.html b/doc/libtrap-devel/globals_func_a.html new file mode 100644 index 00000000..531f6363 --- /dev/null +++ b/doc/libtrap-devel/globals_func_a.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- a -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_b.html b/doc/libtrap-devel/globals_func_b.html new file mode 100644 index 00000000..ba98f03c --- /dev/null +++ b/doc/libtrap-devel/globals_func_b.html @@ -0,0 +1,98 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- b -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_c.html b/doc/libtrap-devel/globals_func_c.html new file mode 100644 index 00000000..826525ef --- /dev/null +++ b/doc/libtrap-devel/globals_func_c.html @@ -0,0 +1,129 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- c -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_d.html b/doc/libtrap-devel/globals_func_d.html new file mode 100644 index 00000000..42e3c849 --- /dev/null +++ b/doc/libtrap-devel/globals_func_d.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- d -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_e.html b/doc/libtrap-devel/globals_func_e.html new file mode 100644 index 00000000..d68625f9 --- /dev/null +++ b/doc/libtrap-devel/globals_func_e.html @@ -0,0 +1,80 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- e -

    +
  • encode_cnts_to_json() +: trap.c +
  • +
+
+ + + + diff --git a/doc/libtrap-devel/globals_func_f.html b/doc/libtrap-devel/globals_func_f.html new file mode 100644 index 00000000..d3ed4120 --- /dev/null +++ b/doc/libtrap-devel/globals_func_f.html @@ -0,0 +1,118 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- f -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_g.html b/doc/libtrap-devel/globals_func_g.html new file mode 100644 index 00000000..37d666a3 --- /dev/null +++ b/doc/libtrap-devel/globals_func_g.html @@ -0,0 +1,113 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- g -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_h.html b/doc/libtrap-devel/globals_func_h.html new file mode 100644 index 00000000..c6a03950 --- /dev/null +++ b/doc/libtrap-devel/globals_func_h.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- h -

    +
  • handle_inifc_setters() +: trap.c +
  • +
  • handle_outifc_setters() +: trap.c +
  • +
+
+ + + + diff --git a/doc/libtrap-devel/globals_func_i.html b/doc/libtrap-devel/globals_func_i.html new file mode 100644 index 00000000..6062bd4f --- /dev/null +++ b/doc/libtrap-devel/globals_func_i.html @@ -0,0 +1,85 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- i -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_o.html b/doc/libtrap-devel/globals_func_o.html new file mode 100644 index 00000000..93222948 --- /dev/null +++ b/doc/libtrap-devel/globals_func_o.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- o -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_p.html b/doc/libtrap-devel/globals_func_p.html new file mode 100644 index 00000000..f775d716 --- /dev/null +++ b/doc/libtrap-devel/globals_func_p.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- p -

    +
  • print_aligned() +: trap.c +
  • +
  • print_aligned_multiline() +: trap.c +
  • +
+
+ + + + diff --git a/doc/libtrap-devel/globals_func_r.html b/doc/libtrap-devel/globals_func_r.html new file mode 100644 index 00000000..f91d5d83 --- /dev/null +++ b/doc/libtrap-devel/globals_func_r.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- r -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_s.html b/doc/libtrap-devel/globals_func_s.html new file mode 100644 index 00000000..47f79812 --- /dev/null +++ b/doc/libtrap-devel/globals_func_s.html @@ -0,0 +1,107 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- s -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_t.html b/doc/libtrap-devel/globals_func_t.html new file mode 100644 index 00000000..6d6a767f --- /dev/null +++ b/doc/libtrap-devel/globals_func_t.html @@ -0,0 +1,398 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- t -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_v.html b/doc/libtrap-devel/globals_func_v.html new file mode 100644 index 00000000..f37e7356 --- /dev/null +++ b/doc/libtrap-devel/globals_func_v.html @@ -0,0 +1,80 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- v -

+
+ + + + diff --git a/doc/libtrap-devel/globals_func_w.html b/doc/libtrap-devel/globals_func_w.html new file mode 100644 index 00000000..55d157a8 --- /dev/null +++ b/doc/libtrap-devel/globals_func_w.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- w -

+
+ + + + diff --git a/doc/libtrap-devel/globals_g.html b/doc/libtrap-devel/globals_g.html new file mode 100644 index 00000000..645af667 --- /dev/null +++ b/doc/libtrap-devel/globals_g.html @@ -0,0 +1,116 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- g -

+
+ + + + diff --git a/doc/libtrap-devel/globals_h.html b/doc/libtrap-devel/globals_h.html new file mode 100644 index 00000000..f7b15d73 --- /dev/null +++ b/doc/libtrap-devel/globals_h.html @@ -0,0 +1,86 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- h -

+
+ + + + diff --git a/doc/libtrap-devel/globals_i.html b/doc/libtrap-devel/globals_i.html new file mode 100644 index 00000000..9404815e --- /dev/null +++ b/doc/libtrap-devel/globals_i.html @@ -0,0 +1,127 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- i -

+
+ + + + diff --git a/doc/libtrap-devel/globals_l.html b/doc/libtrap-devel/globals_l.html new file mode 100644 index 00000000..9e23f0cc --- /dev/null +++ b/doc/libtrap-devel/globals_l.html @@ -0,0 +1,80 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- l -

+
+ + + + diff --git a/doc/libtrap-devel/globals_m.html b/doc/libtrap-devel/globals_m.html new file mode 100644 index 00000000..b6f3b890 --- /dev/null +++ b/doc/libtrap-devel/globals_m.html @@ -0,0 +1,107 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- m -

+
+ + + + diff --git a/doc/libtrap-devel/globals_n.html b/doc/libtrap-devel/globals_n.html new file mode 100644 index 00000000..850ef9f2 --- /dev/null +++ b/doc/libtrap-devel/globals_n.html @@ -0,0 +1,104 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- n -

+
+ + + + diff --git a/doc/libtrap-devel/globals_o.html b/doc/libtrap-devel/globals_o.html new file mode 100644 index 00000000..eccf876d --- /dev/null +++ b/doc/libtrap-devel/globals_o.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- o -

+
+ + + + diff --git a/doc/libtrap-devel/globals_p.html b/doc/libtrap-devel/globals_p.html new file mode 100644 index 00000000..8d989141 --- /dev/null +++ b/doc/libtrap-devel/globals_p.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- p -

    +
  • print_aligned() +: trap.c +
  • +
  • print_aligned_multiline() +: trap.c +
  • +
+
+ + + + diff --git a/doc/libtrap-devel/globals_r.html b/doc/libtrap-devel/globals_r.html new file mode 100644 index 00000000..a9c37c73 --- /dev/null +++ b/doc/libtrap-devel/globals_r.html @@ -0,0 +1,88 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- r -

+
+ + + + diff --git a/doc/libtrap-devel/globals_s.html b/doc/libtrap-devel/globals_s.html new file mode 100644 index 00000000..684e0048 --- /dev/null +++ b/doc/libtrap-devel/globals_s.html @@ -0,0 +1,125 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- s -

+
+ + + + diff --git a/doc/libtrap-devel/globals_t.html b/doc/libtrap-devel/globals_t.html new file mode 100644 index 00000000..98d75fcd --- /dev/null +++ b/doc/libtrap-devel/globals_t.html @@ -0,0 +1,690 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- t -

+
+ + + + diff --git a/doc/libtrap-devel/globals_type.html b/doc/libtrap-devel/globals_type.html new file mode 100644 index 00000000..a2030ad7 --- /dev/null +++ b/doc/libtrap-devel/globals_type.html @@ -0,0 +1,165 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/libtrap-devel/globals_u.html b/doc/libtrap-devel/globals_u.html new file mode 100644 index 00000000..0ff99c3b --- /dev/null +++ b/doc/libtrap-devel/globals_u.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- u -

+
+ + + + diff --git a/doc/libtrap-devel/globals_v.html b/doc/libtrap-devel/globals_v.html new file mode 100644 index 00000000..4392eb6a --- /dev/null +++ b/doc/libtrap-devel/globals_v.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- v -

+
+ + + + diff --git a/doc/libtrap-devel/globals_vars.html b/doc/libtrap-devel/globals_vars.html new file mode 100644 index 00000000..060dc8b2 --- /dev/null +++ b/doc/libtrap-devel/globals_vars.html @@ -0,0 +1,143 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/libtrap-devel/globals_w.html b/doc/libtrap-devel/globals_w.html new file mode 100644 index 00000000..c67a04d4 --- /dev/null +++ b/doc/libtrap-devel/globals_w.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- w -

+
+ + + + diff --git a/doc/libtrap-devel/globals_x.html b/doc/libtrap-devel/globals_x.html new file mode 100644 index 00000000..c10f6c1d --- /dev/null +++ b/doc/libtrap-devel/globals_x.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: Globals + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- x -

+
+ + + + diff --git a/doc/libtrap-devel/graph_legend.html b/doc/libtrap-devel/graph_legend.html new file mode 100644 index 00000000..b9ae1ec1 --- /dev/null +++ b/doc/libtrap-devel/graph_legend.html @@ -0,0 +1,106 @@ + + + + + + + +Libtrap: Internal development docs: Graph Legend + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Graph Legend
+
+
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };
/* Class not documented with doxygen comments */
class Undocumented { };
/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };
/*! A template class */
template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */
class ProtectedBase { };
/*! Class that is inherited using private inheritance */
class PrivateBase { };
/*! Class that is used by the Inherited class */
class Used { };
/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};

This will result in the following graph:

+
+ +
+

The boxes in the above graph have the following meaning:

+
    +
  • +A filled gray box represents the struct or class for which the graph is generated.
  • +
  • +A box with a black border denotes a documented struct or class.
  • +
  • +A box with a gray border denotes an undocumented struct or class.
  • +
  • +A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
  • +
+

The arrows have the following meaning:

+
    +
  • +A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • +
  • +A dark green arrow is used for protected inheritance.
  • +
  • +A dark red arrow is used for private inheritance.
  • +
  • +A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
  • +
  • +A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.
  • +
+
+ + + + diff --git a/doc/libtrap-devel/graph_legend.md5 b/doc/libtrap-devel/graph_legend.md5 new file mode 100644 index 00000000..a06ed050 --- /dev/null +++ b/doc/libtrap-devel/graph_legend.md5 @@ -0,0 +1 @@ +387ff8eb65306fa251338d3c9bd7bfff \ No newline at end of file diff --git a/doc/libtrap-devel/graph_legend.png b/doc/libtrap-devel/graph_legend.png new file mode 100644 index 00000000..cdeec3ad Binary files /dev/null and b/doc/libtrap-devel/graph_legend.png differ diff --git a/doc/libtrap-devel/group__buffering.html b/doc/libtrap-devel/group__buffering.html new file mode 100644 index 00000000..c4d077d1 --- /dev/null +++ b/doc/libtrap-devel/group__buffering.html @@ -0,0 +1,197 @@ + + + + + + + +Libtrap: Internal development docs: Buffering sublayer + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Buffering sublayer
+
+
+ + + + + + + +

+Functions

int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
static int trap_read_from_buffer (trap_ctx_priv_t *ctx, uint32_t ifc_idx, const void **data, uint16_t *size, int timeout)
 
+

Detailed Description

+

Function Documentation

+ +

◆ trap_check_buffer_content()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_check_buffer_content (void * buffer,
uint32_t buffer_size 
)
+
+ +

Check content of buffer, iterate over message headers.

+
Parameters
+ + + +
[in]bufferstart of buffer
[in]buffer_sizesize of buffer
+
+
+
Returns
0 on success, number of errors otherwise
+ +

Definition at line 222 of file trap.c.

+ +
+
+ +

◆ trap_read_from_buffer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int trap_read_from_buffer (trap_ctx_priv_tctx,
uint32_t ifc_idx,
const void ** data,
uint16_t * size,
int timeout 
)
+
+inlinestatic
+
+

Read data from buffer or receive data into buffer if buffer is empty

+
Parameters
+ + + + + + +
[in,out]ctxpointer to the private libtrap context data (trap_ctx_init())
[in]ifc_idxindex of input interface
[out]datapointer to received message
[out]sizesize of message
[in]timeoutTRAP_WAIT | TRAP_NO_WAIT | timeout
+
+
+ +

Definition at line 253 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__commonapi.html b/doc/libtrap-devel/group__commonapi.html new file mode 100644 index 00000000..68fb0590 --- /dev/null +++ b/doc/libtrap-devel/group__commonapi.html @@ -0,0 +1,575 @@ + + + + + + + +Libtrap: Internal development docs: Common libtrap API + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Common libtrap API
+
+
+
+Collaboration diagram for Common libtrap API:
+
+
+ + + + + + +
+
+ + + + + + + + + + +

+Modules

 Error codes
 
 TRAP Timeout
 
 Specifier of TRAP interfaces
 
 Message format
 
+ + + +

+Data Structures

struct  trap_ifc_spec_s
 
+ + + + +

+Macros

#define TRAP_IFC_MESSAGEQ_SIZE   100000
 size of message queue used for buffering More...
 
+ + + +

+Typedefs

typedef struct trap_ifc_spec_s trap_ifc_spec_t
 
+ + + + + + + + + + + + + + + + + +

+Functions

const char * trap_get_type_and_name_from_string (const char *source, const char **name, const char **type, int *length_name, int *length_type)
 
int trap_ctx_cmp_data_fmt (const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
 
void * trap_get_global_ctx ()
 
int trap_get_in_ifc_state (uint32_t ifc_idx)
 
int trap_parse_params (int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
 
char * trap_get_param_by_delimiter (const char *source, char **dest, const char delimiter)
 Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter. More...
 
int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
+ + + + + + + +

+Variables

const char trap_version []
 
const char trap_git_version [] = GIT_VERSION
 
char * trap_default_socket_path_format
 
+ + + +

+TRAP interface control request

enum  trap_ifcctl_request { TRAPCTL_AUTOFLUSH_TIMEOUT = 1, +TRAPCTL_BUFFERSWITCH = 2, +TRAPCTL_SETTIMEOUT = 3 + }
 
+

Detailed Description

+

This module declares basic public constants, structures and functions of libtrap.

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_MESSAGEQ_SIZE

+ +
+
+ + + + +
#define TRAP_IFC_MESSAGEQ_SIZE   100000
+
+ +

size of message queue used for buffering

+ +

Definition at line 206 of file trap.h.

+ +
+
+

Typedef Documentation

+ +

◆ trap_ifc_spec_t

+ +
+
+ + + + +
typedef struct trap_ifc_spec_s trap_ifc_spec_t
+
+

Structure with specification of interface types and their parameters. This can be filled by command-line parameters using trap_parse_params function.

+ +
+
+

Enumeration Type Documentation

+ +

◆ trap_ifcctl_request

+ +
+
+ + + + +
enum trap_ifcctl_request
+
+ + + + +
Enumerator
TRAPCTL_AUTOFLUSH_TIMEOUT 

Set timeout of automatic buffer flushing for interface, expects uint64_t argument with number of microseconds. It can be set to TRAP_NO_AUTO_FLUSH to disable autoflush.

+
TRAPCTL_BUFFERSWITCH 

Enable/disable buffering - could be dangerous on input interface!!! expects char argument with value 1 (default value after libtrap initialization - enabled) or 0 (for disabling buffering on interface).

+
TRAPCTL_SETTIMEOUT 

Set interface timeout (int32_t): in microseconds for non-blocking mode; timeout can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.

+
+ +

Definition at line 198 of file trap.h.

+ +
+
+

Function Documentation

+ +

◆ trap_check_buffer_content()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_check_buffer_content (void * buffer,
uint32_t buffer_size 
)
+
+ +

Check content of buffer, iterate over message headers.

+
Parameters
+ + + +
[in]bufferstart of buffer
[in]buffer_sizesize of buffer
+
+
+
Returns
0 on success, number of errors otherwise
+ +

Definition at line 222 of file trap.c.

+ +
+
+ +

◆ trap_ctx_cmp_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_cmp_data_fmt (const char * sender_ifc_data_fmt,
const char * receiver_ifc_data_fmt 
)
+
+

Compares sender_ifc template and receiver_ifc template and returns whether receivers template is subset of the senders template.

+
Parameters
+ + + +
[in]sender_ifc_data_fmtsender_ifc template (char *)
[in]receiver_ifc_data_fmtreceiver_ifc template (char *)
+
+
+
Returns
TRAP_E_OK on success (receivers template is subset of the senders template), TRAP_E_FIELDS_MISMATCH (receivers template has field which is not in senders template).
+ +

Definition at line 2765 of file trap.c.

+ +
+
+ +

◆ trap_get_global_ctx()

+ +
+
+ + + + + + + +
void* trap_get_global_ctx ()
+
+

Returns global context.

+
Returns
pointer to global context.
+ +

Definition at line 2820 of file trap.c.

+ +
+
+ +

◆ trap_get_in_ifc_state()

+ +
+
+ + + + + + + + +
int trap_get_in_ifc_state (uint32_t ifc_idx)
+
+

Returns current state of an input interface on specified index.

+
Parameters
+ + +
[in]ifc_idxIndex of the input interface
+
+
+
Returns
See trap_ctx_get_in_ifc_state().
+ +

Definition at line 2734 of file trap.c.

+ +
+
+ +

◆ trap_get_param_by_delimiter()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
char* trap_get_param_by_delimiter (const char * source,
char ** dest,
const char delimiter 
)
+
+ +

Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter.

+
Parameters
+ + + + +
[in]sourcesource string, typically params
[out]destdestination string, target of first paramater copying
[in]delimiterseparator of values in params
+
+
+
Returns
Pointer to the start of following parameter (char after delimiter).
+
Note
If NULL, no other parameter is present or error during allocation occured.
+
Parameters
+ + + + +
[in]sourcesource string, typically params
[out]destdestination string, target of first parameter copying
[in]delimiterseparator of values in params
+
+
+
Returns
Pointer to the start of following parameter (char after delimiter).
+
Note
If NULL, no other parameter is present or error during allocation occured.
+ +

Definition at line 1160 of file trap.c.

+ +
+
+ +

◆ trap_get_type_and_name_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char* trap_get_type_and_name_from_string (const char * source,
const char ** name,
const char ** type,
int * length_name,
int * length_type 
)
+
+

Parse Fields name and types from string.

+

Function parses the source string and sets the given pointers (pointers to source string). Than it sets length of name and type

+
Parameters
+ + + + + + +
[in]sourceSource string to parse.
[in]nameouput parameter, where will be set the pointer to name of a field (pointer to source string).
[in]typeouput parameter, where will be set the pointer to type of a field (pointer to source string).
[in]length_nameouput parameter, where will be set the length of a name.
[in]length_typeouput parameter, where will be set the length of a type.
+
+
+
Returns
pointer to source string, moved to next field
+ +

Definition at line 2739 of file trap.c.

+ +
+
+ +

◆ trap_parse_params()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_parse_params (int * argc,
char ** argv,
trap_ifc_spec_tifc_spec 
)
+
+

Parse command-line arguments. Extract arguments needed by TRAP to set up interfaces (-i params), verbosity level (-v/-vv/-vvv) and return the rest (argc and argv are modified, i.e. processed parameter is removed). Extracted information is stored into ifc_spec. These variables should be passed to trap_init. Data in ifc_spec must be freed by trap_free_ifc_spec. If help is requested (-h/–help) TRAP_E_HELP is returned (argc and argv are modified also).

Parameters
+ + + + +
[in,out]argcPointer to number of command-line arguments.
[in,out]argvCommand-line arguments.
[out]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Error code (0 on success)
+

Initialization function. Create and initialize all interfaces. This function parses command-line arguments; it extracts arguments it needs to set up interfaces and returns the rest (argc and argv are modified).

Parameters
+ + + + +
[in,out]argcPointer to number of command-line arguments.
[in,out]argvCommand-line arguments.
[out]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Error code (0 on success)
+ +

Definition at line 339 of file trap.c.

+ +
+
+

Variable Documentation

+ +

◆ trap_default_socket_path_format

+ +
+
+ + + + +
char* trap_default_socket_path_format
+
+

Text string with default path format to sockets (UNIX IFC and service IFC). Assigned in ifc_tcpip.h

+ +
+
+ +

◆ trap_git_version

+ +
+
+ + + + + + + +
const char trap_git_version () = GIT_VERSION
+
+

Text string with Git revision of libtrap.

+

Git revision of libtrap

+

Used from config.h that is generated by the configure script.

+ +
+
+ +

◆ trap_version

+ +
+
+ + + + +
const char trap_version[]
+
+

Text string with libtrap version.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__commonapi.map b/doc/libtrap-devel/group__commonapi.map new file mode 100644 index 00000000..36b16505 --- /dev/null +++ b/doc/libtrap-devel/group__commonapi.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/libtrap-devel/group__commonapi.md5 b/doc/libtrap-devel/group__commonapi.md5 new file mode 100644 index 00000000..0b57e50f --- /dev/null +++ b/doc/libtrap-devel/group__commonapi.md5 @@ -0,0 +1 @@ +9c40a818bacffd6b3fc10f27bede3057 \ No newline at end of file diff --git a/doc/libtrap-devel/group__commonapi.png b/doc/libtrap-devel/group__commonapi.png new file mode 100644 index 00000000..f4cd86f3 Binary files /dev/null and b/doc/libtrap-devel/group__commonapi.png differ diff --git a/doc/libtrap-devel/group__contextapi.html b/doc/libtrap-devel/group__contextapi.html new file mode 100644 index 00000000..21e4233d --- /dev/null +++ b/doc/libtrap-devel/group__contextapi.html @@ -0,0 +1,1190 @@ + + + + + + + +Libtrap: Internal development docs: Context API + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Context API
+
+
+
+Collaboration diagram for Context API:
+
+
+ + + +
+
+ + + + +

+Modules

 Message format
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

trap_ctx_priv_ttrap_create_ctx_t ()
 
void trap_free_ctx_t (trap_ctx_priv_t **ctx)
 
int trap_ctx_terminate (trap_ctx_t *ctx)
 Terminate libtrap context. More...
 
static uint64_t get_cur_timestamp ()
 
int trap_ctx_recv (trap_ctx_t *ctx, uint32_t ifc, const void **data, uint16_t *size)
 Read data from input interface. More...
 
int trap_ctx_finalize (trap_ctx_t **ctx)
 Terminate libtrap context and free resources. More...
 
int trap_ctx_send (trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
 Send data via output interface. More...
 
static void remove_setter_from_param (char *params, char *setter)
 
static void handle_inifc_setters (trap_input_ifc_t *ifc, char *params)
 
static int trapifc_in_construct (trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
 
static void handle_outifc_setters (trap_output_ifc_t *ifc, char *params)
 
static int trapifc_out_construct (trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
 
trap_ctx_ttrap_ctx_init3 (const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init2 (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
int trap_ctx_ifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
int trap_ctx_vifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
 Control TRAP interface. More...
 
int trap_ctx_get_last_error (trap_ctx_t *ctx)
 Get last result code from libtrap context. More...
 
const char * trap_ctx_get_last_error_msg (trap_ctx_t *ctx)
 Get last (error) message from libtrap context. More...
 
void trap_ctx_send_flush (trap_ctx_t *ctx, uint32_t ifc)
 Force flush of buffer. More...
 
void trap_ctx_set_verbose_level (trap_ctx_t *ctx, int level)
 Set verbosity level of library functions. More...
 
int trap_ctx_get_verbose_level (trap_ctx_t *ctx)
 Get verbosity level. More...
 
int trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx)
 Get number of connected clients. More...
 
void trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path)
 Create dump files. More...
 
+

Detailed Description

+

This API allows user to use multiple instances of libtrap in the same process.

+

The API is similar to Simple API. The difference is in the private context memory that is returned by trap_ctx_init() and is freed by trap_ctx_finalize(). Obtained context pointer must be passed to all functions from context API.

+

Function Documentation

+ +

◆ get_cur_timestamp()

+ +
+
+ + + + + +
+ + + + + + + +
static uint64_t get_cur_timestamp ()
+
+inlinestatic
+
+ +

Definition at line 1370 of file trap.c.

+ +
+
+ +

◆ handle_inifc_setters()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void handle_inifc_setters (trap_input_ifc_tifc,
char * params 
)
+
+inlinestatic
+
+

Find setters in IFC parameters and set values if needed.

+
Parameters
+ + + +
[in,out]ifcPointer to IFC structure from the array in context.
[in,out]paramsString passed as argument of -i, found setters are removed after their processing.
+
+
+ +

Definition at line 1506 of file trap.c.

+ +
+
+ +

◆ handle_outifc_setters()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void handle_outifc_setters (trap_output_ifc_tifc,
char * params 
)
+
+inlinestatic
+
+

Find setters in IFC parameters and set values if needed.

+
Parameters
+ + + +
[in,out]ifcPointer to IFC structure from the array in context.
[in,out]paramsString passed as argument of -i, found setters are removed after their processing.
+
+
+ +

Definition at line 1600 of file trap.c.

+ +
+
+ +

◆ remove_setter_from_param()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void remove_setter_from_param (char * params,
char * setter 
)
+
+inlinestatic
+
+

Remove setter starting from params string.

+
Parameters
+ + + +
[in,out]paramsString with parameters of IFC.
[in]setterPointer to the start of setter that should be removed. It ends by TRAP_IFC_PARAM_DELIMITER or zero-byte in the string.
+
+
+ +

Definition at line 1482 of file trap.c.

+ +
+
+ +

◆ trap_create_ctx_t()

+ +
+
+ + + + + + + +
trap_ctx_priv_t* trap_create_ctx_t ()
+
+ +

Definition at line 1251 of file trap.c.

+ +
+
+ +

◆ trap_ctx_create_ifc_dump()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_create_ifc_dump (trap_ctx_tctx,
const char * path 
)
+
+ +

Create dump files.

+

Create dump files for debug as follows: trap-i[number]-config.txt Output interface configuration. trap-i[number]-buffer.dat Output interface buffer trap-o[number]-config.txt Input interface configuration. trap-o[number]-buffer.dat Input interface buffer

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]pathOutput directory, if NULL use current working directory.
+
+
+ +

Definition at line 2473 of file trap.c.

+ +
+
+ +

◆ trap_ctx_finalize()

+ +
+
+ + + + + + + + +
int trap_ctx_finalize (trap_ctx_t ** ctx)
+
+ +

Terminate libtrap context and free resources.

+

Cleanup function. Disconnect all interfaces and do all necessary cleanup.

Returns
Error code
+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
TRAP_E_OK on success.
+ +

Definition at line 1409 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_client_count()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_get_client_count (trap_ctx_tctx,
uint32_t ifcidx 
)
+
+ +

Get number of connected clients.

+

Output interface (TCP or UNIX) allows to send messages to multiple clients. This function reads number of connected clients from internal interface structure.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcidxIFC Index of output interface.
+
+
+
Returns
Number of connected clients. -1 on error.
+ +

Definition at line 2495 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_last_error()

+ +
+
+ + + + + + + + +
int trap_ctx_get_last_error (trap_ctx_tctx)
+
+ +

Get last result code from libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Error codes
+ +

Definition at line 2102 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_last_error_msg()

+ +
+
+ + + + + + + + +
const char * trap_ctx_get_last_error_msg (trap_ctx_tctx)
+
+ +

Get last (error) message from libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Text string with last (error) message from libtrap context.
+ +

Definition at line 2108 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_verbose_level()

+ +
+
+ + + + + + + + +
int trap_ctx_get_verbose_level (trap_ctx_tctx)
+
+ +

Get verbosity level.

+
See also
trap_set_verbose_level for the list of levels.
+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Verbosity level currently set in the library.
+ +
+
+ +

◆ trap_ctx_ifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_ifcctl (trap_ctx_tctx,
int8_t type,
uint32_t ifcidx,
int32_t request,
 ... 
)
+
+ +

Control TRAP interface.

+

This function is thread safe.

+
Note
Type and request types were changed from enum because of python wrapper.
+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]...arguments of request, see trap_ifcctl_request for more details on requests and their arguments.
+
+
+

Examples:

// set 4 seconds timeout
// disable auto-flush
// disable buffering
Returns
TRAP_E_OK on success
+ +

Definition at line 2019 of file trap.c.

+ +
+
+ +

◆ trap_ctx_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
trap_ctx_t * trap_ctx_init (trap_module_info_t * module_info,
trap_ifc_spec_t ifc_spec 
)
+
+ +

Initialize and return the context of libtrap.

+
Returns
context, NULL when allocation failed.
+

This function is thread safe.

+
Parameters
+ + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +

Definition at line 1786 of file trap.c.

+ +
+
+ +

◆ trap_ctx_init2()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
trap_ctx_t * trap_ctx_init2 (trap_module_info_t * module_info,
trap_ifc_spec_t ifc_spec,
const char * service_ifcname 
)
+
+ +

Initialize and return the context of libtrap.

+

This function is thread safe.

+
Parameters
+ + + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
[in]service_ifcnameIdentifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +

Definition at line 1802 of file trap.c.

+ +
+
+ +

◆ trap_ctx_init3()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trap_ctx_t * trap_ctx_init3 (const char * name,
const char * description,
int8_t i_ifcs,
int8_t o_ifcs,
const char * ifc_spec,
const char * service_ifcname 
)
+
+ +

Initialize and return the context of libtrap.

+

This function is thread safe.

+
Parameters
+ + + + + + + +
[in]nameName of the NEMEA module (libtrap context).
[in]description- Detailed description of the module, can be NULL ("" will be used in such case)
[in]i_ifcsNumber of input IFCs, it can be -1 if o_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
[in]o_ifcsNumber of output IFCs, it can be -1 if i_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
[in]ifc_specIFC_SPEC stringdescribed in README.ifcspec.md
[in]service_ifcnameIdentifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +

Definition at line 1731 of file trap.c.

+ +
+
+ +

◆ trap_ctx_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_recv (trap_ctx_tctx,
uint32_t ifc,
const void ** data,
uint16_t * size 
)
+
+ +

Read data from input interface.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIndex of input interface (counted from 0).
[out]dataPointer to received data.
[out]sizeSize of received data in bytes.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ctx_ifcctl
+ +

Definition at line 1379 of file trap.c.

+ +
+
+ +

◆ trap_ctx_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_send (trap_ctx_tctx,
unsigned int ifc,
const void * data,
uint16_t size 
)
+
+ +

Send data via output interface.

+

Write data of size size given by data pointer into interface ifc. If data cannot be written immediately (e.g. because of full buffer or lost connection), wait until write is possible or timeout microseconds elapses. If timeout < 0, wait indefinitely. This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIndex of interface to write into.
[in]dataPointer to data.
[in]sizeNumber of bytes of data.
+
+
+
Returns
Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ctx_ifcctl
+ +

Definition at line 1448 of file trap.c.

+ +
+
+ +

◆ trap_ctx_send_flush()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_send_flush (trap_ctx_tctx,
uint32_t ifc 
)
+
+ +

Force flush of buffer.

+

This function is thread safe.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIFC Index of interface to write into.
+
+
+ +

Definition at line 2115 of file trap.c.

+ +
+
+ +

◆ trap_ctx_set_verbose_level()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_set_verbose_level (trap_ctx_tctx,
int level 
)
+
+ +

Set verbosity level of library functions.

+

Verbosity levels may be:

    +
  • -3 - errors
  • +
  • -2 - warnings
  • +
  • -1 - notices (default)
  • +
  • 0 - verbose
  • +
  • 1 - more verbose
  • +
  • 2 - even more verbose
  • +
+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]levelDesired level of verbosity.
+
+
+ +
+
+ +

◆ trap_ctx_terminate()

+ +
+
+ + + + + + + + +
int trap_ctx_terminate (trap_ctx_tctx)
+
+ +

Terminate libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
TRAP_E_OK on success.
+ +

Definition at line 1342 of file trap.c.

+ +
+
+ +

◆ trap_ctx_vifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_vifcctl (trap_ctx_tctx,
int8_t type,
uint32_t ifcidx,
int32_t request,
va_list ap 
)
+
+ +

Control TRAP interface.

+

This function is thread safe.

+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]aparguments of request.
+
+
+
Returns
TRAP_E_OK on success
+
See also
trap_ctx_ifcctl().
+ +

Definition at line 2032 of file trap.c.

+ +
+
+ +

◆ trap_free_ctx_t()

+ +
+
+ + + + + + + + +
void trap_free_ctx_t (trap_ctx_priv_t ** ctx)
+
+ +

Definition at line 1258 of file trap.c.

+ +
+
+ +

◆ trapifc_in_construct()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int trapifc_in_construct (trap_ctx_priv_tctx,
trap_ifc_spec_tifc_spec,
int idx 
)
+
+inlinestatic
+
+

Switch of supported IFC types, place to call input IFC constructor.

+
Parameters
+ + + + +
[in,out]ctxpointer to context
[in]ifc_specIFC specifiers
[in]idxindex into IFC array
+
+
+
Returns
EXIT_SUCCESS on success, EXIT_FAILURE on error.
+ +

Definition at line 1542 of file trap.c.

+ +
+
+ +

◆ trapifc_out_construct()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int trapifc_out_construct (trap_ctx_priv_tctx,
trap_ifc_spec_tifc_spec,
int idx 
)
+
+inlinestatic
+
+

Switch of supported IFC types, place to call output IFC constructor.

+
Parameters
+ + + + +
[in,out]ctxpointer to context
[in]ifc_specIFC specifiers
[in]idxindex into IFC array
+
+
+
Returns
EXIT_SUCCESS on success, EXIT_FAILURE on error.
+ +

Definition at line 1675 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__contextapi.map b/doc/libtrap-devel/group__contextapi.map new file mode 100644 index 00000000..5a48c48c --- /dev/null +++ b/doc/libtrap-devel/group__contextapi.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__contextapi.md5 b/doc/libtrap-devel/group__contextapi.md5 new file mode 100644 index 00000000..21990646 --- /dev/null +++ b/doc/libtrap-devel/group__contextapi.md5 @@ -0,0 +1 @@ +562fbbab8001f11485105dbae78ea201 \ No newline at end of file diff --git a/doc/libtrap-devel/group__contextapi.png b/doc/libtrap-devel/group__contextapi.png new file mode 100644 index 00000000..7f05cd23 Binary files /dev/null and b/doc/libtrap-devel/group__contextapi.png differ diff --git a/doc/libtrap-devel/group__ctxifccounters.html b/doc/libtrap-devel/group__ctxifccounters.html new file mode 100644 index 00000000..795b056c --- /dev/null +++ b/doc/libtrap-devel/group__ctxifccounters.html @@ -0,0 +1,257 @@ + + + + + + + +Libtrap: Internal development docs: IFC counters + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
IFC counters
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Variables

uint64_t * trap_ctx_priv_s::counter_send_message
 
uint64_t * trap_ctx_priv_s::counter_dropped_message
 
uint64_t * trap_ctx_priv_s::counter_recv_message
 
uint64_t * trap_ctx_priv_s::counter_send_buffer
 
uint64_t * trap_ctx_priv_s::counter_autoflush
 
uint64_t * trap_ctx_priv_s::counter_recv_buffer
 
uint64_t * trap_ctx_priv_s::counter_recv_delay_last
 
uint64_t * trap_ctx_priv_s::counter_recv_delay_total
 
uint64_t * trap_ctx_priv_s::recv_delay_timestamp
 
+

Detailed Description

+

The counters are sent by service_thread_routine() via service IFC (e.g. to supervisor).

+

Variable Documentation

+ +

◆ counter_autoflush

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_autoflush
+
+

counter_autoflush is incremented within trap_automatic_flush_thr() after flushing buffer.

+ +

Definition at line 325 of file trap_internal.h.

+ +
+
+ +

◆ counter_dropped_message

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_dropped_message
+
+

counter_dropped_message is incremented within trap_ctx_send().

+ +

Definition at line 313 of file trap_internal.h.

+ +
+
+ +

◆ counter_recv_buffer

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_recv_buffer
+
+

counter_recv_buffer is incremented within trap_read_from_buffer() after successful receiving buffer.

+ +

Definition at line 329 of file trap_internal.h.

+ +
+
+ +

◆ counter_recv_delay_last

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_recv_delay_last
+
+

counter_recv_delay_last represents time interval between last two recv() calls (in microseconds).

+ +

Definition at line 333 of file trap_internal.h.

+ +
+
+ +

◆ counter_recv_delay_total

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_recv_delay_total
+
+

counter_recv_delay_total represents total time spent outside of recv() function (in microseconds).

+ +

Definition at line 337 of file trap_internal.h.

+ +
+
+ +

◆ counter_recv_message

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_recv_message
+
+

counter_recv_message is incremented within trap_ctx_recv().

+ +

Definition at line 317 of file trap_internal.h.

+ +
+
+ +

◆ counter_send_buffer

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_send_buffer
+
+

counter_send_buffer is incremented within trap_store_into_buffer() after sending buffer.

+ +

Definition at line 321 of file trap_internal.h.

+ +
+
+ +

◆ counter_send_message

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::counter_send_message
+
+

counter_send_message is incremented within trap_ctx_send().

+ +

Definition at line 309 of file trap_internal.h.

+ +
+
+ +

◆ recv_delay_timestamp

+ +
+
+ + + + +
uint64_t* trap_ctx_priv_s::recv_delay_timestamp
+
+

recv_delay_timestamp is used to determine the time that has elapsed between last two recv() calls

+ +

Definition at line 341 of file trap_internal.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__debug.html b/doc/libtrap-devel/group__debug.html new file mode 100644 index 00000000..4f77419b --- /dev/null +++ b/doc/libtrap-devel/group__debug.html @@ -0,0 +1,585 @@ + + + + + + + +Libtrap: Internal development docs: Macros for verbose and debug listings + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Macros for verbose and debug listings
+
+
+ + + + +

+Data Structures

struct  hello_msg_header_s
 
+ + + + + + + + + + + + + + + + + +

+Macros

#define MSG(level, format, args...)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg(level,trap_err_msg);}
 Debug message macro if DEBUG macro is defined. More...
 
#define MSG_NONL(level, format, args...)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg_nonl(trap_err_msg);}
 Debug message macro if DEBUG macro is defined - without new line. More...
 
#define LINE()   {fprintf(stderr, "file: %s, line: %i\n", __FILE__, __LINE__); fflush(stderr);}
 
#define INLINE
 
#define VERBOSE(level, format, args...)
 
#define DEBUG_IFC(X)
 
#define DEBUG_BUF(X)
 
+ + + + + + + + +

+Typedefs

typedef struct trap_ctx_priv_s trap_ctx_priv_t
 
typedef struct hello_msg_header_s hello_msg_header_t
 
typedef enum trap_verbose_level trap_verbose_level_t
 VERBOSE/MSG levels. More...
 
+ + + + +

+Enumerations

enum  trap_verbose_level {
+  CL_ERROR = -3, +CL_WARNING = -2, +CL_VERBOSE_OFF = -1, +CL_VERBOSE_BASIC, +
+  CL_VERBOSE_ADVANCED, +CL_VERBOSE_LIBRARY +
+ }
 VERBOSE/MSG levels. More...
 
+ + + + +

+Functions

void trap_verbose_msg (int level, char *string)
 send verbose message to stderr More...
 
+ + + + + + + + + +

+Variables

int trap_debug
 
int trap_verbose
 
char trap_err_msg []
 
trap_ctx_priv_ttrap_glob_ctx
 
+ + + + + + + +

+Timeouts handling

#define TRAP_NO_IFC_SLEEP   4
 seconds to sleep, when autoflushing is not active More...
 
#define TRAP_IFC_TIMEOUT   2000000
 size of default timeout on output interfaces in microseconds More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ DEBUG_BUF

+ +
+
+ + + + + + + + +
#define DEBUG_BUF( X)
+
+Value:
if (TRAP_DEBUG_BUFFERING) { \
X; \
}
+

Definition at line 187 of file trap_internal.h.

+ +
+
+ +

◆ DEBUG_IFC

+ +
+
+ + + + + + + + +
#define DEBUG_IFC( X)
+
+Value:
if (TRAP_DEBUG_IFC) { \
X; \
}
+

Definition at line 183 of file trap_internal.h.

+ +
+
+ +

◆ INLINE

+ +
+
+ + + + +
#define INLINE
+
+ +

Definition at line 150 of file trap_internal.h.

+ +
+
+ +

◆ LINE

+ +
+
+ + + + + + + +
#define LINE()   {fprintf(stderr, "file: %s, line: %i\n", __FILE__, __LINE__); fflush(stderr);}
+
+

Prints line in source file if DEBUG macro is defined

+ +

Definition at line 148 of file trap_internal.h.

+ +
+
+ +

◆ MSG

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define MSG( level,
 format,
 args... 
)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg(level,trap_err_msg);}
+
+ +

Debug message macro if DEBUG macro is defined.

+

now 3 known DEBUG LEVELS

    +
  • 0 normal debug messages
  • +
  • 1 extended debug (messages on enter and before exit important functions)
  • +
  • 2 flood developer with debug messages :-) (don't use)
  • +
+

BE VERBOSE AND DEBUG ARE DIFFERENT OPTIONS !!!

+ +

Definition at line 142 of file trap_internal.h.

+ +
+
+ +

◆ MSG_NONL

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define MSG_NONL( level,
 format,
 args... 
)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg_nonl(trap_err_msg);}
+
+ +

Debug message macro if DEBUG macro is defined - without new line.

+ +

Definition at line 146 of file trap_internal.h.

+ +
+
+ +

◆ TRAP_IFC_TIMEOUT

+ +
+
+ + + + +
#define TRAP_IFC_TIMEOUT   2000000
+
+ +

size of default timeout on output interfaces in microseconds

+ +

Definition at line 129 of file trap_internal.h.

+ +
+
+ +

◆ TRAP_NO_IFC_SLEEP

+ +
+
+ + + + +
#define TRAP_NO_IFC_SLEEP   4
+
+ +

seconds to sleep, when autoflushing is not active

+ +

Definition at line 128 of file trap_internal.h.

+ +
+
+ +

◆ VERBOSE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define VERBOSE( level,
 format,
 args... 
)
+
+Value:
if (trap_verbose>=level) { \
snprintf(trap_err_msg,4095,"%s:%d "format,__FILE__, __LINE__, ##args); \
trap_verbose_msg(level,trap_err_msg); \
}
char trap_err_msg[]
Definition: trap_internal.c:58
+
int trap_verbose
Definition: trap_internal.c:57
+

Macro for verbose message

+ +

Definition at line 171 of file trap_internal.h.

+ +
+
+

Typedef Documentation

+ +

◆ hello_msg_header_t

+ +
+
+ + + + +
typedef struct hello_msg_header_s hello_msg_header_t
+
+

Hello message header structure (used during the output and input interface negotiation). Contains data format and data specifier size of the output interface which is making the negotiation.

+ +
+
+ +

◆ trap_ctx_priv_t

+ +
+
+ + + + +
typedef struct trap_ctx_priv_s trap_ctx_priv_t
+
+ +

Definition at line 99 of file trap_internal.h.

+ +
+
+ +

◆ trap_verbose_level_t

+ +
+
+ + + + +
typedef enum trap_verbose_level trap_verbose_level_t
+
+ +

VERBOSE/MSG levels.

+ +
+
+

Enumeration Type Documentation

+ +

◆ trap_verbose_level

+ +
+
+ + + + +
enum trap_verbose_level
+
+ +

VERBOSE/MSG levels.

+ + + + + + + +
Enumerator
CL_ERROR 

Inforamtion about error

+
CL_WARNING 
CL_VERBOSE_OFF 

Verbose off / print even if VERBOSE is off

+
CL_VERBOSE_BASIC 

Basic verbose information

+
CL_VERBOSE_ADVANCED 

Advanced verbose information

+
CL_VERBOSE_LIBRARY 

Used for library functions verbose

+
+ +

Definition at line 116 of file trap_internal.h.

+ +
+
+

Function Documentation

+ +

◆ trap_verbose_msg()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_verbose_msg (int level,
char * string 
)
+
+ +

send verbose message to stderr

+

send verbose message to stderr. may change in future. don't use it directly

+
Parameters
+ + + +
levelimportance level
stringformat string, like printf function
+
+
+ +

Definition at line 107 of file trap_internal.c.

+ +
+
+

Variable Documentation

+ +

◆ trap_debug

+ +
+
+ + + + +
int trap_debug
+
+

control debug level

+

Verbose level storage

+ +

Definition at line 56 of file trap_internal.c.

+ +
+
+ +

◆ trap_err_msg

+ +
+
+ + + + +
char trap_err_msg[]
+
+

buffer for verbose and debug messages

+ +

Definition at line 58 of file trap_internal.c.

+ +
+
+ +

◆ trap_glob_ctx

+ +
+
+ + + + +
trap_ctx_priv_t* trap_glob_ctx
+
+ +

Definition at line 120 of file trap.c.

+ +
+
+ +

◆ trap_verbose

+ +
+
+ + + + +
int trap_verbose
+
+

control verbose level

+ +

Definition at line 57 of file trap_internal.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__errorcodes.html b/doc/libtrap-devel/group__errorcodes.html new file mode 100644 index 00000000..5ed3c3a0 --- /dev/null +++ b/doc/libtrap-devel/group__errorcodes.html @@ -0,0 +1,472 @@ + + + + + + + +Libtrap: Internal development docs: Error codes + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
+
+
+
+Collaboration diagram for Error codes:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_E_OK   0
 Success, no error. More...
 
#define TRAP_E_TIMEOUT   1
 Read or write operation timeout. More...
 
#define TRAP_E_INITIALIZED   10
 TRAP library already initilized. More...
 
#define TRAP_E_BADPARAMS   11
 Bad parameters passed to interface initializer. More...
 
#define TRAP_E_BAD_IFC_INDEX   12
 Interface index out of range. More...
 
#define TRAP_E_BAD_FPARAMS   13
 Bad parameters of function. More...
 
#define TRAP_E_IO_ERROR   14
 IO Error. More...
 
#define TRAP_E_TERMINATED   15
 Interface was terminated during reading/writing. More...
 
#define TRAP_E_NOT_SELECTED   16
 Interface was not selected reading/writing. More...
 
#define TRAP_E_BAD_CERT   17
 Wrong certificate given to TLS interface. More...
 
#define TRAP_E_HELP   20
 Returned by parse_parameters when help is requested. More...
 
#define TRAP_E_FIELDS_MISMATCH   21
 Returned when receiver fields are not subset of sender fields. More...
 
#define TRAP_E_FIELDS_SUBSET   22
 Returned when receivers fields are subset of senders fields and both sets are not identical. More...
 
#define TRAP_E_FORMAT_CHANGED   23
 Returned by trap_recv when format or format spec of the receivers interface has been changed. More...
 
#define TRAP_E_FORMAT_MISMATCH   24
 Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match. More...
 
#define TRAP_E_NEGOTIATION_FAILED   25
 Returned by trap_recv when negotiation of the output and input interfaces failed. More...
 
#define TRAP_E_NOT_INITIALIZED   254
 TRAP library not initilized. More...
 
#define TRAP_E_MEMORY   255
 Memory allocation error. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ TRAP_E_BAD_CERT

+ +
+
+ + + + +
#define TRAP_E_BAD_CERT   17
+
+ +

Wrong certificate given to TLS interface.

+ +

Definition at line 96 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BAD_FPARAMS

+ +
+
+ + + + +
#define TRAP_E_BAD_FPARAMS   13
+
+ +

Bad parameters of function.

+ +

Definition at line 92 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BAD_IFC_INDEX

+ +
+
+ + + + +
#define TRAP_E_BAD_IFC_INDEX   12
+
+ +

Interface index out of range.

+ +

Definition at line 91 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BADPARAMS

+ +
+
+ + + + +
#define TRAP_E_BADPARAMS   11
+
+ +

Bad parameters passed to interface initializer.

+ +

Definition at line 90 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FIELDS_MISMATCH

+ +
+
+ + + + +
#define TRAP_E_FIELDS_MISMATCH   21
+
+ +

Returned when receiver fields are not subset of sender fields.

+ +

Definition at line 98 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FIELDS_SUBSET

+ +
+
+ + + + +
#define TRAP_E_FIELDS_SUBSET   22
+
+ +

Returned when receivers fields are subset of senders fields and both sets are not identical.

+ +

Definition at line 99 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FORMAT_CHANGED

+ +
+
+ + + + +
#define TRAP_E_FORMAT_CHANGED   23
+
+ +

Returned by trap_recv when format or format spec of the receivers interface has been changed.

+ +

Definition at line 100 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FORMAT_MISMATCH

+ +
+
+ + + + +
#define TRAP_E_FORMAT_MISMATCH   24
+
+ +

Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match.

+ +

Definition at line 101 of file trap.h.

+ +
+
+ +

◆ TRAP_E_HELP

+ +
+
+ + + + +
#define TRAP_E_HELP   20
+
+ +

Returned by parse_parameters when help is requested.

+ +

Definition at line 97 of file trap.h.

+ +
+
+ +

◆ TRAP_E_INITIALIZED

+ +
+
+ + + + +
#define TRAP_E_INITIALIZED   10
+
+ +

TRAP library already initilized.

+ +

Definition at line 89 of file trap.h.

+ +
+
+ +

◆ TRAP_E_IO_ERROR

+ +
+
+ + + + +
#define TRAP_E_IO_ERROR   14
+
+ +

IO Error.

+ +

Definition at line 93 of file trap.h.

+ +
+
+ +

◆ TRAP_E_MEMORY

+ +
+
+ + + + +
#define TRAP_E_MEMORY   255
+
+ +

Memory allocation error.

+ +

Definition at line 104 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NEGOTIATION_FAILED

+ +
+
+ + + + +
#define TRAP_E_NEGOTIATION_FAILED   25
+
+ +

Returned by trap_recv when negotiation of the output and input interfaces failed.

+ +

Definition at line 102 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NOT_INITIALIZED

+ +
+
+ + + + +
#define TRAP_E_NOT_INITIALIZED   254
+
+ +

TRAP library not initilized.

+ +

Definition at line 103 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NOT_SELECTED

+ +
+
+ + + + +
#define TRAP_E_NOT_SELECTED   16
+
+ +

Interface was not selected reading/writing.

+ +

Definition at line 95 of file trap.h.

+ +
+
+ +

◆ TRAP_E_OK

+ +
+
+ + + + +
#define TRAP_E_OK   0
+
+ +

Success, no error.

+ +

Definition at line 87 of file trap.h.

+ +
+
+ +

◆ TRAP_E_TERMINATED

+ +
+
+ + + + +
#define TRAP_E_TERMINATED   15
+
+ +

Interface was terminated during reading/writing.

+ +

Definition at line 94 of file trap.h.

+ +
+
+ +

◆ TRAP_E_TIMEOUT

+ +
+
+ + + + +
#define TRAP_E_TIMEOUT   1
+
+ +

Read or write operation timeout.

+ +

Definition at line 88 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__errorcodes.map b/doc/libtrap-devel/group__errorcodes.map new file mode 100644 index 00000000..6ea39bcd --- /dev/null +++ b/doc/libtrap-devel/group__errorcodes.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__errorcodes.md5 b/doc/libtrap-devel/group__errorcodes.md5 new file mode 100644 index 00000000..47b41b09 --- /dev/null +++ b/doc/libtrap-devel/group__errorcodes.md5 @@ -0,0 +1 @@ +1084e807b56b8824860f3747a2cfd2a7 \ No newline at end of file diff --git a/doc/libtrap-devel/group__errorcodes.png b/doc/libtrap-devel/group__errorcodes.png new file mode 100644 index 00000000..267dd2d5 Binary files /dev/null and b/doc/libtrap-devel/group__errorcodes.png differ diff --git a/doc/libtrap-devel/group__file__ifc.html b/doc/libtrap-devel/group__file__ifc.html new file mode 100644 index 00000000..e2c600e0 --- /dev/null +++ b/doc/libtrap-devel/group__file__ifc.html @@ -0,0 +1,341 @@ + + + + + + + +Libtrap: Internal development docs: file interface module + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
+
+
+
+Collaboration diagram for file interface module:
+
+
+ + + + + +
+
+ + + + + + +

+Modules

 File_receiver
 
 File_sender
 
+ + + + + + + + + + + + + + + + + + + + + +

+Functions

void file_destroy (void *priv)
 Close file and free allocated memory. More...
 
void file_terminate (void *priv)
 Set interface state as terminated. More...
 
int _mkdir (const char *path)
 Create path, recursive. More...
 
static void file_create_dump (void *priv, uint32_t idx, const char *path)
 Create file dump with current configuration (for debugging) More...
 
int create_next_filename (file_private_t *config)
 Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename. More...
 
int switch_file (file_private_t *c)
 Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file. More...
 
void switch_file_wrapper (void *priv)
 
+

Detailed Description

+

Function Documentation

+ +

◆ _mkdir()

+ +
+
+ + + + + + + + +
int _mkdir (const char * path)
+
+ +

Create path, recursive.

+

Author Jonathon Reinhart Adapted from https://gist.github.com/JonathonReinhart/8c0d90191c38af2dcadb102c4e202950

Parameters
+ + +
[in]pathwhere file will be created
+
+
+
Returns
0 on success, -1 otherwise
+ +

Definition at line 122 of file ifc_file.c.

+ +
+
+ +

◆ create_next_filename()

+ +
+
+ + + + + + + + +
int create_next_filename (file_private_tconfig)
+
+ +

Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename.

+
Parameters
+ + +
[in,out]configPointer to module private data.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_MEMORY if function time(NULL) returns -1, TRAP_E_IO_ERROR if error occurs during directory creation, TRAP_E_BADPARAMS if the specified path and filename exceeds MAX_PATH - 1 bytes.
+ +

Definition at line 194 of file ifc_file.c.

+ +
+
+ +

◆ file_create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void file_create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Create file dump with current configuration (for debugging)

+
Parameters
+ + + + +
[in]privpointer to module private data
[in]idxnumber of interface
[in]pathpath where dump file will be created
+
+
+ +

Definition at line 158 of file ifc_file.c.

+ +
+
+ +

◆ file_destroy()

+ +
+
+ + + + + + + + +
void file_destroy (void * priv)
+
+ +

Close file and free allocated memory.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 74 of file ifc_file.c.

+ +
+
+ +

◆ file_terminate()

+ +
+
+ + + + + + + + +
void file_terminate (void * priv)
+
+ +

Set interface state as terminated.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 106 of file ifc_file.c.

+ +
+
+ +

◆ switch_file()

+ +
+
+ + + + + + + + +
int switch_file (file_private_tc)
+
+ +

Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file.

+
Parameters
+ + +
[in,out]cPointer to module private data.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_BADPARAMS if the next file cannot be opened.
+ +

Definition at line 277 of file ifc_file.c.

+ +
+
+ +

◆ switch_file_wrapper()

+ +
+
+ + + + + + + + +
void switch_file_wrapper (void * priv)
+
+ +

Definition at line 539 of file ifc_file.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__file__ifc.map b/doc/libtrap-devel/group__file__ifc.map new file mode 100644 index 00000000..2b4d7df3 --- /dev/null +++ b/doc/libtrap-devel/group__file__ifc.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/group__file__ifc.md5 b/doc/libtrap-devel/group__file__ifc.md5 new file mode 100644 index 00000000..20eac7d0 --- /dev/null +++ b/doc/libtrap-devel/group__file__ifc.md5 @@ -0,0 +1 @@ +8c32438c8d2d71fc66cd49d9af473d60 \ No newline at end of file diff --git a/doc/libtrap-devel/group__file__ifc.png b/doc/libtrap-devel/group__file__ifc.png new file mode 100644 index 00000000..c9c2fcc2 Binary files /dev/null and b/doc/libtrap-devel/group__file__ifc.png differ diff --git a/doc/libtrap-devel/group__file__receiver.html b/doc/libtrap-devel/group__file__receiver.html new file mode 100644 index 00000000..a53e2a19 --- /dev/null +++ b/doc/libtrap-devel/group__file__receiver.html @@ -0,0 +1,252 @@ + + + + + + + +Libtrap: Internal development docs: File_receiver + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for File_receiver:
+
+
+ + + +
+
+ + + + + + + + + + + + +

+Functions

int file_recv (void *priv, void *data, uint32_t *size, int timeout)
 Read data from a file. More...
 
char * file_recv_ifc_get_id (void *priv)
 
uint8_t file_recv_ifc_is_conn (void *priv)
 
int create_file_recv_ifc (trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface. More...
 
+

Detailed Description

+

Function Documentation

+ +

◆ create_file_recv_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_file_recv_ifc (trap_ctx_priv_tctx,
const char * params,
trap_input_ifc_tifc,
uint32_t idx 
)
+
+ +

Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing file_name, where file_name is a path to a file from which data is to be read
[in,out]ifcIFC interface used for calling file module.
[in]idxIndex of IFC that is created.
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_MEMORY, TRAP_E_BADPARAMS on error
+ +

Definition at line 432 of file ifc_file.c.

+ +
+
+ +

◆ file_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int file_recv (void * priv,
void * data,
uint32_t * size,
int timeout 
)
+
+ +

Read data from a file.

+
Parameters
+ + + + + +
[in]privpointer to module private data
[out]datapointer to a memory block in which data is to be stored
[out]sizepointer to a memory block in which size of read data is to be stored
[in]timeoutNOT USED IN THIS INTERFACE
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_IO_ERROR if error occurs during reading, TRAP_E_TERMINATED if interface was terminated.
+ +

Definition at line 309 of file ifc_file.c.

+ +
+
+ +

◆ file_recv_ifc_get_id()

+ +
+
+ + + + + + + + +
char* file_recv_ifc_get_id (void * priv)
+
+ +

Definition at line 404 of file ifc_file.c.

+ +
+
+ +

◆ file_recv_ifc_is_conn()

+ +
+
+ + + + + + + + +
uint8_t file_recv_ifc_is_conn (void * priv)
+
+ +

Definition at line 409 of file ifc_file.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__file__receiver.map b/doc/libtrap-devel/group__file__receiver.map new file mode 100644 index 00000000..f1316232 --- /dev/null +++ b/doc/libtrap-devel/group__file__receiver.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__file__receiver.md5 b/doc/libtrap-devel/group__file__receiver.md5 new file mode 100644 index 00000000..9dc7966b --- /dev/null +++ b/doc/libtrap-devel/group__file__receiver.md5 @@ -0,0 +1 @@ +0aaeeb06d930fc45b14df81b938c9a32 \ No newline at end of file diff --git a/doc/libtrap-devel/group__file__receiver.png b/doc/libtrap-devel/group__file__receiver.png new file mode 100644 index 00000000..a6e4051f Binary files /dev/null and b/doc/libtrap-devel/group__file__receiver.png differ diff --git a/doc/libtrap-devel/group__file__sender.html b/doc/libtrap-devel/group__file__sender.html new file mode 100644 index 00000000..a097650b --- /dev/null +++ b/doc/libtrap-devel/group__file__sender.html @@ -0,0 +1,451 @@ + + + + + + + +Libtrap: Internal development docs: File_sender + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for File_sender:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int file_write_buffer (void *priv, const void *data, uint32_t size, int timeout)
 Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian) More...
 
static void finish_buffer (file_buffer_t *buffer)
 
static void insert_into_buffer (file_buffer_t *buffer, const void *data, uint16_t size)
 
void file_flush (void *priv)
 
static int file_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately. More...
 
int32_t file_get_client_count (void *priv)
 
int8_t file_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
char * file_send_ifc_get_id (void *priv)
 
int create_file_send_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file output interface. This function is called by TRAP library to initialize one output interface. More...
 
+

Detailed Description

+

Function Documentation

+ +

◆ create_file_send_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_file_send_ifc (trap_ctx_priv_tctx,
const char * params,
trap_output_ifc_tifc,
uint32_t idx 
)
+
+ +

Allocate and initiate file output interface. This function is called by TRAP library to initialize one output interface.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing colon separated values of these parameters (in this exact order): file_name:open_mode, where file_name is a path to a file in which data is to be written and open_mode is either a - append or w - write, if no mode is specified, the file will be opened in append mode.
[in,out]ifcIFC interface used for calling file module.
[in]idxIndex of IFC that is created.
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_MEMORY, TRAP_E_BADPARAMS on error
+ +

Definition at line 765 of file ifc_file.c.

+ +
+
+ +

◆ file_flush()

+ +
+
+ + + + + + + + +
void file_flush (void * priv)
+
+ +

Definition at line 655 of file ifc_file.c.

+ +
+
+ +

◆ file_get_client_count()

+ +
+
+ + + + + + + + +
int32_t file_get_client_count (void * priv)
+
+ +

Definition at line 738 of file ifc_file.c.

+ +
+
+ +

◆ file_get_client_stats_json()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int8_t file_get_client_stats_json (void * priv,
json_t * client_stats_arr 
)
+
+ +

Definition at line 743 of file ifc_file.c.

+ +
+
+ +

◆ file_send()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int file_send (void * priv,
const void * data,
uint16_t size,
int timeout 
)
+
+inlinestatic
+
+ +

Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately.

+
Parameters
+ + + + + +
[in]privpointer to module private data
[in]datapointer to data to write
[in]sizesize of data to write
[in]timeoutNOT USED IN THIS INTERFACE
+
+
+
Returns
TRAP_E_OK Success.
+
+TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
+
+TRAP_E_TERMINATED Libtrap was terminated during the process.
+ +

Definition at line 688 of file ifc_file.c.

+ +
+
+ +

◆ file_send_ifc_get_id()

+ +
+
+ + + + + + + + +
char* file_send_ifc_get_id (void * priv)
+
+ +

Definition at line 749 of file ifc_file.c.

+ +
+
+ +

◆ file_write_buffer()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int file_write_buffer (void * priv,
const void * data,
uint32_t size,
int timeout 
)
+
+ +

Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian)

+
Parameters
+ + + + + +
[in]privpointer to module private data
[in]datapointer to data to write
[in]sizesize of data to write - NOT USED IN THIS INTERFACE
[in]timeoutNOT USED IN THIS INTERFACE
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_IO_ERROR if error occurs during writing, TRAP_E_TERMINATED if interface was terminated.
+ +

Definition at line 564 of file ifc_file.c.

+ +
+
+ +

◆ finish_buffer()

+ +
+
+ + + + + +
+ + + + + + + + +
static void finish_buffer (file_buffer_tbuffer)
+
+inlinestatic
+
+ +

Definition at line 640 of file ifc_file.c.

+ +
+
+ +

◆ insert_into_buffer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void insert_into_buffer (file_buffer_tbuffer,
const void * data,
uint16_t size 
)
+
+inlinestatic
+
+ +

Definition at line 647 of file ifc_file.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__file__sender.map b/doc/libtrap-devel/group__file__sender.map new file mode 100644 index 00000000..fdd98df3 --- /dev/null +++ b/doc/libtrap-devel/group__file__sender.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__file__sender.md5 b/doc/libtrap-devel/group__file__sender.md5 new file mode 100644 index 00000000..82199a55 --- /dev/null +++ b/doc/libtrap-devel/group__file__sender.md5 @@ -0,0 +1 @@ +52b8f84170a21606cf3f576eaa53627b \ No newline at end of file diff --git a/doc/libtrap-devel/group__file__sender.png b/doc/libtrap-devel/group__file__sender.png new file mode 100644 index 00000000..c2d2cf91 Binary files /dev/null and b/doc/libtrap-devel/group__file__sender.png differ diff --git a/doc/libtrap-devel/group__ifctypes.html b/doc/libtrap-devel/group__ifctypes.html new file mode 100644 index 00000000..86cc5864 --- /dev/null +++ b/doc/libtrap-devel/group__ifctypes.html @@ -0,0 +1,313 @@ + + + + + + + +Libtrap: Internal development docs: Types of IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for Types of IFC:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_IFC_TYPE_GENERATOR   'g'
 trap_ifc_dummy generator (input) More...
 
#define TRAP_IFC_TYPE_BLACKHOLE   'b'
 trap_ifc_dummy blackhole (output) More...
 
#define TRAP_IFC_TYPE_TCPIP   't'
 trap_ifc_tcpip (input&output part) More...
 
#define TRAP_IFC_TYPE_TLS   'T'
 trap_ifc_tls (input&output part) More...
 
#define TRAP_IFC_TYPE_UNIX   'u'
 trap_ifc_tcpip via UNIX socket(input&output part) More...
 
#define TRAP_IFC_TYPE_SERVICE   's'
 service ifc More...
 
#define TRAP_IFC_TYPE_FILE   'f'
 trap_ifc_file (input&output part) More...
 
+ + + +

+Enumerations

enum  trap_ifc_type { TRAPIFC_INPUT = 1, +TRAPIFC_OUTPUT = 2 + }
 
+ + + + + +

+Variables

char trap_ifc_type_supported []
 
enum trap_ifc_type __attribute__
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_TYPE_BLACKHOLE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_BLACKHOLE   'b'
+
+ +

trap_ifc_dummy blackhole (output)

+ +

Definition at line 172 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_FILE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_FILE   'f'
+
+ +

trap_ifc_file (input&output part)

+ +

Definition at line 177 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_GENERATOR

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_GENERATOR   'g'
+
+ +

trap_ifc_dummy generator (input)

+ +

Definition at line 171 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_SERVICE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_SERVICE   's'
+
+ +

service ifc

+ +

Definition at line 176 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_TCPIP

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_TCPIP   't'
+
+ +

trap_ifc_tcpip (input&output part)

+ +

Definition at line 173 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_TLS

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_TLS   'T'
+
+ +

trap_ifc_tls (input&output part)

+ +

Definition at line 174 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_UNIX

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_UNIX   'u'
+
+ +

trap_ifc_tcpip via UNIX socket(input&output part)

+ +

Definition at line 175 of file trap.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ trap_ifc_type

+ +
+
+ + + + +
enum trap_ifc_type
+
+

Type of interface (direction)

+ + + +
Enumerator
TRAPIFC_INPUT 

interface acts as source of data for module

+
TRAPIFC_OUTPUT 

interface is used for sending data out of module

+
+ +

Definition at line 183 of file trap.h.

+ +
+
+

Variable Documentation

+ +

◆ __attribute__

+ +
+
+ + + + +
enum trap_ifc_type __attribute__
+
+ +
+
+ +

◆ trap_ifc_type_supported

+ +
+
+ + + + +
char trap_ifc_type_supported[]
+
+

NULL terminated array of supported IFC types.

+ +

Definition at line 107 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__ifctypes.map b/doc/libtrap-devel/group__ifctypes.map new file mode 100644 index 00000000..47ca99fc --- /dev/null +++ b/doc/libtrap-devel/group__ifctypes.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__ifctypes.md5 b/doc/libtrap-devel/group__ifctypes.md5 new file mode 100644 index 00000000..347ec476 --- /dev/null +++ b/doc/libtrap-devel/group__ifctypes.md5 @@ -0,0 +1 @@ +7b151076290099e29daad2ce6457b23d \ No newline at end of file diff --git a/doc/libtrap-devel/group__ifctypes.png b/doc/libtrap-devel/group__ifctypes.png new file mode 100644 index 00000000..d270a9fb Binary files /dev/null and b/doc/libtrap-devel/group__ifctypes.png differ diff --git a/doc/libtrap-devel/group__modulemacros.html b/doc/libtrap-devel/group__modulemacros.html new file mode 100644 index 00000000..24c42034 --- /dev/null +++ b/doc/libtrap-devel/group__modulemacros.html @@ -0,0 +1,440 @@ + + + + + + + +Libtrap: Internal development docs: Nemea module macros + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Nemea module macros
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_DEFAULT_SIGNAL_HANDLER(stop_cmd)
 Define default signal handler function Defines function to handle SIGTERM and SIGINT signals. When a signal is received, it runs the specified command and calls trap_terminate(). Place this macro before your main function. More...
 
#define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER()
 Register default signal handler. Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of SIGTERM and SIGINT signals. Place this macro between TRAP initialization and the main loop. More...
 
#define TRAP_DEFAULT_INITIALIZATION(argc, argv, module_info)
 Initialize TRAP using command-line parameters and handle errors. Generates code that parses command-line parameters using trap_parse_params, intializes TRAP library using trap_init and handle possible errors. It calls exit(1) when an error has occured. Place this macro at the beginning of your main function. More...
 
#define TRAP_DEFAULT_FINALIZATION()   trap_finalize();
 Generate TRAP cleanup code. Only calls trap_finalize function. Place this macro at the end of your main function. More...
 
#define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv(). More...
 
#define TRAP_DEFAULT_RECV_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv. More...
 
#define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send_data. More...
 
#define TRAP_DEFAULT_SEND_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send. More...
 
+

Detailed Description

+

Set of preprocessor macros for rapid NEMEA module development.

+

Macro Definition Documentation

+ +

◆ TRAP_DEFAULT_FINALIZATION

+ +
+
+ + + + + + + +
#define TRAP_DEFAULT_FINALIZATION()   trap_finalize();
+
+ +

Generate TRAP cleanup code. Only calls trap_finalize function. Place this macro at the end of your main function.

+ +

Definition at line 954 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_GET_DATA_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
/* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
/* (module can perform some special operations with templates after trap_recv() signals format change) */ \
} else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
error_cmd; \
} else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
error_cmd; \
} else {\
fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
#define TRAP_E_FORMAT_CHANGED
Returned by trap_recv when format or format spec of the receivers interface has been changed...
Definition: trap.h:100
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_recv().

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_recv().
timeout_cmdCommand to run when a timeout has occured, e.g. "continue".
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+
Deprecated:
This macro should be replaced by TRAP_DEFAULT_RECV_ERROR_HANDLING.
+ +

Definition at line 964 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_INITIALIZATION

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_INITIALIZATION( argc,
 argv,
 module_info 
)
+
+Value:
{\
trap_ifc_spec_t ifc_spec;\
int ret = trap_parse_params(&argc, argv, &ifc_spec);\
if (ret != TRAP_E_OK) {\
if (ret == TRAP_E_HELP) {\
trap_print_help(&module_info);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 0;\
}\
trap_free_ifc_spec(ifc_spec);\
fprintf(stderr, "ERROR in parsing of parameters for TRAP: %s\n", trap_last_error_msg);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 1;\
}\
ret = trap_init(&module_info, ifc_spec);\
if (ret != TRAP_E_OK) {\
trap_free_ifc_spec(ifc_spec);\
fprintf(stderr, "ERROR in TRAP initialization: %s\n", trap_last_error_msg);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 1;\
}\
trap_free_ifc_spec(ifc_spec);\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
#define TRAP_E_HELP
Returned by parse_parameters when help is requested.
Definition: trap.h:97
+
int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
Definition: trap.c:526
+
int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
Definition: trap.c:339
+
+

Initialize TRAP using command-line parameters and handle errors. Generates code that parses command-line parameters using trap_parse_params, intializes TRAP library using trap_init and handle possible errors. It calls exit(1) when an error has occured. Place this macro at the beginning of your main function.

+
Parameters
+ + + + +
[in,out]argcNumber of command-line parameters.
[in,out]argvList of command-line parameters.
[in]module_infotrap_module_info_t structure containing information about the module.
+
+
+ +

Definition at line 925 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_RECV_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_RECV_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
/* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
/* (module can perform some special operations with templates after trap_recv() signals format change) */ \
} else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
error_cmd; \
} else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
error_cmd; \
} else {\
fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
#define TRAP_E_FORMAT_CHANGED
Returned by trap_recv when format or format spec of the receivers interface has been changed...
Definition: trap.h:100
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_recv.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_recv.
timeout_cmdCommand to run when a timeout has occured, e.g. "continue".
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+ +

Definition at line 991 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else {\
fprintf(stderr, "Error: trap_send_data() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_send_data.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_send_data.
timeout_cmdCommand to run when a timeout has occured, e.g. "0" to do nothing.
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+
Deprecated:
This macro should be replaced by TRAP_DEFAULT_SEND_ERROR_HANDLING.
+ +

Definition at line 1021 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SEND_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_SEND_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else {\
fprintf(stderr, "Error: trap_send() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_send.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_send.
timeout_cmdCommand to run when a timeout has occured, e.g. "0" to do nothing.
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+ +

Definition at line 1040 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SIGNAL_HANDLER

+ +
+
+ + + + + + + + +
#define TRAP_DEFAULT_SIGNAL_HANDLER( stop_cmd)
+
+Value:
void trap_default_signal_handler(int signal)\
{\
if (signal == SIGTERM || signal == SIGINT) { \
stop_cmd;\
trap_terminate();\
}\
}
+

Define default signal handler function Defines function to handle SIGTERM and SIGINT signals. When a signal is received, it runs the specified command and calls trap_terminate(). Place this macro before your main function.

+
Parameters
+ + +
[in]stop_cmdCommand which stops operation of a module. Usually setting a variable which is tested in module's main loop.
+
+
+ +

Definition at line 872 of file trap.h.

+ +
+
+ +

◆ TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER

+ +
+
+ + + + + + + +
#define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER()
+
+Value:
do {\
printf("Setting signal handler for SIGINT and SIGTERM using 'signal' function.\n");\
signal(SIGTERM, trap_default_signal_handler);\
signal(SIGINT, trap_default_signal_handler);\
} while(0)
int trap_get_verbose_level()
Definition: trap.c:663
+
+

Register default signal handler. Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of SIGTERM and SIGINT signals. Place this macro between TRAP initialization and the main loop.

+ +

Definition at line 904 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__negotiationretvals.html b/doc/libtrap-devel/group__negotiationretvals.html new file mode 100644 index 00000000..ef1e0203 --- /dev/null +++ b/doc/libtrap-devel/group__negotiationretvals.html @@ -0,0 +1,253 @@ + + + + + + + +Libtrap: Internal development docs: Negotiation return values + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Negotiation return values
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define NEG_RES_CONT   111
 If the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation) More...
 
#define NEG_RES_RECEIVER_FMT_SUBSET   112
 If the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier. More...
 
#define NEG_RES_SENDER_FMT_SUBSET   116
 If the data format of input and output interfaces is the same and new data specifier of the output interface is subset of the old one (it is not first negotiation) More...
 
#define NEG_RES_FMT_MISMATCH   113
 If the data format or data specifier of input and output interfaces does not match. More...
 
#define NEG_RES_FMT_CHANGED   117
 If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) More...
 
#define NEG_RES_OK   116
 Signaling success (hello message successfully sent to input interface) More...
 
#define NEG_RES_FAILED   114
 If receiving the data from output interface fails or sending the data to input interface fails. More...
 
#define NEG_RES_FMT_UNKNOWN   115
 If the output interface has not specified data format. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ NEG_RES_CONT

+ +
+
+ + + + +
#define NEG_RES_CONT   111
+
+ +

If the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation)

+ +

Definition at line 74 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_FAILED

+ +
+
+ + + + +
#define NEG_RES_FAILED   114
+
+ +

If receiving the data from output interface fails or sending the data to input interface fails.

+ +

Definition at line 84 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_FMT_CHANGED

+ +
+
+ + + + +
#define NEG_RES_FMT_CHANGED   117
+
+ +

If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants)

+ +

Definition at line 78 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_FMT_MISMATCH

+ +
+
+ + + + +
#define NEG_RES_FMT_MISMATCH   113
+
+ +

If the data format or data specifier of input and output interfaces does not match.

+ +

Definition at line 77 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_FMT_UNKNOWN

+ +
+
+ + + + +
#define NEG_RES_FMT_UNKNOWN   115
+
+ +

If the output interface has not specified data format.

+ +

Definition at line 85 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_OK

+ +
+
+ + + + +
#define NEG_RES_OK   116
+
+ +

Signaling success (hello message successfully sent to input interface)

+ +

Definition at line 81 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_RECEIVER_FMT_SUBSET

+ +
+
+ + + + +
#define NEG_RES_RECEIVER_FMT_SUBSET   112
+
+ +

If the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier.

+ +

Definition at line 75 of file trap_internal.h.

+ +
+
+ +

◆ NEG_RES_SENDER_FMT_SUBSET

+ +
+
+ + + + +
#define NEG_RES_SENDER_FMT_SUBSET   116
+
+ +

If the data format of input and output interfaces is the same and new data specifier of the output interface is subset of the old one (it is not first negotiation)

+ +

Definition at line 76 of file trap_internal.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__simpleapi.html b/doc/libtrap-devel/group__simpleapi.html new file mode 100644 index 00000000..1566d62f --- /dev/null +++ b/doc/libtrap-devel/group__simpleapi.html @@ -0,0 +1,662 @@ + + + + + + + +Libtrap: Internal development docs: Simple API + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Simple API
+
+
+
+Collaboration diagram for Simple API:
+
+
+ + + +
+
+ + + + +

+Modules

 Message format
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
 
int trap_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 
int trap_terminate ()
 
int trap_finalize ()
 
int trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
 
int trap_recv (uint32_t ifcidx, const void **data, uint16_t *size)
 Receive data from input interface. More...
 
int trap_send (uint32_t ifcidx, const void *data, uint16_t size)
 Send data via output interface. More...
 
void trap_set_verbose_level (int level)
 
int trap_get_verbose_level ()
 
void trap_set_help_section (int level)
 
void trap_print_help (const trap_module_info_t *module_info)
 
void trap_print_ifc_spec_help ()
 
int trap_ifcctl (int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
void trap_send_flush (uint32_t ifc)
 Force flush of buffer. More...
 
+ + + + + + + +

+Variables

int trap_last_error
 Code of last error (one of the codes above) More...
 
const char * trap_last_error_msg
 Human-readable message about last error. More...
 
+

Detailed Description

+

Function Documentation

+ +

◆ trap_finalize()

+ +
+
+ + + + + + + +
int trap_finalize ()
+
+

Cleanup function. Disconnect all interfaces and do all necessary cleanup.

Returns
Error code
+ +

Definition at line 578 of file trap.c.

+ +
+
+ +

◆ trap_free_ifc_spec()

+ +
+
+ + + + + + + + +
int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
+
+

Destructor of trap_ifc_spec_t structure.

Parameters
+ + +
[in]ifc_spectrap_ifc_spec_t structure to clear.
+
+
+
Returns
Error code (0 on success)
+ +

Definition at line 497 of file trap.c.

+ +
+
+ +

◆ trap_get_verbose_level()

+ +
+
+ + + + + + + +
int trap_get_verbose_level ()
+
+

Get verbosity level. See trap_set_verbose_level for list of levels.

Returns
Verbosity level currently set in the library.
+ +

Definition at line 663 of file trap.c.

+ +
+
+ +

◆ trap_ifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ifcctl (int8_t type,
uint32_t ifcidx,
int32_t request,
 ... 
)
+
+ +

Control TRAP interface.

+
Note
Type and request types were changed from enum because of python wrapper.
+
Parameters
+ + + + + +
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]...arguments of request, see trap_ifcctl_request for more details on requests and their arguments.
+
+
+

Examples:

Returns
TRAP_E_OK on success
+ +

Definition at line 1231 of file trap.c.

+ +
+
+ +

◆ trap_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_init (trap_module_info_t * module_info,
trap_ifc_spec_t ifc_spec 
)
+
+

Initialization function. Create and initialize all interfaces.

Parameters
+ + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Error code (0 on success)
+ +

Definition at line 526 of file trap.c.

+ +
+
+ +

◆ trap_print_help()

+ +
+
+ + + + + + + + +
void trap_print_help (const trap_module_info_t * module_info)
+
+

Print common TRAP help message. The help message contains information from module_info and describes common TRAP command-line parameters.

Parameters
+ + +
[in]module_infoPointer to struct containing info about the module.
+
+
+ +

Definition at line 898 of file trap.c.

+ +
+
+ +

◆ trap_print_ifc_spec_help()

+ +
+
+ + + + + + + +
void trap_print_ifc_spec_help ()
+
+

Print help about interface specifier. Prints help message about format of interface specifier and description of all available interface types. This message is normally a part of help printed by trap_print_help, this function is useful when you don't use standard TRAP command-line parameters but you still use the same format of interface specifier.

+

Print help about interface specifier. Prints help message about format of interface specifier and description of all available interface types.

+ +

Definition at line 1138 of file trap.c.

+ +
+
+ +

◆ trap_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_recv (uint32_t ifcidx,
const void ** data,
uint16_t * size 
)
+
+ +

Receive data from input interface.

+

Receive a message from interface specified by ifcidx and set pointer to the data. When function returns due to timeout, contents of data and size are undefined.

+
Parameters
+ + + + +
[in]ifcidxIndex of input IFC.
[out]dataPointer to received data.
[out]sizeSize of received data in bytes of data.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
Note
Data must not be freed! Library stores incomming data into static array and rewrites it during every trap_recv() call.
+
See also
trap_ifcctl() to set timeout (TRAPCTL_SETTIMEOUT)
+ +

Definition at line 631 of file trap.c.

+ +
+
+ +

◆ trap_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_send (uint32_t ifcidx,
const void * data,
uint16_t size 
)
+
+ +

Send data via output interface.

+

Send a message given by data pointer of size message size via interface specified by ifcidx that is the index of output interfaces (counted from 0).

+
Parameters
+ + + + +
[in]ifcidxIndex of input IFC.
[out]dataPointer to message to send.
[out]sizeSize of message in bytes.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ifcctl() to set timeout (TRAPCTL_SETTIMEOUT)
+ +

Definition at line 624 of file trap.c.

+ +
+
+ +

◆ trap_send_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_send_data (unsigned int ifcidx,
const void * data,
uint16_t size,
int timeout 
)
+
+

Send data to output interface. Write data of size size given by data pointer into interface ifc. If data cannot be written immediately (e.g. because of full buffer or lost connection), wait until write is possible or timeout microseconds elapses. If timeout < 0, wait indefinitely.

Parameters
+ + + + + +
[in]ifcidxIndex of interface to write into.
[in]dataPointer to data.
[in]sizeNumber of bytes of data.
[in]timeoutTimeout in microseconds for non-blocking mode; timeout can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.
+
+
+
Returns
Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
+
Deprecated:
This function should be replaced by trap_send().
+ +

Definition at line 618 of file trap.c.

+ +
+
+ +

◆ trap_send_flush()

+ +
+
+ + + + + + + + +
void trap_send_flush (uint32_t ifc)
+
+ +

Force flush of buffer.

+
Parameters
+ + +
[in]ifcIFC Index of interface to write into.
+
+
+ +

Definition at line 1241 of file trap.c.

+ +
+
+ +

◆ trap_set_help_section()

+ +
+
+ + + + + + + + +
void trap_set_help_section (int level)
+
+

Set section for trap_print_help()

+
Parameters
+ + +
[in]level0 for default info about module, 1 for info about IFC specifier
+
+
+ +

Definition at line 324 of file trap.c.

+ +
+
+ +

◆ trap_set_verbose_level()

+ +
+
+ + + + + + + + +
void trap_set_verbose_level (int level)
+
+

Set verbosity level of library functions. Verbosity levels may be:

    +
  • -3 - errors
  • +
  • -2 - warnings
  • +
  • -1 - notices (default)
  • +
  • 0 - verbose
  • +
  • 1 - more verbose
  • +
  • 2 - even more verbose
  • +
+
Parameters
+ + +
[in]levelDesired level of verbosity.
+
+
+

Set verbosity level. Verbosity levels are:

    +
  • -3 - errors
  • +
  • -2 - warnings
  • +
  • -1 - notices (default)
  • +
  • 0 - verbose
  • +
  • 1 - more verbose
  • +
  • 2 - even more verbose
  • +
+
Parameters
+ + +
[in]levelDesired level of verbosity.
+
+
+ +

Definition at line 654 of file trap.c.

+ +
+
+ +

◆ trap_terminate()

+ +
+
+ + + + + + + +
int trap_terminate ()
+
+

Function to terminate module's operation. This function stops all read/write operations on all interfaces. Any waiting in trap_recv() and trap_send()_data is interrupted and these functions return immediately with TRAP_E_TERMINATED. Any call of trap_recv() or trap_send() after call of this function returns TRAP_E_TERMINATED.

+

This function is used to terminate module's operation (asynchronously), e.g. in SIGTERM handler.

Returns
Always TRAP_E_OK (0).
+ +

Definition at line 563 of file trap.c.

+ +
+
+

Variable Documentation

+ +

◆ trap_last_error

+ +
+
+ + + + +
int trap_last_error
+
+ +

Code of last error (one of the codes above)

+ +

Definition at line 123 of file trap.c.

+ +
+
+ +

◆ trap_last_error_msg

+ +
+
+ + + + +
const char* trap_last_error_msg
+
+ +

Human-readable message about last error.

+ +

Definition at line 125 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__simpleapi.map b/doc/libtrap-devel/group__simpleapi.map new file mode 100644 index 00000000..c22508b4 --- /dev/null +++ b/doc/libtrap-devel/group__simpleapi.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__simpleapi.md5 b/doc/libtrap-devel/group__simpleapi.md5 new file mode 100644 index 00000000..a8e15fba --- /dev/null +++ b/doc/libtrap-devel/group__simpleapi.md5 @@ -0,0 +1 @@ +3cc7aa54a333b3ddf7d4d3c59ff46cae \ No newline at end of file diff --git a/doc/libtrap-devel/group__simpleapi.png b/doc/libtrap-devel/group__simpleapi.png new file mode 100644 index 00000000..46768cde Binary files /dev/null and b/doc/libtrap-devel/group__simpleapi.png differ diff --git a/doc/libtrap-devel/group__supervisor.html b/doc/libtrap-devel/group__supervisor.html new file mode 100644 index 00000000..42d91222 --- /dev/null +++ b/doc/libtrap-devel/group__supervisor.html @@ -0,0 +1,336 @@ + + + + + + + +Libtrap: Internal development docs: Supervisor monitoring feature + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Supervisor monitoring feature
+
+
+ + + + +

+Data Structures

struct  msg_header_s
 
+ + + +

+Typedefs

typedef struct msg_header_s msg_header_t
 
+ + + + + + + + + + + + + + + +

+Functions

int service_get_data (int sock_d, uint32_t size, void **data)
 
int service_send_data (int sock_d, uint32_t size, void **data)
 
int encode_cnts_to_json (char **data, trap_ctx_priv_t *ctx)
 
void * service_thread_routine (void *arg)
 
void trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path)
 Create dump files. More...
 
int trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx)
 Get number of connected clients. More...
 
+

Detailed Description

+

Typedef Documentation

+ +

◆ msg_header_t

+ +
+
+ + + + +
typedef struct msg_header_s msg_header_t
+
+ +
+
+

Function Documentation

+ +

◆ encode_cnts_to_json()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int encode_cnts_to_json (char ** data,
trap_ctx_priv_tctx 
)
+
+ +

Definition at line 2192 of file trap.c.

+ +
+
+ +

◆ service_get_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int service_get_data (int sock_d,
uint32_t size,
void ** data 
)
+
+ +

Definition at line 2141 of file trap.c.

+ +
+
+ +

◆ service_send_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int service_send_data (int sock_d,
uint32_t size,
void ** data 
)
+
+ +

Definition at line 2168 of file trap.c.

+ +
+
+ +

◆ service_thread_routine()

+ +
+
+ + + + + + + + +
void * service_thread_routine (void * arg)
+
+

Service IFC thread function.

+

This function is run in separate thread. It waits for incoming connections e.g. from supervisor. Service IFC can send IFC counters declared in trap_ctx_priv_s

Parameters
+ + +
[in]argPointer to the private libtrap context data (trap_ctx_init()).
+
+
+ +

Definition at line 2294 of file trap.c.

+ +
+
+ +

◆ trap_ctx_create_ifc_dump()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_create_ifc_dump (trap_ctx_tctx,
const char * path 
)
+
+ +

Create dump files.

+

Create dump files for debug as follows: trap-i[number]-config.txt Output interface configuration. trap-i[number]-buffer.dat Output interface buffer trap-o[number]-config.txt Input interface configuration. trap-o[number]-buffer.dat Input interface buffer

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]pathOutput directory, if NULL use current working directory.
+
+
+ +

Definition at line 2473 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_client_count()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_get_client_count (trap_ctx_tctx,
uint32_t ifcidx 
)
+
+ +

Get number of connected clients.

+

Output interface (TCP or UNIX) allows to send messages to multiple clients. This function reads number of connected clients from internal interface structure.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcidxIFC Index of output interface.
+
+
+
Returns
Number of connected clients. -1 on error.
+ +

Definition at line 2495 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tcpip__ifc.html b/doc/libtrap-devel/group__tcpip__ifc.html new file mode 100644 index 00000000..81ac670a --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__ifc.html @@ -0,0 +1,371 @@ + + + + + + + +Libtrap: Internal development docs: TCP/IP and UNIX socket communication interface module + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
TCP/IP and UNIX socket communication interface module
+
+
+
+Collaboration diagram for TCP/IP and UNIX socket communication interface module:
+
+
+ + + + + +
+
+ + + + + + +

+Modules

 TCPIP output IFC
 
 TCPIP input IFC
 
+ + + +

+Data Structures

union  tcpip_socket_addr
 
+ + + + + + + + + + + + + + + +

+Macros

#define MAX_RECOVERY_TRY   10
 
#define RECOVERY_WAIT_USEC   500000
 
#define USEC_IN_SEC   1000000
 
#define ACK_MESS_SIZE   1
 
#define CRIT_1VS2SEND   10000
 
#define MAX(a, b)   ((a)<(b)?(b):(a))
 
#define MIN(a, b)   ((a)>(b)?(b):(a))
 
+ + + + + + + + + +

+Functions

char *trap_default_socket_path_format __attribute__ ((used))
 
static void * get_in_addr (struct sockaddr *sa)
 Get sockaddr, IPv4 or IPv6. More...
 
static int check_portrange (const char *port)
 Check if the given port is a correct port number. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ ACK_MESS_SIZE

+ +
+
+ + + + +
#define ACK_MESS_SIZE   1
+
+ +

Definition at line 86 of file ifc_tcpip.c.

+ +
+
+ +

◆ CRIT_1VS2SEND

+ +
+
+ + + + +
#define CRIT_1VS2SEND   10000
+
+ +

Definition at line 87 of file ifc_tcpip.c.

+ +
+
+ +

◆ MAX

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define MAX( a,
 
)   ((a)<(b)?(b):(a))
+
+ +

Definition at line 89 of file ifc_tcpip.c.

+ +
+
+ +

◆ MAX_RECOVERY_TRY

+ +
+
+ + + + +
#define MAX_RECOVERY_TRY   10
+
+ +

Definition at line 82 of file ifc_tcpip.c.

+ +
+
+ +

◆ MIN

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define MIN( a,
 
)   ((a)>(b)?(b):(a))
+
+ +

Definition at line 92 of file ifc_tcpip.c.

+ +
+
+ +

◆ RECOVERY_WAIT_USEC

+ +
+
+ + + + +
#define RECOVERY_WAIT_USEC   500000
+
+ +

Definition at line 84 of file ifc_tcpip.c.

+ +
+
+ +

◆ USEC_IN_SEC

+ +
+
+ + + + +
#define USEC_IN_SEC   1000000
+
+ +

Definition at line 85 of file ifc_tcpip.c.

+ +
+
+

Function Documentation

+ +

◆ __attribute__()

+ +
+
+ + + + + + + + +
char* trap_default_socket_path_format __attribute__ ((used) )
+
+

Unix sockets for service IFC and UNIX IFC have default path format defined by UNIX_PATH_FILENAME_FORMAT

+ +
+
+ +

◆ check_portrange()

+ +
+
+ + + + + +
+ + + + + + + + +
static int check_portrange (const char * port)
+
+static
+
+ +

Check if the given port is a correct port number.

+

Port number for TCP socket must be a number in the range from 1 to 65535. It can also be a service name that is translated by getaddrinfo().

+
Parameters
+ + +
[in]portPort to check.
+
+
+
Returns
EXIT_FAILURE if port is not given or it is a number < 1 or > 65535; EXIT_SUCCESS when port is a valid number or it is a service name.
+ +

Definition at line 138 of file ifc_tcpip.c.

+ +
+
+ +

◆ get_in_addr()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* get_in_addr (struct sockaddr * sa)
+
+static
+
+ +

Get sockaddr, IPv4 or IPv6.

+
Parameters
+ + +
[in]sastructure with input socket address
+
+
+
Returns
converted ponter to address
+ +

Definition at line 119 of file ifc_tcpip.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tcpip__ifc.map b/doc/libtrap-devel/group__tcpip__ifc.map new file mode 100644 index 00000000..152a86de --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__ifc.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/group__tcpip__ifc.md5 b/doc/libtrap-devel/group__tcpip__ifc.md5 new file mode 100644 index 00000000..17180779 --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__ifc.md5 @@ -0,0 +1 @@ +5f27b7af7adecabdfa0990b6bfd31e44 \ No newline at end of file diff --git a/doc/libtrap-devel/group__tcpip__ifc.png b/doc/libtrap-devel/group__tcpip__ifc.png new file mode 100644 index 00000000..2238bb25 Binary files /dev/null and b/doc/libtrap-devel/group__tcpip__ifc.png differ diff --git a/doc/libtrap-devel/group__tcpip__receiver.html b/doc/libtrap-devel/group__tcpip__receiver.html new file mode 100644 index 00000000..d85663cf --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__receiver.html @@ -0,0 +1,654 @@ + + + + + + + +Libtrap: Internal development docs: TCPIP input IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for TCPIP input IFC:
+
+
+ + + +
+
+ + + + +

+Data Structures

struct  tcpip_receiver_private_s
 
+ + + +

+Typedefs

typedef struct tcpip_receiver_private_s tcpip_receiver_private_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static int receive_part (void *priv, void **data, uint32_t *size, struct timeval *tm)
 
static uint64_t get_cur_timestamp ()
 
int tcpip_receiver_recv (void *priv, void *data, uint32_t *size, int timeout)
 Receive data from interface. More...
 
void tcpip_receiver_terminate (void *priv)
 Set interface state as terminated. More...
 
void tcpip_receiver_destroy (void *priv)
 Destructor of TCPIP receiver (input ifc) More...
 
static void tcpip_receiver_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tcpip_recv_ifc_get_id (void *priv)
 
uint8_t tcpip_recv_ifc_is_conn (void *priv)
 
int create_tcpip_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
static int wait_for_connection (int sock, struct timeval *tv)
 
static void client_socket_disconnect (void *priv)
 
static int client_socket_connect (void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv)
 client_socket is used as a receiver More...
 
+

Detailed Description

+

Typedef Documentation

+ +

◆ tcpip_receiver_private_t

+ +
+
+ +
+
+

Function Documentation

+ +

◆ client_socket_connect()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int client_socket_connect (void * priv,
const char * dest_addr,
const char * dest_port,
int * socket_descriptor,
struct timeval * tv 
)
+
+static
+
+ +

client_socket is used as a receiver

+
Parameters
+ + + + + + +
[in]privpointer to module private data
[in]dest_addrdestination address where to connect and where receive
[in]dest_portdestination port where to connect and where receive
[out]socket_descriptorsocket descriptor of established connection
[in]tvtimeout
+
+
+
Returns
TRAP_E_OK on success
+

Input interface negotiation

+ +

Definition at line 804 of file ifc_tcpip.c.

+ +
+
+ +

◆ client_socket_disconnect()

+ +
+
+ + + + + +
+ + + + + + + + +
static void client_socket_disconnect (void * priv)
+
+static
+
+

Disconnect from output IFC.

+
Parameters
+ + +
[in,out]privpointer to private structure of input IFC (client)
+
+
+ +

Definition at line 751 of file ifc_tcpip.c.

+ +
+
+ +

◆ create_tcpip_receiver_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_tcpip_receiver_ifc (trap_ctx_priv_tctx,
char * params,
trap_input_ifc_tifc,
uint32_t idx,
enum tcpip_ifc_sockettype type 
)
+
+ +

Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface.

+
Parameters
+ + + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing space separated values of these parameters (in this exact order): dest_addr dest_port, where dest_addr is destination address of output TCP/IP IFC module and dest_port is the port where sender is listening.
[in,out]ifcIFC interface used for calling TCP/IP module.
[in]idxIndex of IFC that is created.
[in]typeSelect the type of socket (see tcpip_ifc_sockettype for options).
+
+
+
Returns
0 on success (TRAP_E_OK)
+ +

Definition at line 636 of file ifc_tcpip.c.

+ +
+
+ +

◆ get_cur_timestamp()

+ +
+
+ + + + + +
+ + + + + + + +
static uint64_t get_cur_timestamp ()
+
+inlinestatic
+
+

Return current time in microseconds.

+

This is used to get current timestamp in tcpip_receiver_recv() and tcpip_sender_send().

+
Returns
current timestamp
+ +

Definition at line 258 of file ifc_tcpip.c.

+ +
+
+ +

◆ receive_part()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int receive_part (void * priv,
void ** data,
uint32_t * size,
struct timeval * tm 
)
+
+static
+
+

Receive chunk of data.

+

Caller is responsible for checking elapsed time, since this function may finished before the given timeout without having data.

+
Parameters
+ + + + + +
[in]privprivate IFC data
[out]datareceived data
[in,out]sizeexpected size to wait for, it is used to return size that was not read
[in]tmtimeout
+
+
+ +

Definition at line 177 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_receiver_create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void tcpip_receiver_create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Definition at line 541 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_receiver_destroy()

+ +
+
+ + + + + + + + +
void tcpip_receiver_destroy (void * priv)
+
+ +

Destructor of TCPIP receiver (input ifc)

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 520 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_receiver_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int tcpip_receiver_recv (void * priv,
void * data,
uint32_t * size,
int timeout 
)
+
+ +

Receive data from interface.

+

It is expected that data is always the same pointer because it is buffer given by trap.c.

+

This function contains finite state machine that controls receiving messages (header and payload), handles timeouts and sleep (to offload CPU during waiting for connection). The transition graph is:

+dot_inline_dotgraph_1.png + +
+
Parameters
+ + + + + +
[in,out]privprivate configuration structure
[out]datawhere received data are stored
[out]sizesize of received data
[in]timeouttimeout in usec, can be TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT
+
+
+
Returns
TRAP_E_OK (0) on success
+

messageframe contains header that is read (even partially) in HEAD_WAIT

+ +

Definition at line 302 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_receiver_terminate()

+ +
+
+ + + + + + + + +
void tcpip_receiver_terminate (void * priv)
+
+ +

Set interface state as terminated.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 504 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_recv_ifc_get_id()

+ +
+
+ + + + + + + + +
char* tcpip_recv_ifc_get_id (void * priv)
+
+ +

Definition at line 598 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_recv_ifc_is_conn()

+ +
+
+ + + + + + + + +
uint8_t tcpip_recv_ifc_is_conn (void * priv)
+
+ +

Definition at line 611 of file ifc_tcpip.c.

+ +
+
+ +

◆ wait_for_connection()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int wait_for_connection (int sock,
struct timeval * tv 
)
+
+static
+
+

Function waits for non-blocking connect().

+
Parameters
+ + + +
[in]socksocket descriptor of client
[in]tvtimeout
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_TIMEOUT on error (can be caused by interrupt)
+ +

Definition at line 769 of file ifc_tcpip.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tcpip__receiver.map b/doc/libtrap-devel/group__tcpip__receiver.map new file mode 100644 index 00000000..ab45af26 --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__receiver.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__tcpip__receiver.md5 b/doc/libtrap-devel/group__tcpip__receiver.md5 new file mode 100644 index 00000000..ce2674bf --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__receiver.md5 @@ -0,0 +1 @@ +4114603b77a2574c3b8cd07f3f324d87 \ No newline at end of file diff --git a/doc/libtrap-devel/group__tcpip__receiver.png b/doc/libtrap-devel/group__tcpip__receiver.png new file mode 100644 index 00000000..2d972cca Binary files /dev/null and b/doc/libtrap-devel/group__tcpip__receiver.png differ diff --git a/doc/libtrap-devel/group__tcpip__sender.html b/doc/libtrap-devel/group__tcpip__sender.html new file mode 100644 index 00000000..a0c76603 --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__sender.html @@ -0,0 +1,801 @@ + + + + + + + +Libtrap: Internal development docs: TCPIP output IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for TCPIP output IFC:
+
+
+ + + +
+
+ + + + + + + + +

+Data Structures

struct  client_s
 Structure for TCP/IP IFC client information. More...
 
struct  tcpip_sender_private_s
 Structure for TCP/IP IFC private information. More...
 
+ + + + + + + +

+Typedefs

typedef struct client_s client_t
 Structure for TCP/IP IFC client information. More...
 
typedef struct tcpip_sender_private_s tcpip_sender_private_t
 Structure for TCP/IP IFC private information. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static void disconnect_client (tcpip_sender_private_t *priv, int cl_id)
 This function is called when a client was/is being disconnected. More...
 
void tcpip_server_disconnect_all_clients (void *priv)
 Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More...
 
static void * accept_clients_thread (void *arg)
 This function runs in a separate thread and handles new client's connection requests. More...
 
static void finish_buffer (tcpip_sender_private_t *priv, buffer_t *buffer)
 Write buffer size to its header and shift active index. More...
 
void tcpip_sender_flush (void *priv)
 Force flush of active buffer. More...
 
static int send_data (tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id)
 Send data to client from his assigned buffer. More...
 
static void * sending_thread_func (void *priv)
 This function runs in a separate thread. It handles sending data to connected clients for TCPIP and UNIX interfaces. More...
 
int tcpip_sender_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. More...
 
void tcpip_sender_terminate (void *priv)
 Set interface state as terminated. More...
 
void tcpip_sender_destroy (void *priv)
 Destructor of TCP sender (output ifc) More...
 
int32_t tcpip_sender_get_client_count (void *priv)
 
int8_t tcpip_sender_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
static void tcpip_sender_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tcpip_send_ifc_get_id (void *priv)
 
int create_tcpip_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
static int server_socket_open (void *priv)
 Open TCPIP socket for sender module. More...
 
+

Detailed Description

+

Typedef Documentation

+ +

◆ client_t

+ +
+
+ + + + +
typedef struct client_s client_t
+
+ +

Structure for TCP/IP IFC client information.

+ +
+
+ +

◆ tcpip_sender_private_t

+ +
+
+ +

Structure for TCP/IP IFC private information.

+ +
+
+

Function Documentation

+ +

◆ accept_clients_thread()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* accept_clients_thread (void * arg)
+
+static
+
+ +

This function runs in a separate thread and handles new client's connection requests.

+
Parameters
+ + +
[in]argPointer to interface's private data structure.
+
+
+ +

Definition at line 1026 of file ifc_tcpip.c.

+ +
+
+ +

◆ create_tcpip_sender_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_tcpip_sender_ifc (trap_ctx_priv_tctx,
const char * params,
trap_output_ifc_tifc,
uint32_t idx,
enum tcpip_ifc_sockettype type 
)
+
+ +

Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface.

+
Parameters
+ + + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing interface specific parameters -
    +
  • tcp port/unix socket, max number of clients, buffer size, buffer count.
  • +
+
[in,out]ifcIFC interface used for calling TCP/IP module.
[in]idxIndex of IFC that is created.
[in]typeselect the type of socket (see tcpip_ifc_sockettype for options)
+
+
+
Returns
0 on success (TRAP_E_OK)
+ +

Definition at line 1730 of file ifc_tcpip.c.

+ +
+
+ +

◆ disconnect_client()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void disconnect_client (tcpip_sender_private_tpriv,
int cl_id 
)
+
+inlinestatic
+
+ +

This function is called when a client was/is being disconnected.

+
Parameters
+ + + +
[in]privPointer to interface's private data structure.
[in]cl_idIndex of the client in 'clients' array.
+
+
+ +

Definition at line 982 of file ifc_tcpip.c.

+ +
+
+ +

◆ finish_buffer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void finish_buffer (tcpip_sender_private_tpriv,
buffer_tbuffer 
)
+
+inlinestatic
+
+ +

Write buffer size to its header and shift active index.

+
Parameters
+ + + +
[in]privPointer to output interface private structure.
[in]bufferPointer to the buffer.
+
+
+ +

Definition at line 1144 of file ifc_tcpip.c.

+ +
+
+ +

◆ send_data()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int send_data (tcpip_sender_private_tpriv,
client_tc,
uint32_t cl_id 
)
+
+inlinestatic
+
+ +

Send data to client from his assigned buffer.

+
Parameters
+ + + + +
[in]privPointer to iterface's private data structure.
[in]cPointer to the client's structure.
[in]cl_idClient's index in the 'clients' array.
+
+
+
Returns
TRAP_E_OK successfully sent.
+
+TRAP_E_TERMINATED TRAP was terminated.
+
+TRAP_E_IO_ERROR send failed although TRAP was not terminated.
+ +

Definition at line 1190 of file ifc_tcpip.c.

+ +
+
+ +

◆ sending_thread_func()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* sending_thread_func (void * priv)
+
+static
+
+ +

This function runs in a separate thread. It handles sending data to connected clients for TCPIP and UNIX interfaces.

+
Parameters
+ + +
[in]privpointer to interface private data
+
+
+ +

Definition at line 1239 of file ifc_tcpip.c.

+ +
+
+ +

◆ server_socket_open()

+ +
+
+ + + + + +
+ + + + + + + + +
static int server_socket_open (void * priv)
+
+static
+
+ +

Open TCPIP socket for sender module.

+
Parameters
+ + +
[in]privtcpip_sender_private_t structure (private data)
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_IO_ERROR on error
+ +

Definition at line 1910 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_send_ifc_get_id()

+ +
+
+ + + + + + + + +
char* tcpip_send_ifc_get_id (void * priv)
+
+ +

Definition at line 1705 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void tcpip_sender_create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Definition at line 1654 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_destroy()

+ +
+
+ + + + + + + + +
void tcpip_sender_destroy (void * priv)
+
+ +

Destructor of TCP sender (output ifc)

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 1561 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_flush()

+ +
+
+ + + + + + + + +
void tcpip_sender_flush (void * priv)
+
+ +

Force flush of active buffer.

+
Parameters
+ + +
[in]privpointer to interface private data
+
+
+ +

Definition at line 1168 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_get_client_count()

+ +
+
+ + + + + + + + +
int32_t tcpip_sender_get_client_count (void * priv)
+
+ +

Definition at line 1616 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_get_client_stats_json()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int8_t tcpip_sender_get_client_stats_json (void * priv,
json_t * client_stats_arr 
)
+
+ +

Definition at line 1627 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int tcpip_sender_send (void * priv,
const void * data,
uint16_t size,
int timeout 
)
+
+ +

Store message into buffer.

+
Parameters
+ + + + + +
[in]privpointer to module private data
[in]datapointer to data to write
[in]sizesize of data to write
[in]timeoutmaximum time spent waiting for the message to be stored [microseconds]
+
+
+
Returns
TRAP_E_OK Success.
+
+TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
+
+TRAP_E_TERMINATED Libtrap was terminated during the process.
+ +

Definition at line 1434 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_sender_terminate()

+ +
+
+ + + + + + + + +
void tcpip_sender_terminate (void * priv)
+
+ +

Set interface state as terminated.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 1531 of file ifc_tcpip.c.

+ +
+
+ +

◆ tcpip_server_disconnect_all_clients()

+ +
+
+ + + + + + + + +
void tcpip_server_disconnect_all_clients (void * priv)
+
+ +

Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter.

+
Parameters
+ + +
[in]privPointer to output interface private structure.
+
+
+ +

Definition at line 1009 of file ifc_tcpip.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tcpip__sender.map b/doc/libtrap-devel/group__tcpip__sender.map new file mode 100644 index 00000000..892c2ec0 --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__sender.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__tcpip__sender.md5 b/doc/libtrap-devel/group__tcpip__sender.md5 new file mode 100644 index 00000000..b8840d13 --- /dev/null +++ b/doc/libtrap-devel/group__tcpip__sender.md5 @@ -0,0 +1 @@ +ff7a295cd9709e4c1b585fd892351aee \ No newline at end of file diff --git a/doc/libtrap-devel/group__tcpip__sender.png b/doc/libtrap-devel/group__tcpip__sender.png new file mode 100644 index 00000000..7948ac60 Binary files /dev/null and b/doc/libtrap-devel/group__tcpip__sender.png differ diff --git a/doc/libtrap-devel/group__tls__ifc.html b/doc/libtrap-devel/group__tls__ifc.html new file mode 100644 index 00000000..d2bc2c20 --- /dev/null +++ b/doc/libtrap-devel/group__tls__ifc.html @@ -0,0 +1,523 @@ + + + + + + + +Libtrap: Internal development docs: TLS communication interface module + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
TLS communication interface module
+
+
+
+Collaboration diagram for TLS communication interface module:
+
+
+ + + + + +
+
+ + + + + + +

+Modules

 TLS Output IFC
 
 TLS Input IFC
 
+ + + +

+Data Structures

union  tls_socket_addr
 
+ + + + + + + + + + + + + + + +

+Macros

#define MAX_RECOVERY_TRY   10
 
#define RECOVERY_WAIT_USEC   500000
 
#define USEC_IN_SEC   1000000
 
#define ACK_MESS_SIZE   1
 
#define CRIT_1VS2SEND   10000
 
#define MAX(a, b)   ((a)<(b)?(b):(a))
 
#define MIN(a, b)   ((a)>(b)?(b):(a))
 
+ + + + + + + + + + + + + + + + + +

+Functions

static SSL_CTX * tlsserver_create_context ()
 
static SSL_CTX * tlsclient_create_context ()
 
static int verify_certificate (SSL *arg)
 Verify context of ssl. More...
 
static int tls_server_configure_ctx (const char *cert, SSL_CTX *ctx)
 Configure context of ssl server. More...
 
static int tls_configure_ctx (SSL_CTX *ctx, const char *key, const char *crt, const char *ca)
 Configure ssl context of new connection. More...
 
static void * get_in_addr (struct sockaddr *sa)
 Get sockaddr, IPv4 or IPv6. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ ACK_MESS_SIZE

+ +
+
+ + + + +
#define ACK_MESS_SIZE   1
+
+ +

Definition at line 93 of file ifc_tls.c.

+ +
+
+ +

◆ CRIT_1VS2SEND

+ +
+
+ + + + +
#define CRIT_1VS2SEND   10000
+
+ +

Definition at line 94 of file ifc_tls.c.

+ +
+
+ +

◆ MAX

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define MAX( a,
 
)   ((a)<(b)?(b):(a))
+
+ +

Definition at line 96 of file ifc_tls.c.

+ +
+
+ +

◆ MAX_RECOVERY_TRY

+ +
+
+ + + + +
#define MAX_RECOVERY_TRY   10
+
+ +

Definition at line 89 of file ifc_tls.c.

+ +
+
+ +

◆ MIN

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define MIN( a,
 
)   ((a)>(b)?(b):(a))
+
+ +

Definition at line 99 of file ifc_tls.c.

+ +
+
+ +

◆ RECOVERY_WAIT_USEC

+ +
+
+ + + + +
#define RECOVERY_WAIT_USEC   500000
+
+ +

Definition at line 91 of file ifc_tls.c.

+ +
+
+ +

◆ USEC_IN_SEC

+ +
+
+ + + + +
#define USEC_IN_SEC   1000000
+
+ +

Definition at line 92 of file ifc_tls.c.

+ +
+
+

Function Documentation

+ +

◆ get_in_addr()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* get_in_addr (struct sockaddr * sa)
+
+static
+
+ +

Get sockaddr, IPv4 or IPv6.

+
Parameters
+ + +
[in]sastructure with input socket address
+
+
+
Returns
converted ponter to address
+ +

Definition at line 263 of file ifc_tls.c.

+ +
+
+ +

◆ tls_configure_ctx()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int tls_configure_ctx (SSL_CTX * ctx,
const char * key,
const char * crt,
const char * ca 
)
+
+static
+
+ +

Configure ssl context of new connection.

+
Parameters
+ + + + + +
[in]ctxssl context to be configured
[in]keypath to keyfile
[in]crtpath to certfile
[in]capath to CA file
+
+
+
Returns
1 on failure, 0 on success Loading certificate and key to SSL_CTX. Setting location of CA that is used for verification of incomming certificates. Also forcing peer to send it's certificate.
+ +

Definition at line 210 of file ifc_tls.c.

+ +
+
+ +

◆ tls_server_configure_ctx()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int tls_server_configure_ctx (const char * cert,
SSL_CTX * ctx 
)
+
+static
+
+ +

Configure context of ssl server.

+
Parameters
+ + + +
[in]certpath to certfile
[in]ctxssl context to be configured
+
+
+
Returns
1 on failure, 0 on success Disabling undesired versions of TLS/SSL and adding supported CAs to SSL_CTX.
+ +

Definition at line 175 of file ifc_tls.c.

+ +
+
+ +

◆ tlsclient_create_context()

+ +
+
+ + + + + +
+ + + + + + + +
static SSL_CTX* tlsclient_create_context ()
+
+static
+
+ +

Definition at line 125 of file ifc_tls.c.

+ +
+
+ +

◆ tlsserver_create_context()

+ +
+
+ + + + + +
+ + + + + + + +
static SSL_CTX* tlsserver_create_context ()
+
+static
+
+ +

Definition at line 102 of file ifc_tls.c.

+ +
+
+ +

◆ verify_certificate()

+ +
+
+ + + + + +
+ + + + + + + + +
static int verify_certificate (SSL * arg)
+
+static
+
+ +

Verify context of ssl.

+
Parameters
+ + +
[in]argpointer to SSL (usually stored in tls_receiver_private_t resp. in an array of tlsclient_s inside tls_sender_private_t for input resp. output IFC)
+
+
+
Returns
1 on failure, 0 on success Disabling undesired versions of TLS/SSL and adding supported CAs to SSL_CTX.
+ +

Definition at line 147 of file ifc_tls.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tls__ifc.map b/doc/libtrap-devel/group__tls__ifc.map new file mode 100644 index 00000000..df762e59 --- /dev/null +++ b/doc/libtrap-devel/group__tls__ifc.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/group__tls__ifc.md5 b/doc/libtrap-devel/group__tls__ifc.md5 new file mode 100644 index 00000000..e27c2038 --- /dev/null +++ b/doc/libtrap-devel/group__tls__ifc.md5 @@ -0,0 +1 @@ +a92e428a827ddc07214444f83d4a82d1 \ No newline at end of file diff --git a/doc/libtrap-devel/group__tls__ifc.png b/doc/libtrap-devel/group__tls__ifc.png new file mode 100644 index 00000000..384c9721 Binary files /dev/null and b/doc/libtrap-devel/group__tls__ifc.png differ diff --git a/doc/libtrap-devel/group__tls__receiver.html b/doc/libtrap-devel/group__tls__receiver.html new file mode 100644 index 00000000..b64e3ded --- /dev/null +++ b/doc/libtrap-devel/group__tls__receiver.html @@ -0,0 +1,593 @@ + + + + + + + +Libtrap: Internal development docs: TLS Input IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for TLS Input IFC:
+
+
+ + + +
+
+ + + + +

+Data Structures

struct  tls_receiver_private_s
 
+ + + +

+Typedefs

typedef struct tls_receiver_private_s tls_receiver_private_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static int receive_part (void *priv, void **data, uint32_t *size, struct timeval *tm)
 
int tls_receiver_recv (void *priv, void *data, uint32_t *size, int timeout)
 Receive data from interface. More...
 
void tls_receiver_terminate (void *priv)
 Set interface state as terminated. More...
 
void tls_receiver_destroy (void *priv)
 Destructor of TLS receiver (input ifc) More...
 
static void tls_receiver_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tls_recv_ifc_get_id (void *priv)
 
uint8_t tls_recv_ifc_is_conn (void *priv)
 
int create_tls_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
static int wait_for_connection (int sock, struct timeval *tv)
 
static void client_socket_disconnect (void *priv)
 
static int client_socket_connect (tls_receiver_private_t *c, struct timeval *tv)
 client_socket is used as a receiver More...
 
+

Detailed Description

+

Typedef Documentation

+ +

◆ tls_receiver_private_t

+ +
+
+ +
+
+

Function Documentation

+ +

◆ client_socket_connect()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int client_socket_connect (tls_receiver_private_tc,
struct timeval * tv 
)
+
+static
+
+ +

client_socket is used as a receiver

+
Parameters
+ + + +
[in]cpointer to module private data
[in]tvtimeout
+
+
+
Returns
TRAP_E_OK on success
+

Input interface negotiation

+ +

Definition at line 941 of file ifc_tls.c.

+ +
+
+ +

◆ client_socket_disconnect()

+ +
+
+ + + + + +
+ + + + + + + + +
static void client_socket_disconnect (void * priv)
+
+static
+
+

Disconnect from output IFC.

+
Parameters
+ + +
[in,out]privpointer to private structure of input IFC (client)
+
+
+ +

Definition at line 892 of file ifc_tls.c.

+ +
+
+ +

◆ create_tls_receiver_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_tls_receiver_ifc (trap_ctx_priv_tctx,
char * params,
trap_input_ifc_tifc,
uint32_t idx 
)
+
+ +

Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing space separated values of these parameters (in this exact order): dest_addr dest_port, where dest_addr is destination address of output TCP/IP IFC module and dest_port is the port where sender is listening.
[in,out]ifcIFC interface used for calling TCP/IP module.
[in]idxIndex of IFC that is created.
+
+
+
Returns
0 on success (TRAP_E_OK)
+ +

Definition at line 738 of file ifc_tls.c.

+ +
+
+ +

◆ receive_part()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int receive_part (void * priv,
void ** data,
uint32_t * size,
struct timeval * tm 
)
+
+static
+
+

Receive data

Parameters
+ + + + + +
[in]privprivate IFC data
[out]datareceived data
[in,out]sizeexpected size to wait for, it is used to return size that was not read
[in]tmtimeout
+
+
+
Todo:
continue with timeout minus time already waited
+ +

Definition at line 286 of file ifc_tls.c.

+ +
+
+ +

◆ tls_receiver_create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void tls_receiver_create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Definition at line 643 of file ifc_tls.c.

+ +
+
+ +

◆ tls_receiver_destroy()

+ +
+
+ + + + + + + + +
void tls_receiver_destroy (void * priv)
+
+ +

Destructor of TLS receiver (input ifc)

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 622 of file ifc_tls.c.

+ +
+
+ +

◆ tls_receiver_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int tls_receiver_recv (void * priv,
void * data,
uint32_t * size,
int timeout 
)
+
+ +

Receive data from interface.

+

It is expected that data is always the same pointer because it is buffer given by trap.c.

+

This function contains finite state machine that controls receiving messages (header and payload), handles timeouts and sleep (to offload CPU during waiting for connection). The transition graph is:

+dot_inline_dotgraph_2.png + +
+
Parameters
+ + + + + +
[in,out]privprivate configuration structure
[out]datawhere received data are stored
[out]sizesize of received data
[in]timeouttimeout in usec, can be TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT
+
+
+
Returns
TRAP_E_OK (0) on success
+

messageframe contains header that is read (even partially) in HEAD_WAIT

+ +

Definition at line 395 of file ifc_tls.c.

+ +
+
+ +

◆ tls_receiver_terminate()

+ +
+
+ + + + + + + + +
void tls_receiver_terminate (void * priv)
+
+ +

Set interface state as terminated.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 606 of file ifc_tls.c.

+ +
+
+ +

◆ tls_recv_ifc_get_id()

+ +
+
+ + + + + + + + +
char* tls_recv_ifc_get_id (void * priv)
+
+ +

Definition at line 701 of file ifc_tls.c.

+ +
+
+ +

◆ tls_recv_ifc_is_conn()

+ +
+
+ + + + + + + + +
uint8_t tls_recv_ifc_is_conn (void * priv)
+
+ +

Definition at line 714 of file ifc_tls.c.

+ +
+
+ +

◆ wait_for_connection()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int wait_for_connection (int sock,
struct timeval * tv 
)
+
+static
+
+

Function waits for non-blocking connect().

+
Parameters
+ + + +
[in]socksocket descriptor of client
[in]tvtimeout
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_TIMEOUT on error (can be caused by interrupt)
+ +

Definition at line 912 of file ifc_tls.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tls__receiver.map b/doc/libtrap-devel/group__tls__receiver.map new file mode 100644 index 00000000..262bcc7a --- /dev/null +++ b/doc/libtrap-devel/group__tls__receiver.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__tls__receiver.md5 b/doc/libtrap-devel/group__tls__receiver.md5 new file mode 100644 index 00000000..7847804d --- /dev/null +++ b/doc/libtrap-devel/group__tls__receiver.md5 @@ -0,0 +1 @@ +0373dc93a983ccf939eca1aa7ea6508f \ No newline at end of file diff --git a/doc/libtrap-devel/group__tls__receiver.png b/doc/libtrap-devel/group__tls__receiver.png new file mode 100644 index 00000000..d9af7fce Binary files /dev/null and b/doc/libtrap-devel/group__tls__receiver.png differ diff --git a/doc/libtrap-devel/group__tls__sender.html b/doc/libtrap-devel/group__tls__sender.html new file mode 100644 index 00000000..39a3fa23 --- /dev/null +++ b/doc/libtrap-devel/group__tls__sender.html @@ -0,0 +1,824 @@ + + + + + + + +Libtrap: Internal development docs: TLS Output IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for TLS Output IFC:
+
+
+ + + +
+
+ + + + + + + + +

+Data Structures

struct  tlsclient_s
 Structure for TLS IFC client information. More...
 
struct  tls_sender_private_s
 Structure for TLS IFC private information. More...
 
+ + + + + + + +

+Typedefs

typedef struct tlsclient_s tlsclient_t
 Structure for TLS IFC client information. More...
 
typedef struct tls_sender_private_s tls_sender_private_t
 Structure for TLS IFC private information. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static void disconnect_client (tls_sender_private_t *priv, int cl_id)
 This function is called when a client was/is being disconnected. More...
 
void tls_server_disconnect_all_clients (void *priv)
 Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More...
 
static uint64_t get_cur_timestamp ()
 
static void * accept_clients_thread (void *arg)
 This function runs in a separate thread and handles new client's connection requests. More...
 
static void finish_buffer (tls_sender_private_t *priv, buffer_t *buffer)
 Write buffer size to its header and shift active index. More...
 
void tls_sender_flush (void *priv)
 Force flush of active buffer. More...
 
static int send_data (tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id)
 Send data to client from his assigned buffer. More...
 
static void * sending_thread_func (void *priv)
 This function runs in a separate thread. It handles sending data to connected clients for TLS interface. More...
 
int tls_sender_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. More...
 
void tls_sender_terminate (void *priv)
 Set interface state as terminated. More...
 
void tls_sender_destroy (void *priv)
 Destructor of TCP sender (output ifc) More...
 
int32_t tls_sender_get_client_count (void *priv)
 
int8_t tls_sender_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
static void tls_sender_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tls_send_ifc_get_id (void *priv)
 
int create_tls_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
static int server_socket_open (void *priv)
 Open TLS socket for sender module. More...
 
+

Detailed Description

+

Typedef Documentation

+ +

◆ tls_sender_private_t

+ +
+
+ + + + +
typedef struct tls_sender_private_s tls_sender_private_t
+
+ +

Structure for TLS IFC private information.

+ +
+
+ +

◆ tlsclient_t

+ +
+
+ + + + +
typedef struct tlsclient_s tlsclient_t
+
+ +

Structure for TLS IFC client information.

+ +
+
+

Function Documentation

+ +

◆ accept_clients_thread()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* accept_clients_thread (void * arg)
+
+static
+
+ +

This function runs in a separate thread and handles new client's connection requests.

+
Parameters
+ + +
[in]argPointer to interface's private data structure.
+
+
+

Verifying SSL certificate of client.

+ +

Definition at line 1200 of file ifc_tls.c.

+ +
+
+ +

◆ create_tls_sender_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int create_tls_sender_ifc (trap_ctx_priv_tctx,
const char * params,
trap_output_ifc_tifc,
uint32_t idx 
)
+
+ +

Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing space separated values of these parameters (in this exact order): server_port max_clients, where dest_addr is destination address of output TCP/IP IFC module and dest_port is the port where sender is listening.
[in,out]ifcIFC interface used for calling TCP/IP module.
[in]idxIndex of IFC that is created.
+
+
+
Returns
0 on success (TRAP_E_OK)
+ +

Definition at line 1883 of file ifc_tls.c.

+ +
+
+ +

◆ disconnect_client()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void disconnect_client (tls_sender_private_tpriv,
int cl_id 
)
+
+inlinestatic
+
+ +

This function is called when a client was/is being disconnected.

+
Parameters
+ + + +
[in]privPointer to interface's private data structure.
[in]cl_idIndex of the client in 'clients' array.
+
+
+ +

Definition at line 1139 of file ifc_tls.c.

+ +
+
+ +

◆ finish_buffer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void finish_buffer (tls_sender_private_tpriv,
buffer_tbuffer 
)
+
+inlinestatic
+
+ +

Write buffer size to its header and shift active index.

+
Parameters
+ + + +
[in]privPointer to output interface private structure.
[in]bufferPointer to the buffer.
+
+
+ +

Definition at line 1334 of file ifc_tls.c.

+ +
+
+ +

◆ get_cur_timestamp()

+ +
+
+ + + + + +
+ + + + + + + +
static uint64_t get_cur_timestamp ()
+
+inlinestatic
+
+

Return current time in microseconds.

+

This is used to get current timestamp in tls_sender_send().

+
Returns
current timestamp
+ +

Definition at line 1186 of file ifc_tls.c.

+ +
+
+ +

◆ send_data()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int send_data (tls_sender_private_tpriv,
tlsclient_tc,
uint32_t cl_id 
)
+
+inlinestatic
+
+ +

Send data to client from his assigned buffer.

+
Parameters
+ + + + +
[in]privPointer to iterface's private data structure.
[in]cPointer to the client's structure.
[in]cl_idClient's index in the 'clients' array.
+
+
+
Returns
TRAP_E_OK successfully sent.
+
+TRAP_E_TERMINATED TRAP was terminated.
+
+TRAP_E_IO_ERROR send failed although TRAP was not terminated.
+ +

Definition at line 1385 of file ifc_tls.c.

+ +
+
+ +

◆ sending_thread_func()

+ +
+
+ + + + + +
+ + + + + + + + +
static void* sending_thread_func (void * priv)
+
+static
+
+ +

This function runs in a separate thread. It handles sending data to connected clients for TLS interface.

+
Parameters
+ + +
[in]privpointer to interface private data
+
+
+ +

Definition at line 1434 of file ifc_tls.c.

+ +
+
+ +

◆ server_socket_open()

+ +
+
+ + + + + +
+ + + + + + + + +
static int server_socket_open (void * priv)
+
+static
+
+ +

Open TLS socket for sender module.

+
Parameters
+ + +
[in]privtls_sender_private_t structure (private data)
+
+
+
Returns
0 on success (TRAP_E_OK), TRAP_E_IO_ERROR on error
+ +

Definition at line 2091 of file ifc_tls.c.

+ +
+
+ +

◆ tls_send_ifc_get_id()

+ +
+
+ + + + + + + + +
char* tls_send_ifc_get_id (void * priv)
+
+ +

Definition at line 1858 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void tls_sender_create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Definition at line 1809 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_destroy()

+ +
+
+ + + + + + + + +
void tls_sender_destroy (void * priv)
+
+ +

Destructor of TCP sender (output ifc)

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 1727 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_flush()

+ +
+
+ + + + + + + + +
void tls_sender_flush (void * priv)
+
+ +

Force flush of active buffer.

+
Parameters
+ + +
[in]privpointer to interface private data
+
+
+ +

Definition at line 1358 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_get_client_count()

+ +
+
+ + + + + + + + +
int32_t tls_sender_get_client_count (void * priv)
+
+ +

Definition at line 1771 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_get_client_stats_json()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int8_t tls_sender_get_client_stats_json (void * priv,
json_t * client_stats_arr 
)
+
+ +

Definition at line 1782 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int tls_sender_send (void * priv,
const void * data,
uint16_t size,
int timeout 
)
+
+ +

Store message into buffer.

+
Parameters
+ + + + + +
[in]privpointer to module private data
[in]datapointer to data to write
[in]sizesize of data to write
[in]timeoutmaximum time spent waiting for the message to be stored [microseconds]
+
+
+
Returns
TRAP_E_OK Success.
+
+TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
+
+TRAP_E_TERMINATED Libtrap was terminated during the process.
+ +

Definition at line 1600 of file ifc_tls.c.

+ +
+
+ +

◆ tls_sender_terminate()

+ +
+
+ + + + + + + + +
void tls_sender_terminate (void * priv)
+
+ +

Set interface state as terminated.

+
Parameters
+ + +
[in]privpointer to module private data
+
+
+ +

Definition at line 1697 of file ifc_tls.c.

+ +
+
+ +

◆ tls_server_disconnect_all_clients()

+ +
+
+ + + + + + + + +
void tls_server_disconnect_all_clients (void * priv)
+
+ +

Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter.

+
Parameters
+ + +
[in]privPointer to output interface private structure.
+
+
+ +

Definition at line 1167 of file ifc_tls.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__tls__sender.map b/doc/libtrap-devel/group__tls__sender.map new file mode 100644 index 00000000..5144dad3 --- /dev/null +++ b/doc/libtrap-devel/group__tls__sender.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__tls__sender.md5 b/doc/libtrap-devel/group__tls__sender.md5 new file mode 100644 index 00000000..76f46123 --- /dev/null +++ b/doc/libtrap-devel/group__tls__sender.md5 @@ -0,0 +1 @@ +f37950acb1aba1058957e47dc1cd8906 \ No newline at end of file diff --git a/doc/libtrap-devel/group__tls__sender.png b/doc/libtrap-devel/group__tls__sender.png new file mode 100644 index 00000000..a9205389 Binary files /dev/null and b/doc/libtrap-devel/group__tls__sender.png differ diff --git a/doc/libtrap-devel/group__trap__buffer__general.html b/doc/libtrap-devel/group__trap__buffer__general.html new file mode 100644 index 00000000..3e41caa5 --- /dev/null +++ b/doc/libtrap-devel/group__trap__buffer__general.html @@ -0,0 +1,290 @@ + + + + + + + +Libtrap: Internal development docs: General API + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
General API
+
+
+ + + + + + + + + + + + + + + + +

+Functions

trap_buffer_ttb_init (uint16_t nblocks, uint32_t blocksize)
 
void tb_destroy (trap_buffer_t **tb)
 
int tb_lock (trap_buffer_t *tb)
 
int tb_unlock (trap_buffer_t *tb)
 
int tb_block_lock (tb_block_t *bl)
 
int tb_block_unlock (tb_block_t *bl)
 
int tb_isblockfree (tb_block_t *bl)
 
+

Detailed Description

+

Function Documentation

+ +

◆ tb_block_lock()

+ +
+
+ + + + + + + + +
int tb_block_lock (tb_block_tbl)
+
+

Lock block before manipulation.

Parameters
+ + +
[in]blPointer to the TRAP buffer.
+
+
+ +

Definition at line 222 of file trap_buffer.c.

+ +
+
+ +

◆ tb_block_unlock()

+ +
+
+ + + + + + + + +
int tb_block_unlock (tb_block_tbl)
+
+

Unlock block after manipulation.

+ +

Definition at line 227 of file trap_buffer.c.

+ +
+
+ +

◆ tb_destroy()

+ +
+
+ + + + + + + + +
void tb_destroy (trap_buffer_t ** tb)
+
+

Free memory and set the pointer to NULL.

Parameters
+ + +
[in]tbPointer to the TRAP buffer.
+
+
+ +

Definition at line 191 of file trap_buffer.c.

+ +
+
+ +

◆ tb_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
trap_buffer_t* tb_init (uint16_t nblocks,
uint32_t blocksize 
)
+
+

Create a new buffer that will work wit nblocks of block_size.

Parameters
+ + + +
[in]nblocksNumber of blocks that will be stored in the ring buffer.
[in]blocksizeMaximal size of each block.
+
+
+
Returns
Pointer to the buffer struct, NULL on error.
+ +

Definition at line 146 of file trap_buffer.c.

+ +
+
+ +

◆ tb_isblockfree()

+ +
+
+ + + + + + + + +
int tb_isblockfree (tb_block_tbl)
+
+

Check if the current block is free.

+
Parameters
+ + +
[in]blPointer to the block.
+
+
+
Returns
TB_SUCCESS when the current block is free, TB_FULL if it contains at least one message.
+ +

Definition at line 137 of file trap_buffer.c.

+ +
+
+ +

◆ tb_lock()

+ +
+
+ + + + + + + + +
int tb_lock (trap_buffer_ttb)
+
+

Lock buffer before manipulation.

Parameters
+ + +
[in]tbPointer to the TRAP buffer.
+
+
+ +

Definition at line 212 of file trap_buffer.c.

+ +
+
+ +

◆ tb_unlock()

+ +
+
+ + + + + + + + +
int tb_unlock (trap_buffer_ttb)
+
+

Unlock buffer after manipulation.

Parameters
+ + +
[in]tbPointer to the TRAP buffer.
+
+
+ +

Definition at line 217 of file trap_buffer.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__buffer__recv.html b/doc/libtrap-devel/group__trap__buffer__recv.html new file mode 100644 index 00000000..cd5a3dc3 --- /dev/null +++ b/doc/libtrap-devel/group__trap__buffer__recv.html @@ -0,0 +1,296 @@ + + + + + + + +Libtrap: Internal development docs: Input IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Input IFC
+
+
+ + + + + + +

+Macros

#define TB_FILL_START(rdb, bl, res)
 
#define TB_FILL_END(rdb, bl, s)
 
+ + + + + + + +

+Functions

int tb_getmess (trap_buffer_t *tb, const void **data, uint16_t *size)
 
void tb_first_rd_block (trap_buffer_t *tb)
 
void tb_next_rd_block (trap_buffer_t *tb)
 
+

Detailed Description

+

A set of functions used for input IFC (module receives messages).

+

Macro Definition Documentation

+ +

◆ TB_FILL_END

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TB_FILL_END( rdb,
 bl,
 
)
+
+Value:
do { \
bl->data->size = s; \
bl->write_data += s; \
bl->read_data = bl->data->data; \
tb_block_unlock(bl); \
} while (0)

Unlock the current free block after writing its content.

+

It MUST NOT be called when TB_FILL_START() returned TB_FULL.

+
Parameters
+ + + + +
[in]rdbPointer to the buffer.
[in]blPointer to block (tb_block_t *bl).
[in]sSize of data written into the block. This will be set into header.
+
+
+ +

Definition at line 386 of file trap_buffer.h.

+ +
+
+ +

◆ TB_FILL_START

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TB_FILL_START( rdb,
 bl,
 res 
)
+
+Value:
do { \
tb_lock(rdb); \
(*bl) = rdb->cur_wr_block; \
tb_block_lock(*bl); \
if (tb_isblockfree(*bl) == TB_SUCCESS) { \
tb_next_wr_block(rdb); \
(res) = TB_SUCCESS; \
} else { \
/* current block is not free, we must unlock and wait */ \
tb_block_unlock(*bl); \
(res) = TB_FULL; \
} \
tb_unlock(rdb); \
} while (0)
#define TB_SUCCESS
Definition: trap_buffer.h:53
+
#define TB_FULL
Definition: trap_buffer.h:55
+
int tb_isblockfree(tb_block_t *bl)
Definition: trap_buffer.c:137
+

Lock the current free block for writing its content.

+

After this code, it is possible to write size and data into bl. See TB_FILL_END() for unlocking the block.

+

Pseudocode: trap_buffer_t *b = tb_init(10, 100000); tb_block_t *bl; TB_FILL_START(b, &bl, res); if (res == TB_SUCCESS) { s = recv(...); TB_FILL_END(b, bl, s); }

+
Parameters
+ + + + +
[in]rdbPointer to the buffer.
[out]blPointer to block (tb_block_t **bl).
[out]resResult of TB_FILL_START(), it is set to TB_SUCCESS or TB_FULL.
+
+
+ +

Definition at line 362 of file trap_buffer.h.

+ +
+
+

Function Documentation

+ +

◆ tb_first_rd_block()

+ +
+
+ + + + + + + + +
void tb_first_rd_block (trap_buffer_ttb)
+
+

Move to the first block for reading.

+

This function moves cur_block pointer to the first block.

Parameters
+ + +
[in]tbPointer to the buffer.
+
+
+ +

Definition at line 123 of file trap_buffer.c.

+ +
+
+ +

◆ tb_getmess()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int tb_getmess (trap_buffer_ttb,
const void ** data,
uint16_t * size 
)
+
+

Get message from buffer.

Parameters
+ + + + +
[in]tbPointer to the buffer.
[out]dataPointer to read message.
[out]sizeSize of read message.
+
+
+
Returns
TB_SUCCESS or TB_USED_NEWBLOCK when the message was read successfuly, TB_EMPTY when there is no message in the buffer to read. TB_USED_NEWBLOCK indicates that the current block was changed
+ +

Definition at line 323 of file trap_buffer.c.

+ +
+
+ +

◆ tb_next_rd_block()

+ +
+
+ + + + + + + + +
void tb_next_rd_block (trap_buffer_ttb)
+
+

Move to the next block for reading.

+

This function moves cur_block pointer to the next block (it overflows after nblocks).

Parameters
+ + +
[in]tbPointer to the buffer.
+
+
+ +

Definition at line 113 of file trap_buffer.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__buffer__send.html b/doc/libtrap-devel/group__trap__buffer__send.html new file mode 100644 index 00000000..b061ddbd --- /dev/null +++ b/doc/libtrap-devel/group__trap__buffer__send.html @@ -0,0 +1,386 @@ + + + + + + + +Libtrap: Internal development docs: Output IFC + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Output IFC
+
+
+ + + + + + +

+Macros

#define TB_FLUSH_START(wrb, bl, res)
 
#define TB_FLUSH_END(rdb, bl, s)
 
+ + + + + + + + + + + +

+Functions

int tb_pushmess (trap_buffer_t *tb, const void *data, uint16_t size)
 
int tb_pushmess2 (trap_buffer_t *tb, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
 
void tb_clear_unused (trap_buffer_t *tb)
 
void tb_next_wr_block (trap_buffer_t *tb)
 
void tb_first_wr_block (trap_buffer_t *tb)
 
+

Detailed Description

+

A set of functions used for output IFC (module sends messages).

+

Macro Definition Documentation

+ +

◆ TB_FLUSH_END

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TB_FLUSH_END( rdb,
 bl,
 
)
+
+Value:
do { \
if (bl->refcount == 0) { \
/* block can be marked as empty for next pushmess() */ \
bl->data->size = 0; \
tb_next_rd_block(rdb); \
} \
tb_block_unlock(bl); \
} while (0)

Unlock the current free block after writing its content.

+

It MUST NOT be called when TB_FILL_START() returned TB_FULL.

+
Parameters
+ + + + +
[in]rdbPointer to the buffer.
[in]blPointer to block (tb_block_t *bl).
[in]sSize of data written into the block. This will be set into header.
+
+
+ +

Definition at line 296 of file trap_buffer.h.

+ +
+
+ +

◆ TB_FLUSH_START

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TB_FLUSH_START( wrb,
 bl,
 res 
)
+
+Value:
do { \
tb_lock(wrb); \
(*bl) = wrb->cur_rd_block; \
tb_block_lock(*bl); \
if (tb_isblockfree(*bl) != TB_FULL) { \
/* current block is not free, we must unlock and wait */ \
tb_block_unlock(*bl); \
res = TB_EMPTY; \
} else { \
res = TB_FULL; \
} \
tb_unlock(wrb); \
} while (0)
#define TB_EMPTY
Definition: trap_buffer.h:57
+
#define TB_FULL
Definition: trap_buffer.h:55
+
int tb_isblockfree(tb_block_t *bl)
Definition: trap_buffer.c:137
+

Lock the current free block for getting its content.

+

After this code, it is possible to read size and data from bl. See TB_FLUSH_START() for unlocking the block.

+

Pseudocode: trap_buffer_t *b = tb_init(10, 100000); tb_block_t *bl; TB_FILL_START(b, &bl, res); if (res == TB_SUCCESS) { s = recv(...); TB_FILL_END(b, bl, s); }

+
Parameters
+ + + + +
[in]wrbPointer to the buffer.
[out]blPointer to block (tb_block_t **bl).
[out]resResult of TB_FILL_START(), it is set to TB_SUCCESS or TB_FULL.
+
+
+ +

Definition at line 273 of file trap_buffer.h.

+ +
+
+

Function Documentation

+ +

◆ tb_clear_unused()

+ +
+
+ + + + + + + + +
void tb_clear_unused (trap_buffer_ttb)
+
+

Go through all blocks and those which are not used (refcount) mark as free.

+
Parameters
+ + +
[in]tbPointer to the TRAP buffer.
+
+
+ +

Definition at line 357 of file trap_buffer.c.

+ +
+
+ +

◆ tb_first_wr_block()

+ +
+
+ + + + + + + + +
void tb_first_wr_block (trap_buffer_ttb)
+
+

Move to the first block for writing.

+

This function moves cur_block pointer to the first block.

Parameters
+ + +
[in]tbPointer to the TRAP buffer
+
+
+ +

Definition at line 130 of file trap_buffer.c.

+ +
+
+ +

◆ tb_next_wr_block()

+ +
+
+ + + + + + + + +
void tb_next_wr_block (trap_buffer_ttb)
+
+

Move to the next block for writing.

+

This function moves cur_block pointer to the next block (it overflows after nblocks).

Parameters
+ + +
[in]tbPointer to the TRAP buffer
+
+
+ +

Definition at line 103 of file trap_buffer.c.

+ +
+
+ +

◆ tb_pushmess()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int tb_pushmess (trap_buffer_ttb,
const void * data,
uint16_t size 
)
+
+

Push message into the current block

Parameters
+ + + + +
[in]tbPointer to the buffer.
[in]dataPointer to the message to send.
[in]sizeSize of the message to send.
+
+
+
Returns
TB_SUCCESS or TB_USED_NEWBLOCK when the message was stored successfuly, TB_FULL when there is no place for the message. TB_USED_NEWBLOCK indicates that the current block was changed. TB_ERROR means that size is bigger than block size.
+ +

Definition at line 262 of file trap_buffer.c.

+ +
+
+ +

◆ tb_pushmess2()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int tb_pushmess2 (trap_buffer_ttb,
const void * d1,
uint16_t s1,
const void * d2,
uint16_t s2 
)
+
+

Push message (consisting of d1 and d2 parts) into the current block

Parameters
+ + + + + + +
[in]tbPointer to the buffer.
[in]d1Pointer to the 1st part of the message to send.
[in]s1Size of the 1st part of the message to send.
[in]d2Pointer to the 2nd part of the message to send.
[in]s2Size of the 2nd part of the message to send.
+
+
+
Returns
TB_SUCCESS or TB_USED_NEWBLOCK when the message was stored successfuly, TB_FULL when there is no place for the message. TB_USED_NEWBLOCK indicates that the current block was changed. TB_ERROR means that size is bigger than block size.
+ +

Definition at line 291 of file trap_buffer.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__ifc.html b/doc/libtrap-devel/group__trap__ifc.html new file mode 100644 index 00000000..839cb9a8 --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc.html @@ -0,0 +1,271 @@ + + + + + + + +Libtrap: Internal development docs: TRAP communication module interface + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
TRAP communication module interface
+
+
+
+Collaboration diagram for TRAP communication module interface:
+
+
+ + + + + + +
+
+ + + + + + + + + + +

+Modules

 IFC API
 
 file interface module
 
 TCP/IP and UNIX socket communication interface module
 
 TLS communication interface module
 
+ + + + + +

+Data Structures

struct  trap_input_ifc_s
 
struct  trap_output_ifc_s
 
+ + + +

+Macros

#define TRAP_IFC_DEFAULT_MAX_CLIENTS   64
 
+ + + + + +

+Typedefs

typedef struct trap_input_ifc_s trap_input_ifc_t
 
typedef struct trap_output_ifc_s trap_output_ifc_t
 
+ + + + + + + +

+Functions

void trap_set_timeouts (int timeout, struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
void trap_set_abs_timespec (struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_DEFAULT_MAX_CLIENTS

+ +
+
+ + + + +
#define TRAP_IFC_DEFAULT_MAX_CLIENTS   64
+
+

Default max number of clients that can connect to output interface. It takes effect when no value is given during interface initialization.

+ +

Definition at line 64 of file trap_ifc.h.

+ +
+
+

Typedef Documentation

+ +

◆ trap_input_ifc_t

+ +
+
+ + + + +
typedef struct trap_input_ifc_s trap_input_ifc_t
+
+

Struct to hold an instance of some input interface.

+ +
+
+ +

◆ trap_output_ifc_t

+ +
+
+ + + + +
typedef struct trap_output_ifc_s trap_output_ifc_t
+
+

Struct to hold an instance of some output interface.

+ +
+
+

Function Documentation

+ +

◆ trap_set_abs_timespec()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_set_abs_timespec (struct timeval * tm,
struct timespec * tmnblk 
)
+
+ +

Internal function for setting of timeout structs according to libtrap timeout.

+
Parameters
+ + + +
[in]tmPrecomputed timeval, set using e.g. trap_set_timeouts().
[out]tmnblkUsed for sem_timedwait() call to block on semaphore.
+
+
+ +

Definition at line 1190 of file trap.c.

+ +
+
+ +

◆ trap_set_timeouts()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void trap_set_timeouts (int timeout,
struct timeval * tm,
struct timespec * tmnblk 
)
+
+ +

Internal function for setting of timeout structs according to libtrap timeout.

+
Parameters
+ + + + +
[in]timeouttimeout in microseconds, or TRAP Timeout
[out]tmused for select() call when non-blocking
[out]tmnblkused for sem_timedwait() call to block on semaphore.
+
+
+ +

Definition at line 1211 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__ifc.map b/doc/libtrap-devel/group__trap__ifc.map new file mode 100644 index 00000000..0424722e --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/libtrap-devel/group__trap__ifc.md5 b/doc/libtrap-devel/group__trap__ifc.md5 new file mode 100644 index 00000000..6ef0aaa9 --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc.md5 @@ -0,0 +1 @@ +cfb9277c3384b84a3dc58362ad99c9d0 \ No newline at end of file diff --git a/doc/libtrap-devel/group__trap__ifc.png b/doc/libtrap-devel/group__trap__ifc.png new file mode 100644 index 00000000..5cb764b5 Binary files /dev/null and b/doc/libtrap-devel/group__trap__ifc.png differ diff --git a/doc/libtrap-devel/group__trap__ifc__api.html b/doc/libtrap-devel/group__trap__ifc__api.html new file mode 100644 index 00000000..cdc9e1ff --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc__api.html @@ -0,0 +1,387 @@ + + + + + + + +Libtrap: Internal development docs: IFC API + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for IFC API:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef int(* ifc_recv_func_t) (void *p, void *d, uint32_t *s, int t)
 
typedef int(* ifc_send_func_t) (void *p, const void *d, uint16_t s, int t)
 
typedef void(* ifc_flush_func_t) (void *p)
 
typedef void(* ifc_disconn_clients_func_t) (void *p)
 
typedef void(* ifc_terminate_func_t) (void *p)
 
typedef void(* ifc_destroy_func_t) (void *p)
 
typedef void(* ifc_create_dump_func_t) (void *p, uint32_t i, const char *d)
 
typedef int32_t(* ifc_get_client_count_func_t) (void *p)
 
typedef int8_t(* ifc_get_client_stats_json_func_t) (void *p, json_t *client_stats_arr)
 
typedef char *(* ifc_get_id_func_t) (void *priv)
 
typedef uint8_t(* ifc_is_conn_func_t) (void *priv)
 
+

Detailed Description

+

The set of function that must be implemented for communication interface.

+

Typedef Documentation

+ +

◆ ifc_create_dump_func_t

+ +
+
+ + + + +
typedef void(* ifc_create_dump_func_t) (void *p, uint32_t i, const char *d)
+
+

Create dump of interface for debug purposes.

+
Parameters
+ + + + +
[in]ppointer to IFC's private memory allocated by constructor
[in]iindex of interface (index into the IFC array in the context trap_ctx_priv_s)
[in]ddirectory path to generate output
+
+
+ +

Definition at line 137 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_destroy_func_t

+ +
+
+ + + + +
typedef void(* ifc_destroy_func_t) (void *p)
+
+

Destructor, called to free allocated memory.

+
Parameters
+ + +
[in,out]ppointer to IFC's private memory allocated by constructor
+
+
+ +

Definition at line 127 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_disconn_clients_func_t

+ +
+
+ + + + +
typedef void(* ifc_disconn_clients_func_t) (void *p)
+
+

Disconnect all connected clients to output IFC.

+
Parameters
+ + +
[in]ppointer to IFC's private memory allocated by constructor
+
+
+ +

Definition at line 113 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_flush_func_t

+ +
+
+ + + + +
typedef void(* ifc_flush_func_t) (void *p)
+
+

Force flush on interface

+
Parameters
+ + +
[in]ppointer to IFC's private memory allocated by constructor
+
+
+ +

Definition at line 106 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_get_client_count_func_t

+ +
+
+ + + + +
typedef int32_t(* ifc_get_client_count_func_t) (void *p)
+
+

Get number of connected clients.

+
Parameters
+ + +
[in]ppointer to IFC's private memory allocated by constructor
+
+
+
Returns
number of clients that are connected to this IFC
+ +

Definition at line 145 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_get_client_stats_json_func_t

+ +
+
+ + + + +
typedef int8_t(* ifc_get_client_stats_json_func_t) (void *p, json_t *client_stats_arr)
+
+

Get json array with client statistics

+
Parameters
+ + + +
[in]ppointer to IFC's private memory allocated by constructor
[out]client_stats_arrpointer to JSON array to be filled with client statistics
+
+
+
Returns
1 (TRUE) on success, otherwise 0 (FALSE)
+ +

Definition at line 154 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_get_id_func_t

+ +
+
+ + + + +
typedef char*(* ifc_get_id_func_t) (void *priv)
+
+

Get identifier of the interface

+
Parameters
+ + +
[in]privpointer to IFC's private memory allocated by constructor
+
+
+
Returns
pointer to char (private memory of the ifc - do not free!). TCP and UNIXSOCKET ifces return port and name of socket, file ifc returns name of the file, GENERATOR and BLACKHOLE ifces return NULL.
+ +

Definition at line 164 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_is_conn_func_t

+ +
+
+ + + + +
typedef uint8_t(* ifc_is_conn_func_t) (void *priv)
+
+

Check whether the input interface is connected

+
Parameters
+ + +
[in]privpointer to IFC's private memory allocated by constructor
+
+
+
Returns
1 (TRUE) if connected, otherwise 0 (FALSE)
+ +

Definition at line 172 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_recv_func_t

+ +
+
+ + + + +
typedef int(* ifc_recv_func_t) (void *p, void *d, uint32_t *s, int t)
+
+

Receive one message via this IFC.

+

This function is called from trap_read_from_buffer() when there is a need to get new data.

+
Parameters
+ + + + + +
[in]ppointer to IFC's private memory allocated by constructor
[out]dpointer to memory where this IFC can write received message
[out]ssize (in bytes) of received message (must be set by this IFC)
[in]ttimeout, see TRAP Timeout
+
+
+
Returns
TRAP_E_OK on success
+ +

Definition at line 85 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_send_func_t

+ +
+
+ + + + +
typedef int(* ifc_send_func_t) (void *p, const void *d, uint16_t s, int t)
+
+

Send one message via this IFC.

+

This function is called from trap_store_into_buffer() when there is a need to send new data.

+
Parameters
+ + + + + +
[in]ppointer to IFC's private memory allocated by constructor
[in]dpointer to message that will be sent
[in]ssize (in bytes) of message that will be sent
[in]ttimeout, see TRAP Timeout
+
+
+
Returns
TRAP_E_OK on success
+ +

Definition at line 99 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_terminate_func_t

+ +
+
+ + + + +
typedef void(* ifc_terminate_func_t) (void *p)
+
+

Terminate IFC - stop sending/receiving.

+
Parameters
+ + +
[in]ppointer to IFC's private memory allocated by constructor
+
+
+ +

Definition at line 120 of file trap_ifc.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__ifc__api.map b/doc/libtrap-devel/group__trap__ifc__api.map new file mode 100644 index 00000000..3c3990db --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc__api.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__trap__ifc__api.md5 b/doc/libtrap-devel/group__trap__ifc__api.md5 new file mode 100644 index 00000000..d871350f --- /dev/null +++ b/doc/libtrap-devel/group__trap__ifc__api.md5 @@ -0,0 +1 @@ +b829f51c6d66b2344b6d451271c11e55 \ No newline at end of file diff --git a/doc/libtrap-devel/group__trap__ifc__api.png b/doc/libtrap-devel/group__trap__ifc__api.png new file mode 100644 index 00000000..33961589 Binary files /dev/null and b/doc/libtrap-devel/group__trap__ifc__api.png differ diff --git a/doc/libtrap-devel/group__trap__mess__fmt.html b/doc/libtrap-devel/group__trap__mess__fmt.html new file mode 100644 index 00000000..b274c890 --- /dev/null +++ b/doc/libtrap-devel/group__trap__mess__fmt.html @@ -0,0 +1,802 @@ + + + + + + + +Libtrap: Internal development docs: Message format + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ + +
+
+Collaboration diagram for Message format:
+
+
+ + + + + +
+
+ + + + + + +

+Enumerations

enum  trap_data_format_t { TRAP_FMT_UNKNOWN = 0, +TRAP_FMT_RAW = 1, +TRAP_FMT_UNIREC = 2, +TRAP_FMT_JSON = 3 + }
 
enum  trap_in_ifc_state_t { FMT_WAITING = 0, +FMT_OK = 1, +FMT_MISMATCH = 2, +FMT_CHANGED = 3 + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void trap_ctx_vset_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
 
void trap_ctx_set_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_vset_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_set_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_get_data_fmt (trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
 
void trap_set_data_fmt (uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_set_required_fmt (uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_get_data_fmt (uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
 
int trap_ctx_get_in_ifc_state (trap_ctx_t *ctx, uint32_t ifc_idx)
 
int trap_get_in_ifc_state (uint32_t ifc_idx)
 
const char * trap_get_type_and_name_from_string (const char *source, const char **name, const char **type, int *length_name, int *length_type)
 
int trap_ctx_cmp_data_fmt (const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
 
void * trap_get_global_ctx ()
 
+

Detailed Description

+

Enumeration Type Documentation

+ +

◆ trap_data_format_t

+ +
+
+ + + + +
enum trap_data_format_t
+
+

Type of messages that are sent via IFC

+ + + + + +
Enumerator
TRAP_FMT_UNKNOWN 

unknown - message format was not specified yet

+
TRAP_FMT_RAW 

raw data, no format specified

+
TRAP_FMT_UNIREC 

UniRec records

+
TRAP_FMT_JSON 

structured data serialized using JSON

+
+ +

Definition at line 225 of file trap.h.

+ +
+
+ +

◆ trap_in_ifc_state_t

+ +
+
+ + + + +
enum trap_in_ifc_state_t
+
+

Possible states of an IFC during data format negotiation.

+ + + + + +
Enumerator
FMT_WAITING 

Negotiation is not completed

+
FMT_OK 

Negotiation was successful

+
FMT_MISMATCH 

Negotiation failed, format mismatch

+
FMT_CHANGED 

Negotiation was successful, but receivers (input ifc) template is subset of senders (output ifc) template and missing fields has to be defined

+
+ +

Definition at line 242 of file trap.h.

+ +
+
+

Function Documentation

+ +

◆ trap_ctx_cmp_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_cmp_data_fmt (const char * sender_ifc_data_fmt,
const char * receiver_ifc_data_fmt 
)
+
+

Compares sender_ifc template and receiver_ifc template and returns whether receivers template is subset of the senders template.

+
Parameters
+ + + +
[in]sender_ifc_data_fmtsender_ifc template (char *)
[in]receiver_ifc_data_fmtreceiver_ifc template (char *)
+
+
+
Returns
TRAP_E_OK on success (receivers template is subset of the senders template), TRAP_E_FIELDS_MISMATCH (receivers template has field which is not in senders template).
+ +

Definition at line 2765 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_get_data_fmt (trap_ctx_tctx,
uint8_t ifc_dir,
uint32_t ifc_idx,
uint8_t * data_type,
const char ** spec 
)
+
+

Get message format and template that is set on IFC.

+

On output IFC it should return the values that were set. On input IFC it should return format and template that was received. This function is thread safe.

+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifc_dirtrap_ifc_type direction of interface
[in]ifc_idxIndex of IFC.
[out]data_typeFormat of messages defined by trap_data_format_t.
[out]specSpecifier of data format specifies the template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED if libtrap context is not initialized or negotiation is not successful yet for input IFC, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
+ +

Definition at line 2617 of file trap.c.

+ +
+
+ +

◆ trap_ctx_get_in_ifc_state()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_get_in_ifc_state (trap_ctx_tctx,
uint32_t ifc_idx 
)
+
+

Returns current state of an input interface on specified index.

+

This function is thread safe.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifc_idxIndex of the input interface
+
+
+
Returns
Value of trap_in_ifc_state_t on success, otherwise TRAP_E_NOT_INITIALIZED when libtrap context is not initialized or TRAP_E_BAD_IFC_INDEX (ifc_idx >= number of input ifcs).
+ +

Definition at line 2719 of file trap.c.

+ +
+
+ +

◆ trap_ctx_set_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void trap_ctx_set_data_fmt (trap_ctx_tctx,
uint32_t out_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages on output IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]out_ifc_idxIndex of output IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]...If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+ +

Definition at line 2551 of file trap.c.

+ +
+
+ +

◆ trap_ctx_set_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_set_required_fmt (trap_ctx_tctx,
uint32_t in_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages expected on input IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]in_ifc_idxIndex of input IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]...If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, on error see trap_ctx_vset_required_fmt().
+ +

Definition at line 2602 of file trap.c.

+ +
+
+ +

◆ trap_ctx_vset_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void trap_ctx_vset_data_fmt (trap_ctx_tctx,
uint32_t out_ifc_idx,
uint8_t data_type,
va_list ap 
)
+
+

Set format of messages on output IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]out_ifc_idxIndex of output IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]apIf data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+ +

Definition at line 2516 of file trap.c.

+ +
+
+ +

◆ trap_ctx_vset_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_vset_required_fmt (trap_ctx_tctx,
uint32_t in_ifc_idx,
uint8_t data_type,
va_list ap 
)
+
+

Set format of messages expected on input IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]in_ifc_idxIndex of input IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]apIf data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED when libtrap context is not initialized, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
+ +

Definition at line 2565 of file trap.c.

+ +
+
+ +

◆ trap_get_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_get_data_fmt (uint8_t ifc_dir,
uint32_t ifc_idx,
uint8_t * data_type,
const char ** spec 
)
+
+

Get message format and template that is set on IFC.

+

On output IFC it should return the values that were set. On input IFC it should return format and template that was received.

+
Parameters
+ + + + + +
[in]ifc_dirtrap_ifc_type direction of interface
[in]ifc_idxindex of IFC
[out]data_typeformat of messages defined by trap_data_format_t
[out]specTemplate specifier - UniRec specifier in case of TRAP_FMT_UNIREC data_type, otherwise, it can be any string.
+
+
+
Returns
TRAP_E_OK on success, on error see trap_ctx_get_data_fmt().
+ +

Definition at line 2714 of file trap.c.

+ +
+
+ +

◆ trap_get_global_ctx()

+ +
+
+ + + + + + + +
void* trap_get_global_ctx ()
+
+

Returns global context.

+
Returns
pointer to global context.
+ +

Definition at line 2820 of file trap.c.

+ +
+
+ +

◆ trap_get_in_ifc_state()

+ +
+
+ + + + + + + + +
int trap_get_in_ifc_state (uint32_t ifc_idx)
+
+

Returns current state of an input interface on specified index.

+
Parameters
+ + +
[in]ifc_idxIndex of the input interface
+
+
+
Returns
See trap_ctx_get_in_ifc_state().
+ +

Definition at line 2734 of file trap.c.

+ +
+
+ +

◆ trap_get_type_and_name_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char* trap_get_type_and_name_from_string (const char * source,
const char ** name,
const char ** type,
int * length_name,
int * length_type 
)
+
+

Parse Fields name and types from string.

+

Function parses the source string and sets the given pointers (pointers to source string). Than it sets length of name and type

+
Parameters
+ + + + + + +
[in]sourceSource string to parse.
[in]nameouput parameter, where will be set the pointer to name of a field (pointer to source string).
[in]typeouput parameter, where will be set the pointer to type of a field (pointer to source string).
[in]length_nameouput parameter, where will be set the length of a name.
[in]length_typeouput parameter, where will be set the length of a type.
+
+
+
Returns
pointer to source string, moved to next field
+ +

Definition at line 2739 of file trap.c.

+ +
+
+ +

◆ trap_set_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void trap_set_data_fmt (uint32_t out_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages on output IFC.

+
Parameters
+ + + + +
[in]out_ifc_idxindex of output IFC
[in]data_typeformat of messages defined by trap_data_format_t
[in]...if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected
+
+
+ +

Definition at line 2693 of file trap.c.

+ +
+
+ +

◆ trap_set_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_set_required_fmt (uint32_t in_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages expected on input IFC.

+
Parameters
+ + + + +
[in]in_ifc_idxindex of input IFC
[in]data_typeformat of messages defined by trap_data_format_t
[in]...if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected
+
+
+
Returns
TRAP_E_OK on success
+ +

Definition at line 2702 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__mess__fmt.map b/doc/libtrap-devel/group__trap__mess__fmt.map new file mode 100644 index 00000000..e48a8b39 --- /dev/null +++ b/doc/libtrap-devel/group__trap__mess__fmt.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/group__trap__mess__fmt.md5 b/doc/libtrap-devel/group__trap__mess__fmt.md5 new file mode 100644 index 00000000..d5068e76 --- /dev/null +++ b/doc/libtrap-devel/group__trap__mess__fmt.md5 @@ -0,0 +1 @@ +3db8d682834a4976ad0234c3ef162274 \ No newline at end of file diff --git a/doc/libtrap-devel/group__trap__mess__fmt.png b/doc/libtrap-devel/group__trap__mess__fmt.png new file mode 100644 index 00000000..b20a8540 Binary files /dev/null and b/doc/libtrap-devel/group__trap__mess__fmt.png differ diff --git a/doc/libtrap-devel/group__trap__timeout.html b/doc/libtrap-devel/group__trap__timeout.html new file mode 100644 index 00000000..51c6f754 --- /dev/null +++ b/doc/libtrap-devel/group__trap__timeout.html @@ -0,0 +1,195 @@ + + + + + + + +Libtrap: Internal development docs: TRAP Timeout + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
TRAP Timeout
+
+
+
+Collaboration diagram for TRAP Timeout:
+
+
+ + + +
+
+ + + + + + + + + + + + + +

+Macros

#define TRAP_NO_WAIT   0
 
#define TRAP_WAIT   -1
 
#define TRAP_HALFWAIT   -2
 
#define TRAP_TIMEOUT_STR(t)   (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
 
#define TRAP_NO_AUTO_FLUSH   (-1l)
 value to disable autoflushing on output interface More...
 
+

Detailed Description

+

TRAP IFC works with timeout to decide wether it should block or just wait for some time. The timeout is usually in microseconds. This section lists some special timeout values.

+

Macro Definition Documentation

+ +

◆ TRAP_HALFWAIT

+ +
+
+ + + + +
#define TRAP_HALFWAIT   -2
+
+

Blocking mode, do not wait for client's connection, clients do not try to reconnect, there is no recovering of clients during get_data/send_data in this mode. For input ifc it is the same as TRAP_NO_WAIT.

+ +

Definition at line 130 of file trap.h.

+ +
+
+ +

◆ TRAP_NO_AUTO_FLUSH

+ +
+
+ + + + +
#define TRAP_NO_AUTO_FLUSH   (-1l)
+
+ +

value to disable autoflushing on output interface

+ +

Definition at line 134 of file trap.h.

+ +
+
+ +

◆ TRAP_NO_WAIT

+ +
+
+ + + + +
#define TRAP_NO_WAIT   0
+
+

Non-Blocking mode, do not wait ever.

+ +

Definition at line 119 of file trap.h.

+ +
+
+ +

◆ TRAP_TIMEOUT_STR

+ +
+
+ + + + + + + + +
#define TRAP_TIMEOUT_STR( t)   (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
+
+ +

Definition at line 132 of file trap.h.

+ +
+
+ +

◆ TRAP_WAIT

+ +
+
+ + + + +
#define TRAP_WAIT   -1
+
+

Blocking mode, wait for client's connection, for message transport to/from internal system buffer.

+ +

Definition at line 124 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trap__timeout.map b/doc/libtrap-devel/group__trap__timeout.map new file mode 100644 index 00000000..4df7f77f --- /dev/null +++ b/doc/libtrap-devel/group__trap__timeout.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/group__trap__timeout.md5 b/doc/libtrap-devel/group__trap__timeout.md5 new file mode 100644 index 00000000..45d76205 --- /dev/null +++ b/doc/libtrap-devel/group__trap__timeout.md5 @@ -0,0 +1 @@ +ffe1e6e0bc341748148651f9bf7ecbef \ No newline at end of file diff --git a/doc/libtrap-devel/group__trap__timeout.png b/doc/libtrap-devel/group__trap__timeout.png new file mode 100644 index 00000000..0650a50e Binary files /dev/null and b/doc/libtrap-devel/group__trap__timeout.png differ diff --git a/doc/libtrap-devel/group__trapifcspec.html b/doc/libtrap-devel/group__trapifcspec.html new file mode 100644 index 00000000..8f4fa4f1 --- /dev/null +++ b/doc/libtrap-devel/group__trapifcspec.html @@ -0,0 +1,146 @@ + + + + + + + +Libtrap: Internal development docs: Specifier of TRAP interfaces + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Specifier of TRAP interfaces
+
+
+
+Collaboration diagram for Specifier of TRAP interfaces:
+
+
+ + + + +
+
+ + + + +

+Modules

 Types of IFC
 
+ + + + + +

+Macros

#define TRAP_IFC_DELIMITER   ','
 
#define TRAP_IFC_PARAM_DELIMITER   ':'
 
+

Detailed Description

+

The format of -i parameter of modules sets up TRAP interfaces. TRAP_IFC_DELIMITER divides specifier into interfaces. TRAP_IFC_PARAM_DELIMITER divides parameters of one interface.

+

Each TRAP interface must have the type (Types of IFC) as the first parameter. The following parameters are passed to the interface and they are interface-dependent.

+

The format example, let's assume the module has 1 input IFC and 1 output IFC:

+
+

-i t:localhost:7600,u:my_socket

+
+

This sets the input IFC to TCP type and it will connect to localhost, port 7600. The output IFC will listen on UNIX socket with identifier my_socket.

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_DELIMITER

+ +
+
+ + + + +
#define TRAP_IFC_DELIMITER   ','
+
+

Delimiter of TRAP interfaces in IFC specifier

+ +

Definition at line 160 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_PARAM_DELIMITER

+ +
+
+ + + + +
#define TRAP_IFC_PARAM_DELIMITER   ':'
+
+

Delimiter of TRAP interface's parameters in IFC specifier

+ +

Definition at line 165 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/group__trapifcspec.map b/doc/libtrap-devel/group__trapifcspec.map new file mode 100644 index 00000000..b2b63e59 --- /dev/null +++ b/doc/libtrap-devel/group__trapifcspec.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/group__trapifcspec.md5 b/doc/libtrap-devel/group__trapifcspec.md5 new file mode 100644 index 00000000..d9c5dba1 --- /dev/null +++ b/doc/libtrap-devel/group__trapifcspec.md5 @@ -0,0 +1 @@ +1ba11da4475d498ca3a64a96214eaa03 \ No newline at end of file diff --git a/doc/libtrap-devel/group__trapifcspec.png b/doc/libtrap-devel/group__trapifcspec.png new file mode 100644 index 00000000..dc0034b4 Binary files /dev/null and b/doc/libtrap-devel/group__trapifcspec.png differ diff --git a/doc/libtrap-devel/help__trapifcspec_8c.html b/doc/libtrap-devel/help__trapifcspec_8c.html new file mode 100644 index 00000000..6d83ada4 --- /dev/null +++ b/doc/libtrap-devel/help__trapifcspec_8c.html @@ -0,0 +1,108 @@ + + + + + + + +Libtrap: Internal development docs: src/help_trapifcspec.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
help_trapifcspec.c File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Variables

const char * trap_help_ifcspec
 
+

Variable Documentation

+ +

◆ trap_help_ifcspec

+ +
+
+ + + + +
const char* trap_help_ifcspec
+
+ +

Definition at line 1 of file help_trapifcspec.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/help__trapifcspec_8c_source.html b/doc/libtrap-devel/help__trapifcspec_8c_source.html new file mode 100644 index 00000000..53628c14 --- /dev/null +++ b/doc/libtrap-devel/help__trapifcspec_8c_source.html @@ -0,0 +1,82 @@ + + + + + + + +Libtrap: Internal development docs: src/help_trapifcspec.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
help_trapifcspec.c
+
+
+Go to the documentation of this file.
1 const char *trap_help_ifcspec = "Format of TRAP interface specifier (IFC_SPEC):\n"
2  "==============================================\n"
3  "\n"
4  "TRAP interface specifier is an argument of `-i` option used by every NEMEA module. It specifies a configuration of module's TRAP interfaces (IFC), i.e. what kind of IFC to use and where to connect.\n"
5  "\n"
6  "Configurations of individual IFCs are separated by comma `,`, e.g. `<IFC 1>,<IFC 2>,...,<IFC N>`. Input IFCs must be specified first, output IFCs follow. The number of input and output IFCs depends on the specific module (you should be able to find it in the module's help or README).\n"
7  "\n"
8  "Parameters of each IFC are separated by colon `:`, e.g. `<type>:<par1>:<par2>:...:<parN>`. The first parameter is always one character specifying the type of the IFC to use, other parameters differ for individual types (see below).\n"
9  "\n"
10  "Example of startup of a module with 1 input and 1 output IFC:\n"
11  "\n"
12  "traffic_repeater -i t:example.org:1234,u:my_socket\n"
13  "\n"
14  "The example makes the repeater to use a TCP socket as its input IFC and connect it to 'example.org', port 1234; and to create an UNIX domain socket identified as 'my_socket' as its output IFC.\n"
15  "\n"
16  "Supported interface types:\n"
17  "==========================\n"
18  "\n"
19  "TCP interface ('t')\n"
20  "-------------------\n"
21  "\n"
22  "Communicates through a TCP socket. Output interface listens on a given port, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data.\n"
23  "\n"
24  "Parameters when used as INPUT interface:\n"
25  "\n"
26  "\n"
27  "t:<hostname or ip>:<port>\n"
28  "\n"
29  "\n"
30  "or\n"
31  "\n"
32  "\n"
33  "t:<port>\n"
34  "\n"
35  "\n"
36  "If you skip `<hostname or ip>:`, IFC assumes you want to use localhost as the hostname.\n"
37  "\n"
38  "Parameters when used as OUTPUT interface:\n"
39  "\n"
40  "\n"
41  "<port>:<max_num_of_clients>\n"
42  "\n"
43  "\n"
44  "Maximal number of connected clients (input interfaces) is optional (64 by default).\n"
45  "\n"
46  "TLS interface ('T')\n"
47  "-------------------\n"
48  "\n"
49  "Communicates through a TCP socket after establishing encrypted connection. You have to provide certificate, key and CA chain file with trusted CAs. Otherwise same as in TCP: Output interface listens on a given port, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data.\n"
50  "\n"
51  "Parameters when used as INPUT interface:\n"
52  "\n"
53  "\n"
54  "T:<hostname or ip>:<port>:<keyfile>:<certfile>:<CAfile>\n"
55  "\n"
56  "\n"
57  "or\n"
58  "\n"
59  "\n"
60  "T:<port>:<keyfile>:<certfile>:<CAfile>\n"
61  "\n"
62  "\n"
63  "If you skip `<hostname or ip>:`, IFC assumes you want to use localhost as a hostname.\n"
64  "\n"
65  "Parameters when used as OUTPUT interface:\n"
66  "\n"
67  "<port>:<max_num_of_clients>:<keyfile>:<certfile>:<CAfile>\n"
68  "\n"
69  "Maximal number of connected clients (input interfaces) is optional (64 by default).\n"
70  "\n"
71  "Parameters keyfile, certfile, CAfile expect a path to apropriate files in PEM format.\n"
72  "\n"
73  "UNIX domain socket ('u')\n"
74  "------------------------\n"
75  "\n"
76  "Communicates through a UNIX socket. Output interface creates a socket and listens, input interface connects to it. There may be more than one input interfaces connected to one output interface, every input interface will get the same data.\n"
77  "\n"
78  "Parameters when used as INPUT interface:\n"
79  "\n"
80  "<socket_name>\n"
81  "\n"
82  "Socket name can be any string usable as a file name.\n"
83  "\n"
84  "Parameters when used as OUTPUT interface:\n"
85  "\n"
86  "<socket_name>:<max_num_of_clients>\n"
87  "\n"
88  "Socket name can be any string usable as a file name.\n"
89  "Maximal number of connected clients (input interfaces) is optional (64 by default).\n"
90  "\n"
91  "\n"
92  "Blackhole interface ('b')\n"
93  "-------------------------\n"
94  "\n"
95  "Can be used as OUTPUT interface only. Does nothing, everything sent to this interface is dropped. It has no parameters.\n"
96  "\n"
97  "\n"
98  "File interface ('f')\n"
99  "--------------------\n"
100  "\n"
101  "Input interface reads data from given files, output interface stores data to multiple files. Recommended file name extension for files with captured TRAP traffic is `.trapcap`. Tilde (`~`) can be used to specify home directory when specifying path, e.g. `~/nemea/data.trapcap`.\n"
102  "\n"
103  "Input interface:\n"
104  "Files to be read by input interface can be specified with globbing.\n"
105  "E.g. lets say, we have multiple data files captured on 18th of April 2016, with names like data.201604180900, data.201604181000.\n"
106  "Following syntax can be used:\n"
107  "\n"
108  "<file_name> // e.g. data.201604180900 - reads data only from file \"data.201604180900\"\n"
109  "<file_name*> // e.g. data.20160418* - reads data from all files in directory that were captured on 18th of April.\n"
110  "\n"
111  "Name of file (path to the file) must be specified.\n"
112  "Input file interface can also read from /dev/stdin.\n"
113  "\n"
114  "Output interface:\n"
115  "\n"
116  "<file_name>:<mode>:<time=>:<size=>\n"
117  "\n"
118  "Name of file (path to the file) must be specified.\n"
119  "\n"
120  "Mode is optional. There are two types of mode: `a` - append, `w` - write (default).\n"
121  "If the specified file exists, mode write overwrites it, mode append creates a new file with an integer suffix, e.g. `data.trapcap.00000` (or `data.trapcap.00001` if the former exists, and so on, it simply finds the first unused number).\n"
122  "\n"
123  "If parameter `time=` is set, the output interface will split captured data to individual files as often, as value of this parameter indicates.\n"
124  "Output interface assumes the value of parameter `time=` is in minutes.\n"
125  "If parameter `time=` is set, the output interface creates unique file name for each file according to current timestamp in format: filename.YYYYmmddHHMM\n"
126  "Parameter `time=` is optional and is not set by default.\n"
127  "\n"
128  "If parameter `size=` is set, the output interface will split captured data to individual files after size of current file exceeds given threshold.\n"
129  "Output interface assumes the value of parameter `size=` is in MB.\n"
130  "If parameter `size=` is set, numeric suffix as added to original file name for each file in ascending order starting with 00000.\n"
131  "Parameter `size=` is optional and is not set by default.\n"
132  "\n"
133  "If both `time=` and `size=` are specified, the data are split primarily by time, and only if a file of one time interval exceeds the size limit, it is further splitted. The index of size-splitted file is appended after the time, e.g. `data.trapcap.201604181000.00000`.\n"
134  "\n"
135  "Example:\n"
136  "\n"
137  "-i \"f:~/nemea/data.trapcap:w\" // stores all captured data to one file (overwrites current file if it exists)\n"
138  "-i \"f:~/nemea/data.trapcap:w:time=30\" // creates individual files each 30 minutes, e.g. \"data.trapcap.201604180930\", \"data.trapcap.201604181000\" etc.\n"
139  "-i \"f:~/nemea/data.trapcap:w:size=100\" // creates file \"data.trapcap\" and when its size reaches 100 MB, a new file named \"data.trapcap.00000\", then \"data.trapcap.00001\" etc.\n"
140  "-i \"f:~/nemea/data.trapcap:w:time=30:size=100\" // creates set of files \"data.trapcap.201604180930\", \"data.trapcap.201604180930.00000\" etc. and after 30 minutes, \"data.trapcap.201604181000\"\n"
141  "\n"
142  "Output file interface and negotiation:\n"
143  "Whenever new format of data is created, output interface creates new file with numeric suffix.\n"
144  "Example: `-i \"f:~/nemea/data.trapcap:w\"` following sequence of files will be created if data format changes: data.trapcap, data.trapcap.00000, data.trapcap.00001 etc.\n"
145  "\n"
146  "When mode `a` is specified, the interface finds first non-existing file in which it writes data.\n"
147  "Example: \n"
148  "Assume we have already files \"data.trapcap\" and \"data.trapcap.00000\", the following command:\n"
149  "\n"
150  "-i \"f:~/nemea/data.trapcap:a\"\n"
151  "\n"
152  "checks for existing files and first captured data will be stored to file \"data.trapcap.00001\".\n"
153  "\n"
154  "Output file interface can also write data to /dev/stdout and /dev/null, however mode `w` must be specified.\n"
155  "\n"
156  "Common IFC parameters\n"
157  "=====================\n"
158  "\n"
159  "The following parameters can be used with any type of IFC. There are parameters of libtrap IFC that are normally let default or set in source codes of a module. It is possible to override them by user via IFC_SPEC. The available parameters are:\n"
160  "* timeout - time in microseconds that an IFC can block waiting for message send / receive\n"
161  " * possible values: number of microseconds or one of the special values:\n"
162  " * \"WAIT\" - block indefinitely\n"
163  " * \"NO_WAIT\" - don't block \n"
164  " * \"HALF_WAIT\" (output IFC only) - block only if some client (input IFC) is connected\n"
165  " * default: WAIT\n"
166  "* buffer (OUTPUT only) - buffering of data and sending in larger bulks (increases throughput)\n"
167  " * possible values: on, off\n"
168  " * default: on\n"
169  "* autoflush - normally data are not sent until the buffer is full. When autoflush is enabled, even non-full buffers are sent every X microseconds.\n"
170  " * possible values: off, number of microseconds\n"
171  " * default: 2000000 (2s)\n"
172  "\n"
173  "Example: `-i u:inputsocket:timeout=WAIT,u:outputsocket:timeout=500000:buffer=off:autoflush=off`\n"
174  "\n"
175  "\n"
176  "More examples:\n"
177  "==============\n"
178  "\n"
179  "my_module with 1 input interface and 2 output interfaces:\n"
180  "\n"
181  "./my_module -i \"t:localhost:12345,b:,t:23456:5\"\n"
182  "\n"
183  "The input interface will connect to localhost:12345 (TCP). The first output interface is unused (all data send there will be dropped), the second output interface will provide data on TCP port 23456, to which another module can connect its input interface.\n"
184  "\n"
185  "nfdump_reader module that reads nfdump file and drops records via Blackhole IFC type:\n"
186  "\n"
187  "./modules/nfreader/nfdump_reader -i b: ./file.nfdump\n"
188  "\n";
const char * trap_help_ifcspec
+
+ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8c.html b/doc/libtrap-devel/ifc__dummy_8c.html new file mode 100644 index 00000000..ecb732cf --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8c.html @@ -0,0 +1,605 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_dummy.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_dummy.c File Reference
+
+
+ +

TRAP dummy interfaces (generator and blackhole) +More...

+
#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <assert.h>
+#include "../include/libtrap/trap.h"
+#include "trap_ifc.h"
+#include "trap_error.h"
+
+Include dependency graph for ifc_dummy.c:
+
+
+ + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

struct  generator_private_s
 
+ + + +

+Typedefs

typedef struct generator_private_s generator_private_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static void create_dump (void *priv, uint32_t idx, const char *path)
 
int generator_recv (void *priv, void *data, uint32_t *size, int timeout)
 
void generator_terminate (void *priv)
 
void generator_destroy (void *priv)
 
char * generator_ifc_get_id (void *priv)
 
uint8_t generator_ifc_is_conn (void *priv)
 
int create_generator_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
 
int blackhole_send (void *priv, const void *data, uint16_t size, int timeout)
 
void blackhole_flush (void *priv)
 
void blackhole_terminate (void *priv)
 
void blackhole_destroy (void *priv)
 
int32_t blackhole_get_client_count (void *priv)
 
int8_t blackhole_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
char * blackhole_ifc_get_id (void *priv)
 
int create_blackhole_ifc (trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
 
+

Detailed Description

+

TRAP dummy interfaces (generator and blackhole)

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
Date
2013
+
+2014
+ +

Definition in file ifc_dummy.c.

+

Typedef Documentation

+ +

◆ generator_private_t

+ +
+
+ + + + +
typedef struct generator_private_s generator_private_t
+
+ +
+
+

Function Documentation

+ +

◆ blackhole_destroy()

+ +
+
+ + + + + + + + +
void blackhole_destroy (void * priv)
+
+ +

Definition at line 204 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_flush()

+ +
+
+ + + + + + + + +
void blackhole_flush (void * priv)
+
+ +

Definition at line 193 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_get_client_count()

+ +
+
+ + + + + + + + +
int32_t blackhole_get_client_count (void * priv)
+
+ +

Definition at line 209 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_get_client_stats_json()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int8_t blackhole_get_client_stats_json (void * priv,
json_t * client_stats_arr 
)
+
+ +

Definition at line 215 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_ifc_get_id()

+ +
+
+ + + + + + + + +
char* blackhole_ifc_get_id (void * priv)
+
+ +

Definition at line 222 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int blackhole_send (void * priv,
const void * data,
uint16_t size,
int timeout 
)
+
+ +

Definition at line 188 of file ifc_dummy.c.

+ +
+
+ +

◆ blackhole_terminate()

+ +
+
+ + + + + + + + +
void blackhole_terminate (void * priv)
+
+ +

Definition at line 198 of file ifc_dummy.c.

+ +
+
+ +

◆ create_blackhole_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int create_blackhole_ifc (trap_ctx_priv_tctx,
char * params,
trap_output_ifc_tifc 
)
+
+

Create Blackhole interface (output ifc). Send function of this interface does nothing, so everything sent to a blackhole is dropped.

Parameters
+ + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsIgnored.
[out]ifcCreated interface.
+
+
+
Returns
Always returns 0.
+ +

Definition at line 227 of file ifc_dummy.c.

+ +
+
+ +

◆ create_dump()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void create_dump (void * priv,
uint32_t idx,
const char * path 
)
+
+static
+
+ +

Definition at line 63 of file ifc_dummy.c.

+ +
+
+ +

◆ create_generator_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int create_generator_ifc (trap_ctx_priv_tctx,
char * params,
trap_input_ifc_tifc 
)
+
+

Create Generator interface (input ifc). Receive function of this interface returns always the same data. These data are given in params on creation.

Parameters
+ + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsArray of n+1 bytes. First byte is equal to n, other bytes are data the generator should generate.
[out]ifcCreated interface.
+
+
+
Returns
Error code (0 on success). Generated interface is returned in ifc.
+ +

Definition at line 113 of file ifc_dummy.c.

+ +
+
+ +

◆ generator_destroy()

+ +
+
+ + + + + + + + +
void generator_destroy (void * priv)
+
+ +

Definition at line 95 of file ifc_dummy.c.

+ +
+
+ +

◆ generator_ifc_get_id()

+ +
+
+ + + + + + + + +
char* generator_ifc_get_id (void * priv)
+
+ +

Definition at line 104 of file ifc_dummy.c.

+ +
+
+ +

◆ generator_ifc_is_conn()

+ +
+
+ + + + + + + + +
uint8_t generator_ifc_is_conn (void * priv)
+
+ +

Definition at line 109 of file ifc_dummy.c.

+ +
+
+ +

◆ generator_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int generator_recv (void * priv,
void * data,
uint32_t * size,
int timeout 
)
+
+ +

Definition at line 69 of file ifc_dummy.c.

+ +
+
+ +

◆ generator_terminate()

+ +
+
+ + + + + + + + +
void generator_terminate (void * priv)
+
+ +

Definition at line 87 of file ifc_dummy.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8c__incl.map b/doc/libtrap-devel/ifc__dummy_8c__incl.map new file mode 100644 index 00000000..720dd29e --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8c__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/libtrap-devel/ifc__dummy_8c__incl.md5 b/doc/libtrap-devel/ifc__dummy_8c__incl.md5 new file mode 100644 index 00000000..76d20f51 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8c__incl.md5 @@ -0,0 +1 @@ +1fce9a1d116c5fde6af607e599c94fe4 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__dummy_8c__incl.png b/doc/libtrap-devel/ifc__dummy_8c__incl.png new file mode 100644 index 00000000..c8b15e9a Binary files /dev/null and b/doc/libtrap-devel/ifc__dummy_8c__incl.png differ diff --git a/doc/libtrap-devel/ifc__dummy_8c_source.html b/doc/libtrap-devel/ifc__dummy_8c_source.html new file mode 100644 index 00000000..50e2a325 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8c_source.html @@ -0,0 +1,133 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_dummy.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_dummy.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_dummy.c
3  * \brief TRAP dummy interfaces (generator and blackhole)
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \date 2013
6  * \date 2014
7  */
8 /*
9  * Copyright (C) 2013,2014 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 #include <string.h>
45 #include <stdlib.h>
46 #include <stdint.h>
47 #include <inttypes.h>
48 #include <assert.h>
49 
50 #include "../include/libtrap/trap.h"
51 #include "trap_ifc.h"
52 #include "trap_error.h"
53 
54 /***** Generator *****/
55 
56 typedef struct generator_private_s {
58  char *data_to_send;
59  int data_size;
62 
63 static void create_dump(void *priv, uint32_t idx, const char *path)
64 {
65  VERBOSE(CL_ERROR, "Unimplemented. (%s:%d)", __FILE__, __LINE__);
66  return;
67 }
68 
69 int generator_recv(void *priv, void *data, uint32_t *size, int timeout)
70 {
71  assert(data != NULL);
72  assert(size != NULL);
73 
74  uint16_t *mh = data;
75  void *p = (void *) (mh + 1);
76 
77  generator_private_t *config = (generator_private_t*) priv;
78  if (config->is_terminated) {
79  return trap_error(config->ctx, TRAP_E_TERMINATED);
80  }
81  *mh = config->data_size;
82  memcpy(p, config->data_to_send, config->data_size);
83  *size = config->data_size;
84  return TRAP_E_OK;
85 }
86 
87 void generator_terminate(void *priv)
88 {
89  if (priv) {
90  ((generator_private_t*)priv)->is_terminated = 1;
91  }
92 }
93 
94 
95 void generator_destroy(void *priv)
96 {
97  // Free private data
98  if (priv) {
99  free(((generator_private_t*)priv)->data_to_send);
100  free(priv);
101  }
102 }
103 
104 char *generator_ifc_get_id(void *priv)
105 {
106  return NULL;
107 }
108 
109 uint8_t generator_ifc_is_conn(void *priv) {
110  return 1;
111 }
112 
114 {
115  generator_private_t *priv = NULL;
116  char *param_iterator = NULL;
117  char *n_str = NULL;
118  int n, ret;
119 
120  // Check parameter
121  if (params == NULL) {
122  VERBOSE(CL_ERROR, "parameter is null pointer");
123  return TRAP_E_BADPARAMS;
124  }
125 
126  /* Parsing params */
127  param_iterator = trap_get_param_by_delimiter(params, &n_str, TRAP_IFC_PARAM_DELIMITER);
128  if (n_str == NULL) {
129  VERBOSE(CL_ERROR, "Missing parameter of generator IFC.");
130  ret = TRAP_E_BADPARAMS;
131  goto failure;
132  }
133  ret = sscanf(n_str, "%d", &n);
134  free(n_str);
135  if ((ret != 1) || (n <= 0) || (n > 255)) {
136  VERBOSE(CL_ERROR, "Generator IFC expects a number from 1 to 255 as the 1st parameter.");
137  ret = TRAP_E_BADPARAMS;
138  goto failure;
139  }
140 
141  // Create structure to store private data
142  priv = calloc(1, sizeof(generator_private_t));
143  if (!priv) {
144  ret = TRAP_E_MEMORY;
145  goto failure;
146  }
147  param_iterator = trap_get_param_by_delimiter(param_iterator, &priv->data_to_send, TRAP_IFC_PARAM_DELIMITER);
148 
149  // Store data to send (param) into private data
150  if (!priv->data_to_send) {
151  VERBOSE(CL_ERROR, "Generator IFC expects %d bytes as the 2nd parameter.", priv->data_size);
152  ret = TRAP_E_MEMORY;
153  goto failure;
154  }
155  if (strlen(priv->data_to_send) != n) {
156  VERBOSE(CL_ERROR, "Bad length of the 2nd parameter of generator IFC.");
157  ret = TRAP_E_BADPARAMS;
158  goto failure;
159  }
160 
161  priv->ctx = ctx;
162  priv->is_terminated = 0;
163  priv->data_size = n;
164 
165  // Fill struct defining the interface
166  ifc->recv = generator_recv;
168  ifc->destroy = generator_destroy;
169  ifc->create_dump = create_dump;
170  ifc->priv = priv;
173 
174  return TRAP_E_OK;
175 failure:
176  if (priv != NULL) {
177  free(priv->data_to_send);
178  }
179  free(priv);
180  return ret;
181 }
182 
183 
184 
185 /***** Blackhole *****/
186 // Everything sent to blackhole is dropped
187 
188 int blackhole_send(void *priv, const void *data, uint16_t size, int timeout)
189 {
190  return TRAP_E_OK;
191 }
192 
193 void blackhole_flush(void *priv)
194 {
195  return;
196 }
197 
198 void blackhole_terminate(void *priv)
199 {
200  return;
201 }
202 
203 
204 void blackhole_destroy(void *priv)
205 {
206  return;
207 }
208 
209 int32_t blackhole_get_client_count(void *priv)
210 {
211  /* this interface does not support multiple clients */
212  return 1;
213 }
214 
215 int8_t blackhole_get_client_stats_json(void *priv, json_t *client_stats_arr)
216 {
217  /* do not collect client statistics for this interface */
218  return 1;
219 }
220 
221 
222 char *blackhole_ifc_get_id(void *priv)
223 {
224  return NULL;
225 }
226 
228 {
229  ifc->send = blackhole_send;
230  ifc->flush = blackhole_flush;
232  ifc->destroy = blackhole_destroy;
235  ifc->create_dump = create_dump;
236  ifc->priv = NULL;
238  return TRAP_E_OK;
239 }
240 
int blackhole_send(void *priv, const void *data, uint16_t size, int timeout)
Definition: ifc_dummy.c:188
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+
void generator_terminate(void *priv)
Definition: ifc_dummy.c:87
+
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
Definition: trap.c:1160
+
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
#define TRAP_IFC_PARAM_DELIMITER
Definition: trap.h:165
+ +
void blackhole_destroy(void *priv)
Definition: ifc_dummy.c:204
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
void blackhole_terminate(void *priv)
Definition: ifc_dummy.c:198
+ +
char * blackhole_ifc_get_id(void *priv)
Definition: ifc_dummy.c:222
+
struct generator_private_s generator_private_t
+
void blackhole_flush(void *priv)
Definition: ifc_dummy.c:193
+ + +
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
int create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
Definition: ifc_dummy.c:227
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
#define VERBOSE(level, format, args...)
+ +
uint8_t data[0]
+
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+ + +
trap_ctx_priv_t * ctx
Definition: ifc_dummy.c:57
+
static void create_dump(void *priv, uint32_t idx, const char *path)
Definition: ifc_dummy.c:63
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+
int32_t blackhole_get_client_count(void *priv)
Definition: ifc_dummy.c:209
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
uint8_t generator_ifc_is_conn(void *priv)
Definition: ifc_dummy.c:109
+
Error handling for TRAP.
+
#define TRAP_E_MEMORY
Memory allocation error.
Definition: trap.h:104
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+
void generator_destroy(void *priv)
Definition: ifc_dummy.c:95
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+
char * generator_ifc_get_id(void *priv)
Definition: ifc_dummy.c:104
+
int generator_recv(void *priv, void *data, uint32_t *size, int timeout)
Definition: ifc_dummy.c:69
+
static int trap_error(trap_ctx_priv_t *ctx, int err_num)
Definition: trap_error.h:63
+
int create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
Definition: ifc_dummy.c:113
+ +
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
Interface of TRAP interfaces.
+
int8_t blackhole_get_client_stats_json(void *priv, json_t *client_stats_arr)
Definition: ifc_dummy.c:215
+
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
Definition: trap.h:90
+
+ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8h.html b/doc/libtrap-devel/ifc__dummy_8h.html new file mode 100644 index 00000000..48afde65 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h.html @@ -0,0 +1,212 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_dummy.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_dummy.h File Reference
+
+
+ +

TRAP dummy interfaces (generator and blackhole) +More...

+
#include "trap_ifc.h"
+
+Include dependency graph for ifc_dummy.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + + + +

+Functions

int create_generator_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
 
int create_blackhole_ifc (trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
 
+

Detailed Description

+

TRAP dummy interfaces (generator and blackhole)

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
Date
2013
+
+2014
+ +

Definition in file ifc_dummy.h.

+

Function Documentation

+ +

◆ create_blackhole_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int create_blackhole_ifc (trap_ctx_priv_tctx,
char * params,
trap_output_ifc_tifc 
)
+
+

Create Blackhole interface (output ifc). Send function of this interface does nothing, so everything sent to a blackhole is dropped.

Parameters
+ + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsIgnored.
[out]ifcCreated interface.
+
+
+
Returns
Always returns 0.
+ +

Definition at line 227 of file ifc_dummy.c.

+ +
+
+ +

◆ create_generator_ifc()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int create_generator_ifc (trap_ctx_priv_tctx,
char * params,
trap_input_ifc_tifc 
)
+
+

Create Generator interface (input ifc). Receive function of this interface returns always the same data. These data are given in params on creation.

Parameters
+ + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsArray of n+1 bytes. First byte is equal to n, other bytes are data the generator should generate.
[out]ifcCreated interface.
+
+
+
Returns
Error code (0 on success). Generated interface is returned in ifc.
+ +

Definition at line 113 of file ifc_dummy.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8h__dep__incl.map b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.map new file mode 100644 index 00000000..c15de548 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.md5 new file mode 100644 index 00000000..ac56c8d7 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.md5 @@ -0,0 +1 @@ +cd8e05fd7300a6e27aedd0c6e2e0c48c \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__dummy_8h__dep__incl.png b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.png new file mode 100644 index 00000000..3002ccaf Binary files /dev/null and b/doc/libtrap-devel/ifc__dummy_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__dummy_8h__incl.map b/doc/libtrap-devel/ifc__dummy_8h__incl.map new file mode 100644 index 00000000..941c7414 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__dummy_8h__incl.md5 b/doc/libtrap-devel/ifc__dummy_8h__incl.md5 new file mode 100644 index 00000000..15a733d9 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h__incl.md5 @@ -0,0 +1 @@ +a31fee3d719b6cd04e630adfe10001b6 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__dummy_8h__incl.png b/doc/libtrap-devel/ifc__dummy_8h__incl.png new file mode 100644 index 00000000..1cbe8be3 Binary files /dev/null and b/doc/libtrap-devel/ifc__dummy_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__dummy_8h_source.html b/doc/libtrap-devel/ifc__dummy_8h_source.html new file mode 100644 index 00000000..b5b4e637 --- /dev/null +++ b/doc/libtrap-devel/ifc__dummy_8h_source.html @@ -0,0 +1,87 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_dummy.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_dummy.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_dummy.h
3  * \brief TRAP dummy interfaces (generator and blackhole)
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \date 2013
6  * \date 2014
7  */
8 /*
9  * Copyright (C) 2013,2014 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 #ifndef _TRAP_IFC_DUMMY_H_
45 #define _TRAP_IFC_DUMMY_H_
46 
47 #include "trap_ifc.h"
48 
49 /** Create Generator interface (input ifc).
50  * Receive function of this interface returns always the same data. These data
51  * are given in params on creation.
52  * @param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
53  * @param[in] params Array of n+1 bytes. First byte is equal to n, other bytes
54  * are data the generator should generate.
55  * @param[out] ifc Created interface.
56  * @return Error code (0 on success). Generated interface is returned in ifc.
57  */
58 int create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc);
59 
60 
61 /** Create Blackhole interface (output ifc).
62  * Send function of this interface does nothing, so everything sent to
63  * a blackhole is dropped.
64  * @param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
65  * @param[in] params Ignored.
66  * @param[out] ifc Created interface.
67  * @return Always returns 0.
68  */
69 int create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc);
70 
71 #endif
+ + +
int create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
Definition: ifc_dummy.c:113
+
int create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
Definition: ifc_dummy.c:227
+
Interface of TRAP interfaces.
+
+ + + + diff --git a/doc/libtrap-devel/ifc__file_8c.html b/doc/libtrap-devel/ifc__file_8c.html new file mode 100644 index 00000000..4bd5ae62 --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8c.html @@ -0,0 +1,199 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_file.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_file.c File Reference
+
+
+ +

TRAP file interfaces. +More...

+
#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <arpa/inet.h>
+#include <wordexp.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include "../include/libtrap/trap.h"
+#include "trap_ifc.h"
+#include "trap_internal.h"
+#include "trap_error.h"
+#include "ifc_file.h"
+
+Include dependency graph for ifc_file.c:
+
+
+ + + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Macros

#define _GNU_SOURCE
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void file_destroy (void *priv)
 Close file and free allocated memory. More...
 
void file_terminate (void *priv)
 Set interface state as terminated. More...
 
int _mkdir (const char *path)
 Create path, recursive. More...
 
static void file_create_dump (void *priv, uint32_t idx, const char *path)
 Create file dump with current configuration (for debugging) More...
 
int create_next_filename (file_private_t *config)
 Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename. More...
 
int switch_file (file_private_t *c)
 Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be performed after changing the file. More...
 
int file_recv (void *priv, void *data, uint32_t *size, int timeout)
 Read data from a file. More...
 
char * file_recv_ifc_get_id (void *priv)
 
uint8_t file_recv_ifc_is_conn (void *priv)
 
int create_file_recv_ifc (trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface. More...
 
void switch_file_wrapper (void *priv)
 
int file_write_buffer (void *priv, const void *data, uint32_t size, int timeout)
 Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian) More...
 
static void finish_buffer (file_buffer_t *buffer)
 
static void insert_into_buffer (file_buffer_t *buffer, const void *data, uint16_t size)
 
void file_flush (void *priv)
 
static int file_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately. More...
 
int32_t file_get_client_count (void *priv)
 
int8_t file_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
char * file_send_ifc_get_id (void *priv)
 
int create_file_send_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file output interface. This function is called by TRAP library to initialize one output interface. More...
 
+

Detailed Description

+

TRAP file interfaces.

+
Author
Tomas Jansky jansk.nosp@m.to1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2015
+ +

Definition in file ifc_file.c.

+

Macro Definition Documentation

+ +

◆ _GNU_SOURCE

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+ +

Definition at line 43 of file ifc_file.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__file_8c__incl.map b/doc/libtrap-devel/ifc__file_8c__incl.map new file mode 100644 index 00000000..6c2db03a --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8c__incl.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap-devel/ifc__file_8c__incl.md5 b/doc/libtrap-devel/ifc__file_8c__incl.md5 new file mode 100644 index 00000000..16356090 --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8c__incl.md5 @@ -0,0 +1 @@ +3affc72ddefd30974615b56b2357a834 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__file_8c__incl.png b/doc/libtrap-devel/ifc__file_8c__incl.png new file mode 100644 index 00000000..d6310e2d Binary files /dev/null and b/doc/libtrap-devel/ifc__file_8c__incl.png differ diff --git a/doc/libtrap-devel/ifc__file_8c_source.html b/doc/libtrap-devel/ifc__file_8c_source.html new file mode 100644 index 00000000..9549cabb --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8c_source.html @@ -0,0 +1,183 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_file.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_file.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_file.c
3  * \brief TRAP file interfaces
4  * \author Tomas Jansky <janskto1@fit.cvut.cz>
5  * \date 2015
6  */
7 /*
8  * Copyright (C) 2015, 2016 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 #define _GNU_SOURCE
44 #include <string.h>
45 #include <stdlib.h>
46 #include <stdint.h>
47 #include <stdio.h>
48 #include <inttypes.h>
49 #include <arpa/inet.h>
50 #include <wordexp.h>
51 #include <unistd.h>
52 #include <sys/stat.h>
53 #include <errno.h>
54 
55 #include "../include/libtrap/trap.h"
56 #include "trap_ifc.h"
57 #include "trap_internal.h"
58 #include "trap_error.h"
59 #include "ifc_file.h"
60 
61 /**
62  * \addtogroup trap_ifc TRAP communication module interface
63  * @{
64  */
65 /**
66  * \addtogroup file_ifc file interface module
67  * @{
68  */
69 
70 /**
71  * \brief Close file and free allocated memory.
72  * \param[in] priv pointer to module private data
73  */
74 void file_destroy(void *priv)
75 {
76  int i;
77  file_private_t *config = (file_private_t*) priv;
78 
79  if (config) {
80  if (config->file_cnt != 0) {
81  for (i = 0; i < config->file_cnt; i++) {
82  free(config->files[i]);
83  }
84 
85  free(config->files);
86  }
87 
88  if (config->fd) {
89  fclose(config->fd);
90  }
91 
92  if (config->buffer.header) {
93  free(config->buffer.header);
94  }
95 
96  free(config);
97  } else {
98  VERBOSE(CL_ERROR, "FILE IFC: attempt to destroy IFC that is probably not initialized.");
99  }
100 }
101 
102 /**
103  * \brief Set interface state as terminated.
104  * \param[in] priv pointer to module private data
105  */
106 void file_terminate(void *priv)
107 {
108  if (priv) {
109  ((file_private_t*)priv)->is_terminated = 1;
110  } else {
111  VERBOSE(CL_ERROR, "FILE IFC: attempt to terminate IFC that is probably not initialized.");
112  }
113 }
114 
115 /**
116  * Author Jonathon Reinhart
117  * Adapted from https://gist.github.com/JonathonReinhart/8c0d90191c38af2dcadb102c4e202950
118  * \brief Create path, recursive.
119  * \param[in] path where file will be created
120  * \return 0 on success, -1 otherwise
121  */
122 int _mkdir(const char *path)
123 {
124  mode_t perm = S_IRWXU | S_IXGRP | S_IRGRP | S_IROTH | S_IXOTH;
125  const size_t len = strlen(path);
126  char _path[PATH_MAX];
127  char *p;
128 
129  if (len > sizeof(_path) - 1) {
130  return -1;
131  }
132 
133  strcpy(_path, path);
134  for (p = _path + 1; *p; p++) {
135  if (*p == '/') {
136  /* Temporarily truncate */
137  *p = '\0';
138 
139  if (mkdir(_path, perm) != 0) {
140  if (errno != EEXIST) {
141  return -1;
142  }
143  }
144 
145  *p = '/';
146  }
147  }
148 
149  return 0;
150 }
151 
152 /**
153  * \brief Create file dump with current configuration (for debugging)
154  * \param[in] priv pointer to module private data
155  * \param[in] idx number of interface
156  * \param[in] path path where dump file will be created
157  */
158 static void file_create_dump(void *priv, uint32_t idx, const char *path)
159 {
160  int ret;
161  char *config_file = NULL;
162  FILE *fd = NULL;
163 
164  file_private_t *cf = (file_private_t*) priv;
165  ret = asprintf(&config_file, "%s/trap-i%02"PRIu32"-config.txt", path, idx);
166  if (ret == -1) {
167  VERBOSE(CL_ERROR, "FILE IFC: not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
168  return;
169  }
170 
171  fd = fopen(config_file, "w");
172  if (fd == NULL) {
173  free(config_file);
174  VERBOSE(CL_ERROR, "FILE IFC: unable to write to dump file. (%s:%d)", __FILE__, __LINE__);
175  return;
176  }
177 
178  fprintf(fd, "Filename: %s\nMode: %s\nTerminated status: %c\n", cf->filename, cf->mode, cf->is_terminated);
179  fclose(fd);
180  free(config_file);
181 }
182 
183 /**
184  * \brief Create a new path and filename from the template created during interface initialization.
185  * New filename is stored in file_private_t->filename.
186  *
187  * \param[in,out] config Pointer to module private data.
188  *
189  * \return TRAP_E_OK on success,
190  TRAP_E_MEMORY if function time(NULL) returns -1,
191  TRAP_E_IO_ERROR if error occurs during directory creation,
192  TRAP_E_BADPARAMS if the specified path and filename exceeds MAX_PATH - 1 bytes.
193  */
195 {
196  char buf[PATH_MAX];
197  char suffix[FILE_SIZE_SUFFIX_LEN + 1];
198  uint8_t valid_suffix_present = 0;
199 
200  config->create_time = time(NULL);
201  if (config->create_time == -1) {
202  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: Unable to retrieve current timestamp.", config->ifc_idx);
203  return TRAP_E_MEMORY;
204  }
205 
206  /* Get actual time a round the time based on user specified parameter */
207  if (config->file_change_time > 0) {
208  config->create_time -= (config->create_time % (config->file_change_time * 60));
209  }
210 
211  /* Create valid path string based on the template and actual time */
212  size_t len = strftime(buf, PATH_MAX - FILE_SIZE_SUFFIX_LEN, config->filename_tmplt, localtime(&config->create_time));
213  if (len == 0) {
214  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: Path and filename exceeds maximum size: %u.", config->ifc_idx, PATH_MAX - FILE_SIZE_SUFFIX_LEN);
215  return TRAP_E_BADPARAMS;
216  }
217 
218  /* Recursively create specified directory and subdirectories*/
219  if (_mkdir(buf) != 0) {
220  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: Unable to create specified directory.", config->ifc_idx);
221  return TRAP_E_IO_ERROR;
222  }
223 
224  /* If the user specified append mode, get the lowest possible numeric suffix for which there does not exist a file */
225  if (config->mode[0] == 'a') {
226  while (42) {
227  if (sprintf(suffix, ".%05" PRIu16, config->file_index) < 0) {
228  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: sprintf failed.", config->ifc_idx);
229  return TRAP_E_IO_ERROR;
230  }
231 
232  memcpy(buf + len, suffix, FILE_SIZE_SUFFIX_LEN);
233  buf[len + FILE_SIZE_SUFFIX_LEN] = 0;
234  config->file_index++;
235 
236  /* Detected overflow */
237  if (config->file_index == 0) {
238  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: No valid file names left.", config->ifc_idx);
239  return TRAP_E_IO_ERROR;
240  }
241 
242  if (access(buf, F_OK) != 0) {
243  len += FILE_SIZE_SUFFIX_LEN;
244  valid_suffix_present = 1;
245  break;
246  }
247  }
248  }
249 
250  /* If the user specified file splitting based on size (and suffix was not yet added due to 'append' mode) */
251  if (config->file_change_size != 0 && !valid_suffix_present) {
252  if (sprintf(suffix, ".%05" PRIu16, config->file_index) < 0) {
253  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: sprintf failed.", config->ifc_idx);
254  return TRAP_E_IO_ERROR;
255  }
256 
257  memcpy(buf + len, suffix, FILE_SIZE_SUFFIX_LEN);
258  len += FILE_SIZE_SUFFIX_LEN;
259  buf[len] = 0;
260  config->file_index++;
261  }
262 
263  /* Copy newly created path to context inner data structure */
264  strncpy(config->filename, buf, len);
265  return TRAP_E_OK;
266 }
267 
268 /**
269  * \brief Close previous file, open next file (name taken in file_private_t->filename).
270  * Negotiation must be performed after changing the file.
271  *
272  * \param[in,out] c Pointer to module private data.
273  *
274  * \return TRAP_E_OK on success,
275  * TRAP_E_BADPARAMS if the next file cannot be opened.
276  */
278 {
279  if (c->fd != NULL) {
280  fclose(c->fd);
281  c->fd = NULL;
282  }
283 
284  c->neg_initialized = 0;
285  c->fd = fopen(c->filename, c->mode);
286  if (c->fd == NULL) {
287  VERBOSE(CL_ERROR, "FILE IFC[%"PRIu32"]: unable to open file \"%s\" in mode \"%c\". Possible reasons: non-existing file, bad permission, file can not be opened in this mode.", c->ifc_idx, c->filename, c->mode[0]);
288  return TRAP_E_BADPARAMS;
289  }
290 
291  return TRAP_E_OK;
292 }
293 
294 /***** Receiver *****/
295 
296 /**
297  * \addtogroup file_receiver
298  * @{
299  */
300 
301 /**
302  * \brief Read data from a file.
303  * \param[in] priv pointer to module private data
304  * \param[out] data pointer to a memory block in which data is to be stored
305  * \param[out] size pointer to a memory block in which size of read data is to be stored
306  * \param[in] timeout NOT USED IN THIS INTERFACE
307  * \return 0 on success (TRAP_E_OK), TRAP_E_IO_ERROR if error occurs during reading, TRAP_E_TERMINATED if interface was terminated.
308  */
309 int file_recv(void *priv, void *data, uint32_t *size, int timeout)
310 {
311  size_t loaded;
312  /* Header of message inside the buffer */
313  uint16_t *m_head = data;
314  uint32_t data_size = 0;
315 
316  file_private_t *config = (file_private_t*) priv;
317 
318  if (config->is_terminated) {
319  return trap_error(config->ctx, TRAP_E_TERMINATED);
320  }
321 
322  /* Check whether the file stream is open */
323  if (config->fd == NULL) {
324  return trap_error(config->ctx, TRAP_E_NOT_INITIALIZED);
325  }
326 
327 #ifdef ENABLE_NEGOTIATION
328 neg_start:
329  if (config->neg_initialized == 0) {
330  switch(input_ifc_negotiation((void *) config, TRAP_IFC_TYPE_FILE)) {
331  case NEG_RES_FMT_UNKNOWN:
332  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: failed (unknown data format of the output interface).", config->ifc_idx);
334 
335  case NEG_RES_CONT:
336  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: success.", config->ifc_idx);
337  config->neg_initialized = 1;
338  break;
339 
341  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: success (data specifier of the input interface is subset of the output interface data specifier).", config->ifc_idx);
342  config->neg_initialized = 1;
343  break;
344 
346  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: success (new data specifier of the output interface is subset of the old one; it was not first negotiation).", config->ifc_idx);
347  config->neg_initialized = 1;
348  break;
349 
350  case NEG_RES_FAILED:
351  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: failed (error while receiving hello message from output interface).", config->ifc_idx);
353 
355  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: failed (data format or data specifier mismatch).", config->ifc_idx);
356  return TRAP_E_FORMAT_MISMATCH;
357 
358  default:
359  VERBOSE(CL_VERBOSE_LIBRARY, "FILE INPUT IFC[%"PRIu32"] negotiation result: default case.", config->ifc_idx);
360  break;
361  }
362  }
363 #endif
364 
365  /* Read 4 bytes from the file, determining the length of bytes to be read to @param[out] data */
366  loaded = fread(&data_size, sizeof(uint32_t), 1, config->fd);
367  if (loaded != 1) {
368  if (feof(config->fd)) {
369 
370  /* Test whether this was the last file */
371  if (++(config->file_index) >= config->file_cnt) {
372  /* Set size of buffer to the size of 1 message (including its header) */
373  (*size) = 2;
374  /* Set the header of message to 0B */
375  *m_head = 0;
376 
377  return TRAP_E_OK;
378  }
379 
380  strncpy(config->filename, config->files[config->file_index], sizeof(config->filename) - 1);
381  if (switch_file(config) == TRAP_E_OK) {
382 #ifdef ENABLE_NEGOTIATION
383  goto neg_start;
384 #endif
385  } else {
386  return trap_errorf(config->ctx, TRAP_E_IO_ERROR, "INPUT FILE IFC[%"PRIu32"]: Unable to open next file.", config->ifc_idx);
387  }
388  } else {
389  VERBOSE(CL_ERROR, "INPUT FILE IFC[%"PRIu32"]: Read error occurred in file: %s", config->ifc_idx, config->filename);
390  return trap_errorf(config->ctx, TRAP_E_IO_ERROR, "INPUT FILE IFC[%"PRIu32"]: Unable to read.", config->ifc_idx);
391  }
392  }
393 
394  *size = ntohl(data_size);
395  /* Read (*size) bytes from the file */
396  loaded = fread(data, 1, (*size), config->fd);
397  if (loaded != (*size)) {
398  VERBOSE(CL_ERROR, "INPUT FILE IFC[%"PRIu32"]: Read incorrect number of bytes from file: %s. Attempted to read %d bytes, but the actual count of bytes read was %zu.", config->ifc_idx, config->filename, (*size), loaded);
399  }
400 
401  return TRAP_E_OK;
402 }
403 
404 char *file_recv_ifc_get_id(void *priv)
405 {
406  return ((priv) ? ((file_private_t *) priv)->filename : NULL);
407 }
408 
409 uint8_t file_recv_ifc_is_conn(void *priv)
410 {
411  if (priv == NULL) {
412  return 0;
413  }
414  file_private_t *config = (file_private_t *) priv;
415  if (config->fd != NULL) {
416  return 1;
417  }
418  return 0;
419 }
420 
421 /**
422  * \brief Allocate and initiate file input interface.
423  * This function is called by TRAP library to initialize one input interface.
424  *
425  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
426  * \param[in] params Configuration string containing *file_name*,
427  * where file_name is a path to a file from which data is to be read
428  * \param[in,out] ifc IFC interface used for calling file module.
429  * \param[in] idx Index of IFC that is created.
430  * \return 0 on success (TRAP_E_OK), TRAP_E_MEMORY, TRAP_E_BADPARAMS on error
431  */
432 int create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
433 {
434  file_private_t *priv;
435  size_t name_length;
436  wordexp_t files_exp;
437  int i, j;
438 
439  if (params == NULL) {
440  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE INPUT IFC[%"PRIu32"]: Parameter is null pointer.", idx);
441  }
442 
443  /* Create structure to store private data */
444  priv = calloc(1, sizeof(file_private_t));
445  if (!priv) {
446  return trap_error(ctx, TRAP_E_MEMORY);
447  }
448 
449  priv->ctx = ctx;
450  priv->ifc_idx = idx;
451  /* Perform shell-like expansion of ~ */
452  if (wordexp(params, &files_exp, 0) != 0) {
453  VERBOSE(CL_ERROR, "FILE INPUT IFC[%"PRIu32"]: Unable to perform shell-like expansion of: %s", idx, params);
454  free(priv);
455  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE INPUT IFC[%"PRIu32"]: Unable to perform shell-like expansion.", idx);
456  }
457 
458  if (files_exp.we_wordc == 0) {
459  VERBOSE(CL_ERROR, "FILE INPUT IFC[%"PRIu32"]: No files found for parameter: '%s'", idx, params);
460  free(priv);
461  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE INPUT IFC[%"PRIu32"]: Unable to perform shell-like expansion.", idx);
462  }
463 
464  priv->file_cnt = files_exp.we_wordc;
465  priv->files = (char**) calloc(priv->file_cnt, sizeof(char*));
466  if (!priv->files) {
467  free(priv);
468  wordfree(&files_exp);
469  return trap_error(ctx, TRAP_E_MEMORY);
470  }
471 
472  for (i = 0; i < priv->file_cnt; i++) {
473  name_length = strlen(files_exp.we_wordv[i]);
474  priv->files[i] = (char*) calloc(name_length + 1, sizeof(char));
475  if (!priv->files[i]) {
476  for (j = i - 1; j >= 0; j --) {
477  free(priv->files[j]);
478  }
479 
480  free(priv->files);
481  free(priv);
482  wordfree(&files_exp);
483  return trap_error(ctx, TRAP_E_MEMORY);
484  }
485 
486  strncpy(priv->files[i], files_exp.we_wordv[i], name_length);
487  }
488 
489  wordfree(&files_exp);
490 
491  /* Check if the expanded path is not longer than supported maximum path length. */
492  if (strlen(priv->files[0]) > PATH_MAX - 1) {
493  VERBOSE(CL_ERROR, "FILE INPUT IFC[%"PRIu32"]: Path and filename exceeds maximum size: %u.", idx, PATH_MAX - 1);
494  for (i = 0; i < priv->file_cnt; i++) {
495  free(priv->files[i]);
496  }
497 
498  free(priv->files);
499  free(priv);
500  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE INPUT IFC[%"PRIu32"]: Path and filename exceeds maximum size.", idx);
501  }
502 
503  strncpy(priv->filename, priv->files[0], PATH_MAX - 1);
504 
505  /* Sets mode and filename */
506  strcpy(priv->mode, "rb");
507 
508  /* Attempts to open the file */
509  priv->fd = fopen(priv->filename, priv->mode);
510  if (priv->fd == NULL) {
511  VERBOSE(CL_ERROR, "INPUT FILE IFC[%"PRIu32"]: unable to open file \"%s\". Possible reasons: non-existing file, bad permission.", idx, priv->filename);
512  for (i = 0; i < priv->file_cnt; i++) {
513  free(priv->files[i]);
514  }
515 
516  free(priv->files);
517  free(priv);
518  return trap_errorf(ctx, TRAP_E_BADPARAMS, "INPUT FILE IFC[%"PRIu32"]: Unable to open file.", idx);
519  }
520 
521  /* Fills interface structure */
522  ifc->recv = file_recv;
523  ifc->terminate = file_terminate;
524  ifc->destroy = file_destroy;
526  ifc->priv = priv;
529 
530  return TRAP_E_OK;
531 }
532 
533 /**
534  * @}
535  *//* file_receiver */
536 
537 /***** Sender *****/
538 
539 void switch_file_wrapper(void *priv)
540 {
541  file_private_t *c = (file_private_t *) priv;
542  if (c && !c->is_terminated && (create_next_filename(c) == TRAP_E_OK)) {
543  if (switch_file(c) != TRAP_E_OK) {
544  VERBOSE(CL_WARNING, "disconnect_clients sub function switch_file failed.");
545  }
546  }
547 }
548 /**
549  * \addtogroup file_sender
550  * @{
551  */
552 
553 /**
554  * \brief Write data to a file.
555  * Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length
556  * trap_buffer_header_t->data_length is expected to be in network byte order (little endian)
557  *
558  * \param[in] priv pointer to module private data
559  * \param[in] data pointer to data to write
560  * \param[in] size size of data to write - NOT USED IN THIS INTERFACE
561  * \param[in] timeout NOT USED IN THIS INTERFACE
562  * \return 0 on success (TRAP_E_OK), TRAP_E_IO_ERROR if error occurs during writing, TRAP_E_TERMINATED if interface was terminated.
563  */
564 int file_write_buffer(void *priv, const void *data, uint32_t size, int timeout)
565 {
566  int ret_val = 0;
567  file_private_t *config = (file_private_t*) priv;
568  size_t written;
569 
570  if (config->is_terminated) {
571  return trap_error(config->ctx, TRAP_E_TERMINATED);
572  }
573 
574  /* Check whether the file stream is opened */
575  if (config->fd == NULL) {
576  return trap_error(config->ctx, TRAP_E_NOT_INITIALIZED);
577  }
578 
579 #ifdef ENABLE_NEGOTIATION
580  if (config->neg_initialized == 0) {
581  ret_val = output_ifc_negotiation((void *) config, TRAP_IFC_TYPE_FILE, 0);
582  if (ret_val == NEG_RES_OK) {
583  VERBOSE(CL_VERBOSE_LIBRARY, "FILE OUTPUT IFC[%"PRIu32"] negotiation result: success.", config->ifc_idx);
584  config->neg_initialized = 1;
585  fflush(config->fd);
586  } else if (ret_val == NEG_RES_FMT_UNKNOWN) {
587  VERBOSE(CL_VERBOSE_LIBRARY, "FILE OUTPUT IFC[%"PRIu32"] negotiation result: failed (unknown data format of this output interface -> refuse client).", config->ifc_idx);
588  return trap_error(config->ctx, TRAP_E_NOT_INITIALIZED);
589  } else { /* ret_val == NEG_RES_FAILED */
590  VERBOSE(CL_VERBOSE_LIBRARY, "FILE OUTPUT IFC[%"PRIu32"] negotiation result: failed (error while sending hello message to input interface).", config->ifc_idx);
591  return trap_error(config->ctx, TRAP_E_NOT_INITIALIZED);
592  }
593  }
594 #endif
595 
596  /* Writes data_length bytes to the file */
597  written = fwrite(data, 1, size, config->fd);
598  if (written != size) {
599  return trap_errorf(config->ctx, TRAP_E_IO_ERROR, "FILE OUTPUT IFC[%"PRIu32"]: unable to write to file: %s", config->ifc_idx, config->filename);
600  }
601 
602  if (config->file_change_time != 0) {
603  time_t current_time = time(NULL);
604 
605  /* Check whether new file should be created */
606  if (difftime(current_time, config->create_time) / 60 >= config->file_change_time) {
607  config->file_index = 0;
608  /* Create new filename from the current timestamp */
609  int status = create_next_filename(config);
610  if (status != TRAP_E_OK) {
611  return trap_errorf(config->ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file creation.", config->ifc_idx);
612  }
613 
614  /* Open newly created file */
615  status = switch_file(config);
616  if (status != TRAP_E_OK) {
617  return trap_errorf(config->ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file opening.", config->ifc_idx);
618  }
619  }
620  }
621 
622  if (config->file_change_size != 0 && (uint64_t)ftell(config->fd) >= (uint64_t)(1024 * 1024 * (uint64_t)config->file_change_size)) {
623 
624  /* Create new filename from the current timestamp */
625  int status = create_next_filename(config);
626  if (status != TRAP_E_OK) {
627  return trap_errorf(config->ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file creation.", config->ifc_idx);
628  }
629 
630  /* Open newly created file */
631  status = switch_file(config);
632  if (status != TRAP_E_OK) {
633  return trap_errorf(config->ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file opening.", config->ifc_idx);
634  }
635  }
636 
637  return TRAP_E_OK;
638 }
639 
640 static inline void finish_buffer(file_buffer_t *buffer)
641 {
642  uint32_t header = htonl(buffer->wr_index);
643  memcpy(buffer->header, &header, sizeof(header));
644  buffer->finished = 1;
645 }
646 
647 static inline void insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size)
648 {
649  uint16_t *msize = (uint16_t *)(buffer->data + buffer->wr_index);
650  (*msize) = htons(size);
651  memcpy((void *)(msize + 1), data, size);
652  buffer->wr_index += (size + sizeof(size));
653 }
654 
655 void file_flush(void *priv)
656 {
657  int result;
658  file_private_t *c = (file_private_t *) priv;
659  file_buffer_t *buffer = &c->buffer;
660 
661  finish_buffer(buffer);
662 
663  result = file_write_buffer(priv, buffer->header, buffer->wr_index + sizeof(buffer->wr_index), 0);
664 
665  if (result == TRAP_E_OK) {
666  __sync_add_and_fetch(&c->ctx->counter_send_buffer[c->ifc_idx], 1);
667 
668  /* Reset buffer and insert the message if it was not inserted. */
669  buffer->wr_index = 0;
670  buffer->finished = 0;
671  } else {
672  VERBOSE(CL_ERROR, "File IFC flush failed (file_write_buffer returned %i)", result);
673  }
674 }
675 
676 /**
677  * \brief Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately.
678  *
679  * \param[in] priv pointer to module private data
680  * \param[in] data pointer to data to write
681  * \param[in] size size of data to write
682  * \param[in] timeout NOT USED IN THIS INTERFACE
683  *
684  * \return TRAP_E_OK Success.
685  * \return TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
686  * \return TRAP_E_TERMINATED Libtrap was terminated during the process.
687  */
688 static inline int file_send(void *priv, const void *data, uint16_t size, int timeout)
689 {
690  int result = TRAP_E_OK;
691  file_private_t *c = (file_private_t *) priv;
692  file_buffer_t *buffer = &c->buffer;
693  uint32_t needed_size = size + sizeof(size);
694  uint32_t free_bytes = c->buffer_size - c->buffer.wr_index;
695  uint8_t reinsert = 0;
696 
697  /* Can we put message at least into empty buffer? In the worst case, we could end up with SEGFAULT -> rather skip with error */
698  if (needed_size > c->buffer_size) {
699  return trap_errorf(c->ctx, TRAP_E_MEMORY, "Buffer is too small for this message. Skipping...");
700  }
701 
702  /* Check whether the message can be stored into buffer. */
703  if (buffer->finished == 0) {
704  if (free_bytes >= needed_size) {
705  insert_into_buffer(buffer, data, size);
706 
707  /* If bufferswitch is 0, only 1 message is allowed to be stored in buffer */
708  if (c->ctx->out_ifc_list[c->ifc_idx].bufferswitch == 0) {
709  finish_buffer(buffer);
710  }
711  } else {
712  /* Need to send buffer first. */
713  finish_buffer(buffer);
714  reinsert = 1;
715  }
716  }
717 
718  /* Buffer ready to be sent. */
719  if (buffer->finished == 1) {
720 
721  result = file_write_buffer(priv, buffer->header, buffer->wr_index + sizeof(buffer->wr_index), timeout);
722 
723  if (result == TRAP_E_OK) {
724  __sync_add_and_fetch(&c->ctx->counter_send_buffer[c->ifc_idx], 1);
725 
726  /* Reset buffer and insert the message if it was not inserted. */
727  buffer->wr_index = 0;
728  buffer->finished = 0;
729  if (reinsert) {
730  insert_into_buffer(buffer, data, size);
731  }
732  }
733  }
734 
735  return result;
736 }
737 
738 int32_t file_get_client_count(void *priv)
739 {
740  return 1;
741 }
742 
743 int8_t file_get_client_stats_json(void *priv, json_t *client_stats_arr)
744 {
745  /* do not collect client statistics for this interface */
746  return 1;
747 }
748 
749 char *file_send_ifc_get_id(void *priv)
750 {
751  return ((priv) ? ((file_private_t *) priv)->filename : NULL);
752 }
753 
754 /**
755  * \brief Allocate and initiate file output interface.
756  * This function is called by TRAP library to initialize one output interface.
757  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
758  * \param[in] params Configuration string containing colon separated values of these parameters (in this exact order): *file_name*:*open_mode*,
759  * where file_name is a path to a file in which data is to be written and
760  * open_mode is either a - append or w - write, if no mode is specified, the file will be opened in append mode.
761  * \param[in,out] ifc IFC interface used for calling file module.
762  * \param[in] idx Index of IFC that is created.
763  * \return 0 on success (TRAP_E_OK), TRAP_E_MEMORY, TRAP_E_BADPARAMS on error
764  */
765 int create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
766 {
767  file_private_t *priv;
768  char *dest;
769  const char *params_next = NULL;
770  wordexp_t exp_result;
771  size_t length;
772 
773  uint32_t buffer_size = TRAP_IFC_MESSAGEQ_SIZE;
774 
775  if (params == NULL) {
776  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE OUTPUT IFC[%"PRIu32"]: Parameter is null pointer.", idx);
777  }
778 
779  /* Create structure to store private data */
780  priv = calloc(1, sizeof(file_private_t));
781  if (!priv) {
782  return trap_error(ctx, TRAP_E_MEMORY);
783  }
784 
785  priv->ctx = ctx;
786  priv->ifc_idx = idx;
787  priv->buffer_size = buffer_size;
788  priv->buffer.header = malloc(buffer_size + sizeof(buffer_size));
789  if (priv->buffer.header == NULL) {
790  VERBOSE(CL_ERROR, "Memory allocation failed, terminating...");
791  free(priv);
792  return TRAP_E_MEMORY;
793  }
794  priv->buffer.data = priv->buffer.header + sizeof(buffer_size);
795  priv->buffer.wr_index = 0;
796  priv->buffer.finished = 0;
797  /* Set default mode */
798  strcpy(priv->mode, "wb");
799 
800  /* Parse file name */
801  length = strcspn(params, ":");
802  if (params[length] == ':') {
803  params_next = params + length + 1;
804  }
805 
806  if (length) {
807  dest = (char*) calloc(length + 1, sizeof(char));
808  if (!dest) {
809  free(priv->buffer.header);
810  free(priv);
811  return trap_error(ctx, TRAP_E_MEMORY);
812  }
813 
814  strncpy(dest, params, length);
815  } else {
816  free(priv->buffer.header);
817  free(priv);
818  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE OUTPUT IFC[%"PRIu32"]: Filename not specified.", idx);
819  }
820 
821  /* Perform shell-like expansion of ~ */
822  if (wordexp(dest, &exp_result, 0) != 0) {
823  VERBOSE(CL_ERROR, "FILE OUTPUT IFC[%"PRIu32"]: Unable to perform shell-like expansion of: %s", idx, dest);
824  free(priv->buffer.header);
825  free(priv);
826  free(dest);
827  wordfree(&exp_result);
828  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE OUTPUT IFC[%"PRIu32"]: Unable to perform shell-like expansion.", idx);
829  }
830 
831  free(dest);
832  strncpy(priv->filename_tmplt, exp_result.we_wordv[0], sizeof(priv->filename_tmplt) - 1);
833  wordfree(&exp_result);
834 
835  /* Set special behavior for /dev/stdout */
836  if (strncmp(priv->filename_tmplt, "/dev/stdout", 11) == 0) {
837  priv->mode[0] = 'w';
838  priv->file_change_size = 0;
839  priv->file_change_time = 0;
840  } else {
841  /* Parse remaining parameters */
842  while (params_next) {
843  length = strcspn(params_next, ":");
844  if (length > TIME_PARAM_LEN && strncmp(params_next, TIME_PARAM, TIME_PARAM_LEN) == 0) {
845  priv->file_change_time = atoi(params_next + TIME_PARAM_LEN);
846  if (strlen(priv->filename_tmplt) + TIME_FORMAT_STRING_LEN > sizeof(priv->filename_tmplt) - 1) {
847  free(priv->buffer.header);
848  free(priv);
849  return trap_errorf(ctx, TRAP_E_BADPARAMS, "FILE OUTPUT IFC[%"PRIu32"]: Path and filename exceeds maximum size: %zu.", idx, sizeof(priv->filename_tmplt) - 1);
850  }
851 
852  /* Append timestamp formate to the current template */
853  strcat(priv->filename_tmplt, TIME_FORMAT_STRING);
854  } else if (length > SIZE_PARAM_LEN && strncmp(params_next, SIZE_PARAM, SIZE_PARAM_LEN) == 0) {
855  priv->file_change_size = atoi(params_next + SIZE_PARAM_LEN);
856  } else if (length == 1 && params_next[0] == 'a') {
857  priv->mode[0] = 'a';
858  }
859 
860  if (params_next[length] == '\0') {
861  break;
862  }
863 
864  params_next = params_next + length + 1;
865  }
866  }
867 
868  /* Create first filename from the prepared template */
869  int status = create_next_filename(priv);
870  if (status != TRAP_E_OK) {
871  free(priv->buffer.header);
872  free(priv);
873  return trap_errorf(ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file creation.", idx);
874  }
875 
876  /* Open first file */
877  status = switch_file(priv);
878  if (status != TRAP_E_OK) {
879  free(priv->buffer.header);
880  free(priv);
881  return trap_errorf(ctx, status, "FILE OUTPUT IFC[%"PRIu32"]: Error during output file opening.", idx);
882  }
883 
884  /* Fills interface structure */
885  ifc->send = file_send;
886  ifc->flush = file_flush;
888  ifc->terminate = file_terminate;
889  ifc->destroy = file_destroy;
893  ifc->priv = priv;
895 
896  return TRAP_E_OK;
897 }
898 
899 /**
900  * @}
901  *//* file_sender */
902 
903 /**
904  * @}
905  *//* file_ifc module */
906 
907 /**
908  * @}
909  *//* ifc modules */
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+
#define TIME_FORMAT_STRING_LEN
Definition: ifc_file.h:54
+
#define SIZE_PARAM_LEN
Definition: ifc_file.h:52
+
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
int create_next_filename(file_private_t *config)
Create a new path and filename from the template created during interface initialization. New filename is stored in file_private_t->filename.
Definition: ifc_file.c:194
+
int32_t file_get_client_count(void *priv)
Definition: ifc_file.c:738
+
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
char * file_send_ifc_get_id(void *priv)
Definition: ifc_file.c:749
+
#define NEG_RES_SENDER_FMT_SUBSET
If the data format of input and output interfaces is the same and new data specifier of the output in...
Definition: trap_internal.h:76
+
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+
int8_t file_get_client_stats_json(void *priv, json_t *client_stats_arr)
Definition: ifc_file.c:743
+
int _mkdir(const char *path)
Create path, recursive.
Definition: ifc_file.c:122
+ +
#define FILE_SIZE_SUFFIX_LEN
Definition: ifc_file.h:55
+
#define NEG_RES_FAILED
If receiving the data from output interface fails or sending the data to input interface fails...
Definition: trap_internal.h:84
+
uint32_t ifc_idx
Definition: ifc_file.h:80
+
trap_ctx_priv_t * ctx
Definition: ifc_file.h:66
+
char is_terminated
Definition: ifc_file.h:73
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
TRAP file interfaces.
+
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
Definition: trap.c:2833
+
static void insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size)
Definition: ifc_file.c:647
+ +
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
void switch_file_wrapper(void *priv)
Definition: ifc_file.c:539
+
uint8_t file_recv_ifc_is_conn(void *priv)
Definition: ifc_file.c:409
+
uint8_t neg_initialized
Definition: ifc_file.h:74
+
file_buffer_t buffer
Definition: ifc_file.h:82
+
uint32_t file_change_time
Definition: ifc_file.h:78
+
void file_terminate(void *priv)
Set interface state as terminated.
Definition: ifc_file.c:106
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
uint16_t file_cnt
Definition: ifc_file.h:76
+
int create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Allocate and initiate file output interface. This function is called by TRAP library to initialize on...
Definition: ifc_file.c:765
+
uint8_t * data
Definition: ifc_file.h:61
+
#define TRAP_E_IO_ERROR
IO Error.
Definition: trap.h:93
+
#define VERBOSE(level, format, args...)
+
#define TIME_PARAM
Definition: ifc_file.h:49
+
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
Definition: trap_error.h:92
+ +
uint8_t data[0]
+
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
#define NEG_RES_CONT
If the data format and data specifier of input and output interface are the same (input interface can...
Definition: trap_internal.h:74
+
void file_destroy(void *priv)
Close file and free allocated memory.
Definition: ifc_file.c:74
+
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
Definition: trap_ifc.h:237
+
char filename_tmplt[FILENAME_TEMPLATE_LEN]
Definition: ifc_file.h:70
+
#define TIME_FORMAT_STRING
Definition: ifc_file.h:53
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+ +
uint8_t * header
Definition: ifc_file.h:60
+
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
Definition: trap_ifc.h:250
+
int create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
Allocate and initiate file input interface. This function is called by TRAP library to initialize one...
Definition: ifc_file.c:432
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
uint32_t file_change_size
Definition: ifc_file.h:77
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+ +
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+
uint16_t file_index
Definition: ifc_file.h:75
+
char mode[3]
Definition: ifc_file.h:72
+
#define NEG_RES_FMT_UNKNOWN
If the output interface has not specified data format.
Definition: trap_internal.h:85
+ +
char filename[PATH_MAX]
Definition: ifc_file.h:71
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
time_t create_time
Definition: ifc_file.h:68
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
static void finish_buffer(file_buffer_t *buffer)
Definition: ifc_file.c:640
+
#define NEG_RES_FMT_MISMATCH
If the data format or data specifier of input and output interfaces does not match.
Definition: trap_internal.h:77
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
uint8_t finished
Definition: ifc_file.h:62
+
Error handling for TRAP.
+
int file_recv(void *priv, void *data, uint32_t *size, int timeout)
Read data from a file.
Definition: ifc_file.c:309
+
#define TRAP_E_MEMORY
Memory allocation error.
Definition: trap.h:104
+
char * file_recv_ifc_get_id(void *priv)
Definition: ifc_file.c:404
+
#define NEG_RES_OK
Signaling success (hello message successfully sent to input interface)
Definition: trap_internal.h:81
+ +
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+
int file_write_buffer(void *priv, const void *data, uint32_t size, int timeout)
Write data to a file. Data to write are expected as a trap_buffer_header_t structure, thus actual length of data to be written is determined from trap_buffer_header_t->data_length trap_buffer_header_t->data_length is expected to be in network byte order (little endian)
Definition: ifc_file.c:564
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+
static void file_create_dump(void *priv, uint32_t idx, const char *path)
Create file dump with current configuration (for debugging)
Definition: ifc_file.c:158
+ +
static int trap_error(trap_ctx_priv_t *ctx, int err_num)
Definition: trap_error.h:63
+
void file_flush(void *priv)
Definition: ifc_file.c:655
+
#define SIZE_PARAM
Definition: ifc_file.h:51
+
uint32_t buffer_size
Definition: ifc_file.h:79
+
#define NEG_RES_RECEIVER_FMT_SUBSET
If the data format of input and output interfaces is the same and data specifier of the input interfa...
Definition: trap_internal.h:75
+
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
#define TRAP_IFC_TYPE_FILE
trap_ifc_file (input&output part)
Definition: trap.h:177
+
char ** files
Definition: ifc_file.h:69
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
uint64_t * counter_send_buffer
+
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
Definition: trap.c:2995
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
uint32_t wr_index
Definition: ifc_file.h:59
+
#define TRAP_E_NOT_INITIALIZED
TRAP library not initilized.
Definition: trap.h:103
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
trap_output_ifc_t * out_ifc_list
+
FILE * fd
Definition: ifc_file.h:67
+
Interface of TRAP interfaces.
+
static int file_send(void *priv, const void *data, uint16_t size, int timeout)
Store message into buffer. Write buffer into file if full. If buffering is disabled, the message is sent to the output interface immediately.
Definition: ifc_file.c:688
+
#define TIME_PARAM_LEN
Definition: ifc_file.h:50
+
int switch_file(file_private_t *c)
Close previous file, open next file (name taken in file_private_t->filename). Negotiation must be per...
Definition: ifc_file.c:277
+
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
Definition: trap.h:90
+
#define TRAP_IFC_MESSAGEQ_SIZE
size of message queue used for buffering
Definition: trap.h:206
+
+ + + + diff --git a/doc/libtrap-devel/ifc__file_8h.html b/doc/libtrap-devel/ifc__file_8h.html new file mode 100644 index 00000000..f28be7e9 --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h.html @@ -0,0 +1,317 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_file.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_file.h File Reference
+
+
+ +

TRAP file interfaces. +More...

+
#include <limits.h>
+#include "trap_ifc.h"
+
+Include dependency graph for ifc_file.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + +
+
+

Go to the source code of this file.

+ + + + + + +

+Data Structures

struct  file_buffer_s
 
struct  file_private_s
 
+ + + + + + + + + + + + + + + + + +

+Macros

#define TIME_PARAM   "time="
 
#define TIME_PARAM_LEN   strlen(TIME_PARAM)
 
#define SIZE_PARAM   "size="
 
#define SIZE_PARAM_LEN   strlen(SIZE_PARAM)
 
#define TIME_FORMAT_STRING   ".%Y%m%d%H%M"
 
#define TIME_FORMAT_STRING_LEN   strlen(TIME_FORMAT_STRING)
 
#define FILE_SIZE_SUFFIX_LEN   6
 
#define FILENAME_TEMPLATE_LEN   PATH_MAX + 256
 
+ + + + + +

+Typedefs

typedef struct file_buffer_s file_buffer_t
 
typedef struct file_private_s file_private_t
 
+ + + + + + + +

+Functions

int create_file_recv_ifc (trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface. More...
 
int create_file_send_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file output interface. This function is called by TRAP library to initialize one output interface. More...
 
+

Detailed Description

+

TRAP file interfaces.

+
Author
Tomas Jansky jansk.nosp@m.to1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2015
+ +

Definition in file ifc_file.h.

+

Macro Definition Documentation

+ +

◆ FILE_SIZE_SUFFIX_LEN

+ +
+
+ + + + +
#define FILE_SIZE_SUFFIX_LEN   6
+
+ +

Definition at line 55 of file ifc_file.h.

+ +
+
+ +

◆ FILENAME_TEMPLATE_LEN

+ +
+
+ + + + +
#define FILENAME_TEMPLATE_LEN   PATH_MAX + 256
+
+ +

Definition at line 56 of file ifc_file.h.

+ +
+
+ +

◆ SIZE_PARAM

+ +
+
+ + + + +
#define SIZE_PARAM   "size="
+
+ +

Definition at line 51 of file ifc_file.h.

+ +
+
+ +

◆ SIZE_PARAM_LEN

+ +
+
+ + + + +
#define SIZE_PARAM_LEN   strlen(SIZE_PARAM)
+
+ +

Definition at line 52 of file ifc_file.h.

+ +
+
+ +

◆ TIME_FORMAT_STRING

+ +
+
+ + + + +
#define TIME_FORMAT_STRING   ".%Y%m%d%H%M"
+
+ +

Definition at line 53 of file ifc_file.h.

+ +
+
+ +

◆ TIME_FORMAT_STRING_LEN

+ +
+
+ + + + +
#define TIME_FORMAT_STRING_LEN   strlen(TIME_FORMAT_STRING)
+
+ +

Definition at line 54 of file ifc_file.h.

+ +
+
+ +

◆ TIME_PARAM

+ +
+
+ + + + +
#define TIME_PARAM   "time="
+
+ +

Definition at line 49 of file ifc_file.h.

+ +
+
+ +

◆ TIME_PARAM_LEN

+ +
+
+ + + + +
#define TIME_PARAM_LEN   strlen(TIME_PARAM)
+
+ +

Definition at line 50 of file ifc_file.h.

+ +
+
+

Typedef Documentation

+ +

◆ file_buffer_t

+ +
+
+ + + + +
typedef struct file_buffer_s file_buffer_t
+
+ +
+
+ +

◆ file_private_t

+ +
+
+ + + + +
typedef struct file_private_s file_private_t
+
+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__file_8h__dep__incl.map b/doc/libtrap-devel/ifc__file_8h__dep__incl.map new file mode 100644 index 00000000..fc91c28c --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h__dep__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/ifc__file_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__file_8h__dep__incl.md5 new file mode 100644 index 00000000..68b5f372 --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h__dep__incl.md5 @@ -0,0 +1 @@ +d56b60422597bdd9395688d88bdbd4d5 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__file_8h__dep__incl.png b/doc/libtrap-devel/ifc__file_8h__dep__incl.png new file mode 100644 index 00000000..74df1a99 Binary files /dev/null and b/doc/libtrap-devel/ifc__file_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__file_8h__incl.map b/doc/libtrap-devel/ifc__file_8h__incl.map new file mode 100644 index 00000000..488ca0fc --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__file_8h__incl.md5 b/doc/libtrap-devel/ifc__file_8h__incl.md5 new file mode 100644 index 00000000..5995968b --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h__incl.md5 @@ -0,0 +1 @@ +c1d20c6ff5d5b1071fc950198a57e314 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__file_8h__incl.png b/doc/libtrap-devel/ifc__file_8h__incl.png new file mode 100644 index 00000000..0e9d6cef Binary files /dev/null and b/doc/libtrap-devel/ifc__file_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__file_8h_source.html b/doc/libtrap-devel/ifc__file_8h_source.html new file mode 100644 index 00000000..22b481b6 --- /dev/null +++ b/doc/libtrap-devel/ifc__file_8h_source.html @@ -0,0 +1,112 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_file.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_file.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_file.h
3  * \brief TRAP file interfaces
4  * \author Tomas Jansky <janskto1@fit.cvut.cz>
5  * \date 2015
6  */
7 /*
8  * Copyright (C) 2015, 2016 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 #ifndef _TRAP_IFC_FILE_H_
44 #define _TRAP_IFC_FILE_H_
45 
46 #include <limits.h>
47 #include "trap_ifc.h"
48 
49 #define TIME_PARAM "time="
50 #define TIME_PARAM_LEN strlen(TIME_PARAM)
51 #define SIZE_PARAM "size="
52 #define SIZE_PARAM_LEN strlen(SIZE_PARAM)
53 #define TIME_FORMAT_STRING ".%Y%m%d%H%M"
54 #define TIME_FORMAT_STRING_LEN strlen(TIME_FORMAT_STRING)
55 #define FILE_SIZE_SUFFIX_LEN 6
56 #define FILENAME_TEMPLATE_LEN PATH_MAX + 256
57 
58 typedef struct file_buffer_s {
59  uint32_t wr_index; /**< Pointer to first free byte in buffer payload */
60  uint8_t *header; /**< Pointer to first byte in buffer */
61  uint8_t *data; /**< Pointer to first byte of buffer payload */
62  uint8_t finished; /**< Flag indicating whether buffer is full and ready to be sent */
64 
65 typedef struct file_private_s {
67  FILE *fd;
68  time_t create_time;
69  char **files;
71  char filename[PATH_MAX];
72  char mode[3];
74  uint8_t neg_initialized;
75  uint16_t file_index;
76  uint16_t file_cnt;
77  uint32_t file_change_size;
78  uint32_t file_change_time;
79  uint32_t buffer_size; /**< Buffer size [bytes] */
80  uint32_t ifc_idx; /**< Index of interface in 'ctx->out_ifc_list' array */
81 
84 
85 /** Create file receive interface (input ifc).
86  * Receive function of this interface reads data from defined file.
87  * @param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
88  * @param[in] params <filename> expected.
89  * @param[out] ifc Created interface.
90  * @return Error code (0 on success). Generated interface is returned in ifc.
91  */
92 int create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx);
93 
94 
95 /** Create file send interface (output ifc).
96  * Send function of this interface stores data into defined file.
97  * @param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
98  * @param[in] params <filename>:<mode>:<time>:<size>
99  * <mode> is optional, w - write, a - append. Write is set as default mode.
100  * <time> is optional, periodically rotates file in which the data is being written.
101  * <size> is optional, rotates file in which the data is being written once it reaches specified size.
102  * @param[out] ifc Created interface.
103  * @return Error code (0 on success). Generated interface is returned in ifc.
104  */
105 int create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx);
106 
107 #endif
+
uint32_t ifc_idx
Definition: ifc_file.h:80
+
trap_ctx_priv_t * ctx
Definition: ifc_file.h:66
+
char is_terminated
Definition: ifc_file.h:73
+
struct file_buffer_s file_buffer_t
+
#define FILENAME_TEMPLATE_LEN
Definition: ifc_file.h:56
+
uint8_t neg_initialized
Definition: ifc_file.h:74
+
file_buffer_t buffer
Definition: ifc_file.h:82
+
uint32_t file_change_time
Definition: ifc_file.h:78
+
uint16_t file_cnt
Definition: ifc_file.h:76
+
int create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Allocate and initiate file output interface. This function is called by TRAP library to initialize on...
Definition: ifc_file.c:765
+
uint8_t * data
Definition: ifc_file.h:61
+ +
char filename_tmplt[FILENAME_TEMPLATE_LEN]
Definition: ifc_file.h:70
+ +
uint8_t * header
Definition: ifc_file.h:60
+
struct file_private_s file_private_t
+
int create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
Allocate and initiate file input interface. This function is called by TRAP library to initialize one...
Definition: ifc_file.c:432
+
uint32_t file_change_size
Definition: ifc_file.h:77
+ +
uint16_t file_index
Definition: ifc_file.h:75
+
char mode[3]
Definition: ifc_file.h:72
+
char filename[PATH_MAX]
Definition: ifc_file.h:71
+
time_t create_time
Definition: ifc_file.h:68
+
uint8_t finished
Definition: ifc_file.h:62
+ +
uint32_t buffer_size
Definition: ifc_file.h:79
+
char ** files
Definition: ifc_file.h:69
+
uint32_t wr_index
Definition: ifc_file.h:59
+
FILE * fd
Definition: ifc_file.h:67
+
Interface of TRAP interfaces.
+
+ + + + diff --git a/doc/libtrap-devel/ifc__socket__common_8h.html b/doc/libtrap-devel/ifc__socket__common_8h.html new file mode 100644 index 00000000..4c0a29ae --- /dev/null +++ b/doc/libtrap-devel/ifc__socket__common_8h.html @@ -0,0 +1,541 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_socket_common.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_socket_common.h File Reference
+
+
+ +

This file contains common functions and structures used in socket based interfaces (tcp-ip / tls). +More...

+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + + + +
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  buffer_s
 Output buffer structure. More...
 
+ + + + + + + + + + + + + + + + + +

+Macros

#define BUFFER_COUNT_PARAM_LENGTH   13
 
#define BUFFER_SIZE_PARAM_LENGTH   12
 
#define MAX_CLIENTS_PARAM_LENGTH   12
 
#define DEFAULT_MAX_DATA_LENGTH   (sizeof(trap_buffer_header_t) + 1024)
 
#define DEFAULT_BUFFER_COUNT   50
 
#define DEFAULT_BUFFER_SIZE   100000
 
#define DEFAULT_MAX_CLIENTS   64
 
#define NO_CLIENTS_SLEEP   100000
 
+ + + + +

+Typedefs

typedef struct buffer_s buffer_t
 Output buffer structure. More...
 
+ + + + + + + + + + + + + +

+Functions

static void set_index (uint64_t *bits, int i)
 Set i-th element (one bit) of 'bits' to 1. More...
 
static void del_index (uint64_t *bits, int i)
 Set i-th element (one bit) of 'bits' to 0. More...
 
static uint64_t check_index (uint64_t bits, int i)
 Return value of i-th element (one bit) in the 'bits' array. More...
 
static void insert_into_buffer (buffer_t *buffer, const void *data, uint16_t size)
 Write data into buffer. More...
 
+ + + + +

+Variables

static uint64_t mask [64]
 Array containing constants used for operations with bit arrays. More...
 
+

Detailed Description

+

This file contains common functions and structures used in socket based interfaces (tcp-ip / tls).

+
Author
Matej Barnat barna.nosp@m.ma1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2019
+ +

Definition in file ifc_socket_common.h.

+

Macro Definition Documentation

+ +

◆ BUFFER_COUNT_PARAM_LENGTH

+ +
+
+ + + + +
#define BUFFER_COUNT_PARAM_LENGTH   13
+
+

Used for parsing ifc params

+ +

Definition at line 47 of file ifc_socket_common.h.

+ +
+
+ +

◆ BUFFER_SIZE_PARAM_LENGTH

+ +
+
+ + + + +
#define BUFFER_SIZE_PARAM_LENGTH   12
+
+

Used for parsing ifc params

+ +

Definition at line 48 of file ifc_socket_common.h.

+ +
+
+ +

◆ DEFAULT_BUFFER_COUNT

+ +
+
+ + + + +
#define DEFAULT_BUFFER_COUNT   50
+
+

Default buffer count

+ +

Definition at line 54 of file ifc_socket_common.h.

+ +
+
+ +

◆ DEFAULT_BUFFER_SIZE

+ +
+
+ + + + +
#define DEFAULT_BUFFER_SIZE   100000
+
+

Default buffer size [bytes]

+ +

Definition at line 58 of file ifc_socket_common.h.

+ +
+
+ +

◆ DEFAULT_MAX_CLIENTS

+ +
+
+ + + + +
#define DEFAULT_MAX_CLIENTS   64
+
+

Default size of client array

+ +

Definition at line 62 of file ifc_socket_common.h.

+ +
+
+ +

◆ DEFAULT_MAX_DATA_LENGTH

+ +
+
+ + + + +
#define DEFAULT_MAX_DATA_LENGTH   (sizeof(trap_buffer_header_t) + 1024)
+
+

Obsolete?

+ +

Definition at line 51 of file ifc_socket_common.h.

+ +
+
+ +

◆ MAX_CLIENTS_PARAM_LENGTH

+ +
+
+ + + + +
#define MAX_CLIENTS_PARAM_LENGTH   12
+
+

Used for parsing ifc params

+ +

Definition at line 49 of file ifc_socket_common.h.

+ +
+
+ +

◆ NO_CLIENTS_SLEEP

+ +
+
+ + + + +
#define NO_CLIENTS_SLEEP   100000
+
+

Value used in usleep() when waiting for a client to connect

+ +

Definition at line 65 of file ifc_socket_common.h.

+ +
+
+

Typedef Documentation

+ +

◆ buffer_t

+ +
+
+ + + + +
typedef struct buffer_s buffer_t
+
+ +

Output buffer structure.

+ +
+
+

Function Documentation

+ +

◆ check_index()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static uint64_t check_index (uint64_t bits,
int i 
)
+
+inlinestatic
+
+ +

Return value of i-th element (one bit) in the 'bits' array.

+
Parameters
+ + + +
[in]bitsPointer to the bit array.
[in]iTarget element's index in the 'bits' array.
+
+
+
Returns
Value of i-th element (one bit) in the 'bits' array.
+ +

Definition at line 121 of file ifc_socket_common.h.

+ +
+
+ +

◆ del_index()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void del_index (uint64_t * bits,
int i 
)
+
+inlinestatic
+
+ +

Set i-th element (one bit) of 'bits' to 0.

+
Parameters
+ + + +
[in]bitsPointer to the bit array.
[in]iTarget element's index in the 'bits' array.
+
+
+ +

Definition at line 108 of file ifc_socket_common.h.

+ +
+
+ +

◆ insert_into_buffer()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void insert_into_buffer (buffer_tbuffer,
const void * data,
uint16_t size 
)
+
+inlinestatic
+
+ +

Write data into buffer.

+
Parameters
+ + + + +
[in]bufferPointer to the buffer.
[in]dataPointer to data to write.
[in]sizeSize of the data.
+
+
+ +

Definition at line 133 of file ifc_socket_common.h.

+ +
+
+ +

◆ set_index()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void set_index (uint64_t * bits,
int i 
)
+
+inlinestatic
+
+ +

Set i-th element (one bit) of 'bits' to 1.

+
Parameters
+ + + +
[in]bitsPointer to the bit array.
[in]iTarget element's index in the 'bits' array.
+
+
+ +

Definition at line 97 of file ifc_socket_common.h.

+ +
+
+

Variable Documentation

+ +

◆ mask

+ +
+
+ + + + + +
+ + + + +
uint64_t mask[64]
+
+static
+
+Initial value:
= {
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288,
1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
2147483648, 4294967296, 8589934592, 17179869184, 34359738368, 68719476736, 137438953472, 274877906944,
549755813888, 1099511627776, 2199023255552, 4398046511104, 8796093022208, 17592186044416, 35184372088832,
70368744177664, 140737488355328, 281474976710656, 562949953421312, 1125899906842624, 2251799813685248,
4503599627370496, 9007199254740992, 18014398509481984, 36028797018963968, 72057594037927936, 144115188075855872,
288230376151711744, 576460752303423488, 1152921504606846976, 2305843009213693952, 4611686018427387904, 9223372036854775808ULL
}
+

Array containing constants used for operations with bit arrays.

+ +

Definition at line 81 of file ifc_socket_common.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.map b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.map new file mode 100644 index 00000000..96880b42 --- /dev/null +++ b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.md5 new file mode 100644 index 00000000..8d967652 --- /dev/null +++ b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.md5 @@ -0,0 +1 @@ +aefeff8d2797ae2563e2febf2d8657ea \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.png b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.png new file mode 100644 index 00000000..ef2a0c91 Binary files /dev/null and b/doc/libtrap-devel/ifc__socket__common_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__socket__common_8h_source.html b/doc/libtrap-devel/ifc__socket__common_8h_source.html new file mode 100644 index 00000000..ba04d4e5 --- /dev/null +++ b/doc/libtrap-devel/ifc__socket__common_8h_source.html @@ -0,0 +1,93 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_socket_common.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_socket_common.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_socket_common.h
3  * \brief This file contains common functions and structures used in socket based interfaces (tcp-ip / tls).
4  * \author Matej Barnat <barnama1@fit.cvut.cz>
5  * \date 2019
6  */
7 /*
8  * Copyright (C) 2013-2019 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #ifndef _ifc_socket_common_h_
45 #define _ifc_socket_common_h_
46 
47 #define BUFFER_COUNT_PARAM_LENGTH 13 /**< Used for parsing ifc params */
48 #define BUFFER_SIZE_PARAM_LENGTH 12 /**< Used for parsing ifc params */
49 #define MAX_CLIENTS_PARAM_LENGTH 12 /**< Used for parsing ifc params */
50 
51 #define DEFAULT_MAX_DATA_LENGTH (sizeof(trap_buffer_header_t) + 1024) /**< Obsolete? */
52 
53 #ifndef DEFAULT_BUFFER_COUNT
54 #define DEFAULT_BUFFER_COUNT 50 /**< Default buffer count */
55 #endif
56 
57 #ifndef DEFAULT_BUFFER_SIZE
58 #define DEFAULT_BUFFER_SIZE 100000 /**< Default buffer size [bytes] */
59 #endif
60 
61 #ifndef DEFAULT_MAX_CLIENTS
62 #define DEFAULT_MAX_CLIENTS 64 /**< Default size of client array */
63 #endif
64 
65 #define NO_CLIENTS_SLEEP 100000 /**< Value used in usleep() when waiting for a client to connect */
66 
67 /**
68  * \brief Output buffer structure.
69  */
70 typedef struct buffer_s {
71  uint32_t wr_index; /**< Pointer to first free byte in buffer */
72  uint64_t clients_bit_arr; /**< Bit array of clients that have not yet received the buffer */
73 
74  uint8_t *header; /**< Pointer to first byte in buffer */
75  uint8_t *data; /**< Pointer to first byte of buffer payload */
76 } buffer_t;
77 
78 /**
79  * \brief Array containing constants used for operations with bit arrays.
80  */
81 static uint64_t mask[64] = {
82  1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288,
83  1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
84  2147483648, 4294967296, 8589934592, 17179869184, 34359738368, 68719476736, 137438953472, 274877906944,
85  549755813888, 1099511627776, 2199023255552, 4398046511104, 8796093022208, 17592186044416, 35184372088832,
86  70368744177664, 140737488355328, 281474976710656, 562949953421312, 1125899906842624, 2251799813685248,
87  4503599627370496, 9007199254740992, 18014398509481984, 36028797018963968, 72057594037927936, 144115188075855872,
88  288230376151711744, 576460752303423488, 1152921504606846976, 2305843009213693952, 4611686018427387904, 9223372036854775808ULL
89 };
90 
91 /**
92  * \brief Set i-th element (one bit) of 'bits' to 1.
93  *
94  * \param[in] bits Pointer to the bit array.
95  * \param[in] i Target element's index in the 'bits' array.
96  */
97 static inline void set_index(uint64_t *bits, int i)
98 {
99  *bits = __sync_or_and_fetch(bits, mask[i]);
100 }
101 
102 /**
103  * \brief Set i-th element (one bit) of 'bits' to 0.
104  *
105  * \param[in] bits Pointer to the bit array.
106  * \param[in] i Target element's index in the 'bits' array.
107  */
108 static inline void del_index(uint64_t *bits, int i)
109 {
110  *bits = __sync_and_and_fetch(bits, (0xffffffffffffffff - mask[i]));
111 }
112 
113 /**
114  * \brief Return value of i-th element (one bit) in the 'bits' array.
115  *
116  * \param[in] bits Pointer to the bit array.
117  * \param[in] i Target element's index in the 'bits' array.
118  *
119  * \return Value of i-th element (one bit) in the 'bits' array.
120  */
121 static inline uint64_t check_index(uint64_t bits, int i)
122 {
123  return (bits & mask[i]);
124 }
125 
126 /**
127  * \brief Write data into buffer
128  *
129  * \param[in] buffer Pointer to the buffer.
130  * \param[in] data Pointer to data to write.
131  * \param[in] size Size of the data.
132  */
133 static inline void insert_into_buffer(buffer_t *buffer, const void *data, uint16_t size)
134 {
135  uint16_t *msize = (uint16_t *)(buffer->data + buffer->wr_index);
136  (*msize) = htons(size);
137  memcpy((void *)(msize + 1), data, size);
138  buffer->wr_index += (size + sizeof(size));
139 }
140 
141 #endif
uint8_t * data
+
uint32_t wr_index
+
Output buffer structure.
+
static uint64_t mask[64]
Array containing constants used for operations with bit arrays.
+
static void set_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 1.
+
static void del_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 0.
+
static void insert_into_buffer(buffer_t *buffer, const void *data, uint16_t size)
Write data into buffer.
+
uint8_t data[0]
+
struct buffer_s buffer_t
Output buffer structure.
+
static uint64_t check_index(uint64_t bits, int i)
Return value of i-th element (one bit) in the &#39;bits&#39; array.
+
uint8_t * header
+
uint64_t clients_bit_arr
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8c.html b/doc/libtrap-devel/ifc__tcpip_8c.html new file mode 100644 index 00000000..bb1b19a1 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8c.html @@ -0,0 +1,341 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tcpip.c File Reference
+
+
+ +

TRAP TCP/IP interfaces. +More...

+
#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <pthread.h>
+#include <errno.h>
+#include <semaphore.h>
+#include <assert.h>
+#include <poll.h>
+#include "../include/libtrap/trap.h"
+#include "trap_internal.h"
+#include "trap_ifc.h"
+#include "trap_error.h"
+#include "ifc_tcpip.h"
+#include "ifc_tcpip_internal.h"
+#include "ifc_socket_common.h"
+
+Include dependency graph for ifc_tcpip.c:
+
+
+ + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

union  tcpip_socket_addr
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define _GNU_SOURCE
 
#define MAX_RECOVERY_TRY   10
 
#define RECOVERY_WAIT_USEC   500000
 
#define USEC_IN_SEC   1000000
 
#define ACK_MESS_SIZE   1
 
#define CRIT_1VS2SEND   10000
 
#define MAX(a, b)   ((a)<(b)?(b):(a))
 
#define MIN(a, b)   ((a)>(b)?(b):(a))
 
#define X(p)
 
#define X(pointer)
 
#define X(x)   free(x); x = NULL;
 
#define X(pointer)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

char *trap_default_socket_path_format __attribute__ ((used))
 
static int client_socket_connect (void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv)
 client_socket is used as a receiver More...
 
static void client_socket_disconnect (void *priv)
 
static int server_socket_open (void *priv)
 Open TCPIP socket for sender module. More...
 
static void * get_in_addr (struct sockaddr *sa)
 Get sockaddr, IPv4 or IPv6. More...
 
static int check_portrange (const char *port)
 Check if the given port is a correct port number. More...
 
static int receive_part (void *priv, void **data, uint32_t *size, struct timeval *tm)
 
static uint64_t get_cur_timestamp ()
 
int tcpip_receiver_recv (void *priv, void *data, uint32_t *size, int timeout)
 Receive data from interface. More...
 
void tcpip_receiver_terminate (void *priv)
 Set interface state as terminated. More...
 
void tcpip_receiver_destroy (void *priv)
 Destructor of TCPIP receiver (input ifc) More...
 
static void tcpip_receiver_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tcpip_recv_ifc_get_id (void *priv)
 
uint8_t tcpip_recv_ifc_is_conn (void *priv)
 
int create_tcpip_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
static int wait_for_connection (int sock, struct timeval *tv)
 
static void disconnect_client (tcpip_sender_private_t *priv, int cl_id)
 This function is called when a client was/is being disconnected. More...
 
void tcpip_server_disconnect_all_clients (void *priv)
 Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More...
 
static void * accept_clients_thread (void *arg)
 This function runs in a separate thread and handles new client's connection requests. More...
 
static void finish_buffer (tcpip_sender_private_t *priv, buffer_t *buffer)
 Write buffer size to its header and shift active index. More...
 
void tcpip_sender_flush (void *priv)
 Force flush of active buffer. More...
 
static int send_data (tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id)
 Send data to client from his assigned buffer. More...
 
static void * sending_thread_func (void *priv)
 This function runs in a separate thread. It handles sending data to connected clients for TCPIP and UNIX interfaces. More...
 
int tcpip_sender_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. More...
 
void tcpip_sender_terminate (void *priv)
 Set interface state as terminated. More...
 
void tcpip_sender_destroy (void *priv)
 Destructor of TCP sender (output ifc) More...
 
int32_t tcpip_sender_get_client_count (void *priv)
 
int8_t tcpip_sender_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
static void tcpip_sender_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tcpip_send_ifc_get_id (void *priv)
 
int create_tcpip_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
+

Detailed Description

+

TRAP TCP/IP interfaces.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2018
+ +

Definition in file ifc_tcpip.c.

+

Macro Definition Documentation

+ +

◆ _GNU_SOURCE

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+ +

Definition at line 44 of file ifc_tcpip.c.

+ +
+
+ +

◆ X [1/4]

+ +
+
+ + + + + + + + +
#define X( p)
+
+Value:
if (p != NULL) { \
free(p); \
p = NULL; \
}
+
+
+ +

◆ X [2/4]

+ +
+
+ + + + + + + + +
#define X( pointer)
+
+Value:
free(pointer); \
pointer = NULL;
+
+
+ +

◆ X [3/4]

+ +
+
+ + + + + + + + +
#define X( x)   free(x); x = NULL;
+
+ +
+
+ +

◆ X [4/4]

+ +
+
+ + + + + + + + +
#define X( pointer)
+
+Value:
free(pointer); \
pointer = NULL;
+
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8c__incl.map b/doc/libtrap-devel/ifc__tcpip_8c__incl.map new file mode 100644 index 00000000..769f6e62 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8c__incl.md5 b/doc/libtrap-devel/ifc__tcpip_8c__incl.md5 new file mode 100644 index 00000000..2c453399 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8c__incl.md5 @@ -0,0 +1 @@ +ce03094bc984f9c2ac343d7ccb2214e1 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tcpip_8c__incl.png b/doc/libtrap-devel/ifc__tcpip_8c__incl.png new file mode 100644 index 00000000..6ef30061 Binary files /dev/null and b/doc/libtrap-devel/ifc__tcpip_8c__incl.png differ diff --git a/doc/libtrap-devel/ifc__tcpip_8c_source.html b/doc/libtrap-devel/ifc__tcpip_8c_source.html new file mode 100644 index 00000000..8d5fc13d --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8c_source.html @@ -0,0 +1,263 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tcpip.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tcpip.c
3  * \brief TRAP TCP/IP interfaces
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2018
6  */
7 /*
8  * Copyright (C) 2013-2018 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #define _GNU_SOURCE
45 #include <arpa/inet.h>
46 #include <netdb.h>
47 #include <netinet/in.h>
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <string.h>
51 #include <sys/socket.h>
52 #include <sys/un.h>
53 #include <sys/types.h>
54 #include <sys/stat.h>
55 #include <unistd.h>
56 #include <fcntl.h>
57 #include <inttypes.h>
58 #include <stdio.h>
59 #include <pthread.h>
60 #include <errno.h>
61 #include <semaphore.h>
62 #include <assert.h>
63 #include <poll.h>
64 
65 #include "../include/libtrap/trap.h"
66 #include "trap_internal.h"
67 #include "trap_ifc.h"
68 #include "trap_error.h"
69 #include "ifc_tcpip.h"
70 #include "ifc_tcpip_internal.h"
71 #include "ifc_socket_common.h"
72 
73 /**
74  * \addtogroup trap_ifc TRAP communication module interface
75  * @{
76  */
77 /**
78  * \addtogroup tcpip_ifc TCP/IP and UNIX socket communication interface module
79  * @{
80  */
81 
82 #define MAX_RECOVERY_TRY 10
83 /* must be smaller than 1000000 */
84 #define RECOVERY_WAIT_USEC 500000
85 #define USEC_IN_SEC 1000000
86 #define ACK_MESS_SIZE 1
87 #define CRIT_1VS2SEND 10000
88 #ifndef MAX
89 #define MAX(a,b) ((a)<(b)?(b):(a))
90 #endif
91 #ifndef MIN
92 #define MIN(a,b) ((a)>(b)?(b):(a))
93 #endif
94 
95 /***** TCPIP server *****/
96 
97 /**
98  * Internal union for host address storage, common for tcpip & unix
99  */
101  struct addrinfo tcpip_addr; ///< used for TCPIP socket
102  struct sockaddr_un unix_addr; ///< used for path of UNIX socket
103 };
104 
105 /**
106  * Unix sockets for service IFC and UNIX IFC have default path format defined by UNIX_PATH_FILENAME_FORMAT
107  */
109 
110 static int client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv);
111 static void client_socket_disconnect(void *priv);
112 static int server_socket_open(void *priv);
113 
114 /**
115  * \brief Get sockaddr, IPv4 or IPv6
116  * \param[in] sa structure with input socket address
117  * \return converted ponter to address
118  */
119 static void *get_in_addr(struct sockaddr *sa)
120 {
121  if (sa->sa_family == AF_INET) {
122  return &(((struct sockaddr_in*)sa)->sin_addr);
123  }
124 
125  return &(((struct sockaddr_in6*)sa)->sin6_addr);
126 }
127 
128 /**
129  * \brief Check if the given port is a correct port number.
130  *
131  * Port number for TCP socket must be a number in the range from 1 to 65535.
132  * It can also be a service name that is translated by getaddrinfo().
133  *
134  * \param[in] port Port to check.
135  * \return EXIT_FAILURE if port is not given or it is a number < 1 or > 65535;
136  * EXIT_SUCCESS when port is a valid number or it is a service name.
137  */
138 static int check_portrange(const char *port)
139 {
140  uint32_t portnum = 0;
141  int ret;
142 
143  if (port == NULL) {
144  return EXIT_FAILURE;
145  }
146 
147  ret = sscanf(port, "%" SCNu32, &portnum);
148  if (ret == 1) {
149  if (portnum < 1 || portnum > 65535) {
150  VERBOSE(CL_ERROR, "Given port (%" PRIu32 ") number is out of the allowed range (1-65535).", portnum);
151  return EXIT_FAILURE;
152  }
153  }
154 
155  /* port is not number (it is a service name) or it is correct */
156  return EXIT_SUCCESS;
157 }
158 
159 /**
160  * \addtogroup tcpip_receiver
161  * @{
162  */
163 /* Receiver (client socket) */
164 // Receiver is a client that connects itself to the source of data (to sender) = server
165 
166 /**
167  * Receive chunk of data.
168  *
169  * Caller is responsible for checking elapsed time, since this function
170  * may finished before the given timeout without having data.
171  *
172  * \param[in] priv private IFC data
173  * \param[out] data received data
174  * \param[in,out] size expected size to wait for, it is used to return size that was not read
175  * \param[in] tm timeout
176  */
177 static int receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm)
178 {
179  void *data_p = (*data);
181  ssize_t numbytes = *size;
182  int recvb, retval;
183  struct pollfd pfds;
184  struct timespec ts, *tempts = NULL;
185  if (tm != NULL) {
186  ts.tv_sec = tm->tv_sec;
187  ts.tv_nsec = tm->tv_usec * 1000l;
188  tempts = &ts;
189  }
190 
191  assert(data_p != NULL);
192 
193  while (config->is_terminated == 0) {
194  DEBUG_IFC(if (tm) {VERBOSE(CL_VERBOSE_LIBRARY, "Try to receive data in timeout %" PRIu64
195  "s%"PRIu64"us", tm->tv_sec, tm->tv_usec)});
196 
197  /*
198  * Blocking or with timeout?
199  * With timeout 0,0 - non-blocking
200  */
201  pfds = (struct pollfd) {.fd = config->sd, .events = POLLIN};
202  retval = ppoll(&pfds, 1, tempts, NULL);
203  if (retval > 0 && pfds.revents & POLLIN) {
204  do {
205  recvb = recv(config->sd, data_p, numbytes, 0);
206  if (recvb < 1) {
207  if (recvb == 0) {
208  errno = EPIPE;
209  }
210  switch (errno) {
211  case EINTR:
212  if (config->is_terminated == 1) {
214  return TRAP_E_TERMINATED;
215  }
216  break;
217  case ECONNRESET:
218  case EBADF:
219  case EPIPE:
221  return TRAP_E_IO_ERROR;
222  case EAGAIN:
223  /* This should never happen with blocking socket. */
224  (*size) = numbytes;
225  (*data) = data_p;
226  return TRAP_E_TIMEOUT;
227  }
228  }
229  numbytes -= recvb;
230  data_p += recvb;
231  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "receive_part got %" PRId32 "B", recvb));
232  } while (numbytes > 0);
233  (*size) = numbytes;
234  (*data) = data_p;
235  return TRAP_E_OK;
236  } else if ((retval == 0) || (retval < 0 && errno == EINTR)) {
237  /* Timeout expired or signal received. Caller of this function
238  * has to decide to call this function again or not according
239  * to elapsed time from the calling. */
240  (*size) = numbytes;
241  return TRAP_E_TIMEOUT;
242  } else { // some error has occured
243  VERBOSE(CL_VERBOSE_OFF, "ppoll() returned %i (%s)", retval, strerror(errno));
245  return TRAP_E_IO_ERROR;
246  }
247  }
248  return TRAP_E_TERMINATED;
249 }
250 
251 /**
252  * Return current time in microseconds.
253  *
254  * This is used to get current timestamp in tcpip_receiver_recv() and tcpip_sender_send().
255  *
256  * \return current timestamp
257  */
258 static inline uint64_t get_cur_timestamp()
259 {
260  struct timespec spec_time;
261 
262  clock_gettime(CLOCK_MONOTONIC, &spec_time);
263  /* time in microseconds seconds -> secs * microsends + nanoseconds */
264  return spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
265 }
266 
267 /**
268  * \brief Receive data from interface.
269  *
270  * It is expected that data is always the same pointer because it is buffer given by trap.c.
271  *
272  * This function contains finite state machine that controls receiving messages (header
273  * and payload), handles timeouts and sleep (to offload CPU during waiting for connection).
274  * The transition graph is:
275  * \dot
276  * digraph fsm { label="tcpip_receiver_recv()";labelloc=t;
277  * init -> conn_wait;
278  * init -> head_wait;
279  * init -> mess_wait;
280  * discard -> reset;
281  * reset -> init;
282  * reset -> init;
283  * reset -> reset;
284  * reset -> init;
285  * conn_wait -> reset;
286  * conn_wait -> head_wait;
287  * head_wait -> discard;
288  * head_wait -> reset;
289  * head_wait -> reset;
290  * head_wait -> mess_wait;
291  * mess_wait -> discard;
292  * mess_wait -> reset;
293  * }
294  * \enddot
295  *
296  * \param [in,out] priv private configuration structure
297  * \param [out] data where received data are stored
298  * \param [out] size size of received data
299  * \param [in] timeout timeout in usec, can be TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT
300  * \return TRAP_E_OK (0) on success
301  */
302 int tcpip_receiver_recv(void *priv, void *data, uint32_t *size, int timeout)
303 {
304 #ifdef LIMITED_RECOVERY
305  uint32_t recovery = 0;
306 #endif
307  /** messageframe contains header that is read (even partially) in HEAD_WAIT */
308  trap_buffer_header_t messageframe;
310  void *p = &messageframe;
311  struct timeval tm, *temptm;
312  int retval;
313  uint64_t entry_time = get_cur_timestamp();
314  uint64_t curr_time = 0;
315 
316  /* sleeptime (in usec) with sleeptimespec are used to wait
317  * for a while before next connecting when non-blocking. */
318  uint64_t sleeptime;
319  struct timespec sleeptimespec;
320 
321  /* correct module will pass only possitive timeout or TRAP_WAIT.
322  * TRAP_HALFWAIT is not valid value */
323  assert(timeout > TRAP_HALFWAIT);
324 
325  if ((config == NULL) || (data == NULL) || (size == NULL)) {
326  return TRAP_E_BAD_FPARAMS;
327  }
328  (*size) = 0;
329 
330  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv trap_recv() was called"));
331 
332  /* convert libtrap timeout into timespec and timeval */
333  trap_set_timeouts(timeout, &tm, NULL);
334  temptm = (timeout == TRAP_WAIT) ? NULL : &tm;
335 
336  while (config->is_terminated == 0) {
337 init:
338  p = &messageframe;
339  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv INIT"));
340  if (config->connected == 0) {
341  goto conn_wait;
342  } else {
343  if (config->data_pointer == NULL) {
344  goto head_wait;
345  } else {
346  /* continue where we timedout earlier */
347  p = config->data_pointer;
348  goto mess_wait;
349  }
350  }
351 discard:
352  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv DISCARD"));
353  config->data_pointer = NULL;
354  goto reset;
355 reset:
356  if (config->is_terminated != 0) {
357  /* TRAP_E_TERMINATED is returned outside the loop */
358  break;
359  }
360  /* failure, next state is exit when we are non-blocking or INIT on blocking,
361  this state is a great place for handling timeouts. */
362  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv RESET"));
363  if (timeout == TRAP_WAIT) {
364 #ifdef LIMITED_RECOVERY
365  if (++recovery > MAX_RECOVERY_TRY) {
366  goto init;
367  } else {
368  return TRAP_E_TIMEOUT;
369  }
370 #else
371  goto init;
372 #endif
373  } else {
374  /* non-blocking mode, let's check elapsed time */
375  curr_time = get_cur_timestamp();
376  if ((curr_time - entry_time) >= timeout) {
377  return TRAP_E_TIMEOUT;
378  } else {
379  if (config->connected == 0) {
380  /* wait at most 1 second before return to INIT */
381 
382  /* sleeptime is in usec */
383  sleeptime = timeout - (curr_time - entry_time);
384  /* if remaining sleeptime is higher than 1s, use 1s */
385  if (sleeptime < 1000000) {
386  sleeptimespec.tv_sec = sleeptime / 1000000;
387  sleeptimespec.tv_nsec = (sleeptime % 1000000) * 1000;
388  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "sleep time set %" PRIu64
389  " us: %"PRIu64"s%"PRIu64"ns", sleeptime,
390  sleeptimespec.tv_sec, sleeptimespec.tv_nsec));
391  } else {
392  sleeptimespec.tv_sec = 1;
393  sleeptimespec.tv_nsec = 0;
394  }
395  /* We are not interested in reminder, because timeout will be
396  * checked again later. */
397  if (nanosleep(&sleeptimespec, NULL) == -1) {
398  if (errno == EINTR) {
399  goto reset;
400  } else {
401  VERBOSE(CL_ERROR, "recv nanosleep(): %s", strerror(errno));
402  }
403  }
404  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv nanosleep finished"));
405  }
406 
407  /* update timeout that is used for recv after successful connection */
408  curr_time = get_cur_timestamp();
409  sleeptime = timeout - (int) (curr_time - entry_time);
410  if ((int) sleeptime > 0) {
411  trap_set_timeouts(sleeptime, &tm, NULL);
412  } else {
413  return TRAP_E_TIMEOUT;
414  }
415 
416  goto init;
417  }
418  }
419 conn_wait:
420  /* check if connected -> try to connect -> check if connected; next state is RESET or HEAD_WAIT */
421  /* expected next state is waiting for header */
422  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv CONN_WAIT"));
423  if (config->connected == 0) {
424  /* we don't have connection, we must try to connect before accepting header */
425  retval = client_socket_connect(priv, config->dest_addr, config->dest_port, &config->sd, temptm);
426  if (retval == TRAP_E_FIELDS_MISMATCH) {
427  config->connected = 1;
428  return TRAP_E_FORMAT_MISMATCH;
429  } else if (retval == TRAP_E_NEGOTIATION_FAILED) {
430  config->connected = 1;
432  } else if (retval == TRAP_E_OK) {
433  config->connected = 1;
434  /* ok, wait for header as we planned */
435  } else {
436  /* failed, reseting... */
437  if (timeout == TRAP_WAIT) {
438  /* Create a delay when blocking...
439  * This is specific situation, many attempts would be unpleasant */
440  sleep(1);
441  }
442  goto reset;
443  }
444  }
445  goto head_wait;
446 head_wait:
447  /* get and check header of message, next state can be MESS_WAIT or RESET */
448  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv HEAD_WAIT (%p)", p));
449  config->data_wait_size = sizeof(trap_buffer_header_t);
450  retval = receive_part(config, &p, &config->data_wait_size, temptm);
451  if (retval != TRAP_E_OK) {
452  /* receiving failed */
453  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv failed HEAD (%p) waiting %d B", p, config->data_wait_size));
454  if (retval == TRAP_E_IO_ERROR) {
455  /* disconnected -> drop data */
456  goto discard;
457  }
458 
459  goto reset;
460  } else {
461  /* we expect to receive data */
462  messageframe.data_length = ntohl(messageframe.data_length);
463  config->data_wait_size = messageframe.data_length;
464  config->ext_buffer_size = messageframe.data_length;
465 #ifdef ENABLE_CHECK_HEADER
466  /* check if header is ok: */
467  if (tcpip_check_header(&messageframe) == 0) {
468  goto reset;
469  }
470 #endif
471  /* we got header, now we can start receiving payload */
472  p = data;
473  config->ext_buffer = data;
474  goto mess_wait;
475  }
476 mess_wait:
477  /* get and check payload of message, next state can be RESET or success exit */
478  /* receive payload */
479  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv waiting MESS (%p) %d B", p, config->data_wait_size));
480  retval = receive_part(config, &p, &config->data_wait_size, temptm);
481  if (retval == TRAP_E_OK) {
482  /* Success! Data was already set by recv */
483  config->data_pointer = NULL;
484  (*size) = messageframe.data_length;
485  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv get MESS (%p) remains: %d B", p, config->data_wait_size));
486  return TRAP_E_OK;
487  } else {
488  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv get MESS (%p) still waiting for %d B", p, config->data_wait_size));
489  if (retval == TRAP_E_IO_ERROR) {
490  /* disconnected -> drop data */
491  goto discard;
492  }
493  config->data_pointer = p;
494  goto reset;
495  }
496  }
497  return TRAP_E_TERMINATED;
498 }
499 
500 /**
501  * \brief Set interface state as terminated.
502  * \param[in] priv pointer to module private data
503  */
504 void tcpip_receiver_terminate(void *priv)
505 {
507  if (config != NULL) {
508  config->is_terminated = 1;
509  } else {
510  VERBOSE(CL_ERROR, "Bad parameter of tcpip_receiver_terminate()!");
511  }
512  return;
513 }
514 
515 
516 /**
517  * \brief Destructor of TCPIP receiver (input ifc)
518  * \param[in] priv pointer to module private data
519  */
520 void tcpip_receiver_destroy(void *priv)
521 {
522 #define X(p) if (p != NULL) { \
523 free(p); \
524 p = NULL; \
525 }
527  if (config != NULL) {
528  if (config->connected == 1) {
529  close(config->sd);
530  }
531  X(config->dest_addr);
532  X(config->dest_port);
533  X(config);
534  } else {
535  VERBOSE(CL_ERROR, "Destroying IFC that is probably not initialized.");
536  }
537  return;
538 #undef X
539 }
540 
541 static void tcpip_receiver_create_dump(void *priv, uint32_t idx, const char *path)
542 {
544  /* return value */
545  int r;
546  /* config file trap-i<number>-config.txt */
547  char *conf_file = NULL;
548  /* config file trap-i<number>-buffer.dat */
549  char *buf_file = NULL;
550  FILE *f = NULL;
551  trap_buffer_header_t aux = { 0 };
552  aux.data_length = htonl(c->ext_buffer_size);
553 
554  r = asprintf(&conf_file, "%s/trap-i%02"PRIu32"-config.txt", path, idx);
555  if (r == -1) {
556  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
557  conf_file = NULL;
558  goto exit;
559  }
560  f = fopen(conf_file, "w");
561  fprintf(f, "Dest addr: %s\nDest port: %s\nConnected: %d\n"
562  "Terminated: %d\nSocket descriptor: %d\nSocket type: %d\n"
563  "Data pointer: %p\nData wait size: %"PRIu32"\nMessage header: %"PRIu32"\n"
564  "Extern buffer pointer: %p\nExtern buffer data size: %"PRIu32"\n"
565  "Timeout: %"PRId32"us (%s)\n",
566  c->dest_addr, c->dest_port, c->connected, c->is_terminated, c->sd, c->socket_type,
569  c->ctx->in_ifc_list[idx].datatimeout,
571  fclose(f);
572  f = NULL;
573 
574  r = asprintf(&buf_file, "%s/trap-i%02"PRIu32"-buffer.dat", path, idx);
575  if (r == -1) {
576  buf_file = NULL;
577  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
578  goto exit;
579  }
580  f = fopen(buf_file, "w");
581  if (fwrite(&aux, sizeof(c->ext_buffer_size), 1, f) != 1) {
582  VERBOSE(CL_ERROR, "Writing buffer header failed. (%s:%d)", __FILE__, __LINE__);
583  goto exit;
584  }
585  if (fwrite(c->ext_buffer, c->ext_buffer_size, 1, f) != 1) {
586  VERBOSE(CL_ERROR, "Writing buffer content failed. (%s:%d)", __FILE__, __LINE__);
587  goto exit;
588  }
589 exit:
590  if (f != NULL) {
591  fclose(f);
592  }
593  free(conf_file);
594  free(buf_file);
595  return;
596 }
597 
598 char *tcpip_recv_ifc_get_id(void *priv)
599 {
600  if (priv == NULL) {
601  return NULL;
602  }
603 
605  if (config->dest_port == NULL) {
606  return NULL;
607  }
608  return config->dest_port;
609 }
610 
611 uint8_t tcpip_recv_ifc_is_conn(void *priv)
612 {
613  if (priv == NULL) {
614  return 0;
615  }
617  if (config->connected == 1) {
618  return 1;
619  }
620  return 0;
621 }
622 
623 /**
624  * \brief Constructor of input TCP/IP IFC module.
625  * This function is called by TRAP library to initialize one input interface.
626  *
627  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
628  * \param[in] params Configuration string containing space separated values of these parameters (in this exact order): *dest_addr* *dest_port*,
629  * where dest_addr is destination address of output TCP/IP IFC module and
630  * dest_port is the port where sender is listening.
631  * \param[in,out] ifc IFC interface used for calling TCP/IP module.
632  * \param[in] idx Index of IFC that is created.
633  * \param [in] type Select the type of socket (see #tcpip_ifc_sockettype for options).
634  * \return 0 on success (TRAP_E_OK)
635  */
636 int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
637 {
638 #define X(pointer) free(pointer); \
639  pointer = NULL;
640 
641  int result = TRAP_E_OK;
642  char *param_iterator = NULL;
643  char *dest_addr = NULL;
644  char *dest_port = NULL;
645  tcpip_receiver_private_t *config = NULL;
646 
647  if (params == NULL) {
648  VERBOSE(CL_ERROR, "No parameters found for input IFC.");
649  return TRAP_E_BADPARAMS;
650  }
651 
652  config = (tcpip_receiver_private_t *) calloc(1, sizeof(tcpip_receiver_private_t));
653  if (config == NULL) {
654  VERBOSE(CL_ERROR, "Failed to allocate internal memory for input IFC.");
655  return TRAP_E_MEMORY;
656  }
657  config->ctx = ctx;
658  config->is_terminated = 0;
659  config->socket_type = type;
660  config->ifc_idx = idx;
661 
662  /* Parsing params */
663  param_iterator = trap_get_param_by_delimiter(params, &dest_addr, TRAP_IFC_PARAM_DELIMITER);
664  if (param_iterator == NULL) {
665  /* error! we expect 2 parameters */
666  if ((dest_addr == NULL) || (strlen(dest_addr) == 0)) {
667  VERBOSE(CL_ERROR, "Missing 'destination address' for TCPIP IFC.");
668  result = TRAP_E_BADPARAMS;
669  goto failsafe_cleanup;
670  }
671  }
672  param_iterator = trap_get_param_by_delimiter(param_iterator, &dest_port, TRAP_IFC_PARAM_DELIMITER);
673  if ((dest_port == NULL) || (strlen(dest_port) == 0)) {
674  /* if 2nd param is missing, use localhost as addr and 1st param as "port" */
675  free(dest_port);
676  dest_port = dest_addr;
677  dest_addr = strdup("localhost");
678  VERBOSE(CL_VERBOSE_BASIC, "Using the only parameter as 'destination port' and \"localhost\" as 'destination address' for TCPIP IFC.");
679  }
680 
681  /* set global buffer size */
683  /* Parsing params ended */
684 
685  config->dest_addr = dest_addr;
686  config->dest_port = dest_port;
687 
688  if ((config->dest_addr == NULL) || (config->dest_port == NULL)) {
689  /* no delimiter found even if we expect two parameters */
690  VERBOSE(CL_ERROR, "Malformed params for input IFC, missing destination address and port.");
691  result = TRAP_E_BADPARAMS;
692  goto failsafe_cleanup;
693  }
694 
695  VERBOSE(CL_VERBOSE_ADVANCED, "config:\ndest_addr=\"%s\"\ndest_port=\"%s\"\n"
696  "TDU size: %u\n", config->dest_addr, config->dest_port,
697  config->int_mess_header.data_length);
698 
699  /*
700  * In constructor, we do not know timeout yet.
701  * Use 5 seconds to wait for connection to output interface.
702  */
703 #ifndef ENABLE_NEGOTIATION
704  int retval = 0;
705  struct timeval tv = {5, 0};
706  retval = client_socket_connect((void *) config, config->dest_addr, config->dest_port, &config->sd, &tv);
707  if (retval != TRAP_E_OK) {
708  config->connected = 0;
709  if ((retval == TRAP_E_BAD_FPARAMS) || (retval == TRAP_E_IO_ERROR)) {
710  VERBOSE(CL_VERBOSE_BASIC, "Could not connect to sender due to bad parameters.");
711  result = TRAP_E_BADPARAMS;
712  goto failsafe_cleanup;
713  }
714  } else {
715  config->connected = 1;
716  }
717 #endif
718 
719  /* hook functions and store priv */
720  ifc->recv = tcpip_receiver_recv;
724  ifc->priv = config;
727 
728 #ifndef ENABLE_NEGOTIATION
729  if (config->connected == 0) {
730  VERBOSE(CL_VERBOSE_BASIC, "Could not connect to sender.");
731  if ((retval == TRAP_E_BAD_FPARAMS) || (retval == TRAP_E_IO_ERROR)) {
732  result = retval;
733  goto failsafe_cleanup;
734  }
735  }
736 #endif
737  return TRAP_E_OK;
738 failsafe_cleanup:
739  X(dest_addr);
740  X(dest_port);
741  X(config);
742  return result;
743 #undef X
744 }
745 
746 /**
747  * Disconnect from output IFC.
748  *
749  * \param[in,out] priv pointer to private structure of input IFC (client)
750  */
751 static void client_socket_disconnect(void *priv)
752 {
754  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv Disconnected."));
755  if (config->connected == 1) {
756  VERBOSE(CL_VERBOSE_BASIC, "TCPIP ifc client disconnecting");
757  close(config->sd);
758  config->connected = 0;
759  }
760 }
761 
762 /**
763  * Function waits for non-blocking connect().
764  *
765  * \param[in] sock socket descriptor of client
766  * \param[in] tv timeout
767  * \return TRAP_E_OK on success, TRAP_E_TIMEOUT on error (can be caused by interrupt)
768  */
769 static int wait_for_connection(int sock, struct timeval *tv)
770 {
771  int rv;
772  struct pollfd pfds = {.fd = sock, .events = POLLOUT};
773  struct timespec ts, *tempts = NULL;
774  if (tv != NULL) {
775  ts.tv_sec = tv->tv_sec;
776  ts.tv_nsec = tv->tv_usec * 1000l;
777  tempts = &ts;
778  }
779  VERBOSE(CL_VERBOSE_LIBRARY, "wait for connection");
780  rv = ppoll(&pfds, 1, tempts, NULL);
781  if (rv == 1 && pfds.revents & POLLOUT) {
782  int so_error;
783  socklen_t len = sizeof so_error;
784 
785  getsockopt(sock, SOL_SOCKET, SO_ERROR, &so_error, &len);
786 
787  if (so_error == 0) {
788  return TRAP_E_OK;
789  }
790  }
791  return TRAP_E_TIMEOUT;
792 }
793 
794 
795 /**
796  * \brief client_socket is used as a receiver
797  * \param[in] priv pointer to module private data
798  * \param[in] dest_addr destination address where to connect and where receive
799  * \param[in] dest_port destination port where to connect and where receive
800  * \param[out] socket_descriptor socket descriptor of established connection
801  * \param[in] tv timeout
802  * \return TRAP_E_OK on success
803  */
804 static int client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv)
805 {
807  int sockfd = -1, options;
808  union tcpip_socket_addr addr;
809  struct addrinfo *servinfo, *p = NULL;
810  int rv = 0, addr_count = 0;
811  char s[INET6_ADDRSTRLEN];
812 
813  if ((config == NULL) || (dest_addr == NULL) || (dest_port == NULL) || (socket_descriptor == NULL)) {
814  return TRAP_E_BAD_FPARAMS;
815  }
816  if (check_portrange(dest_port) == EXIT_FAILURE) {
817  return TRAP_E_BADPARAMS;
818  }
819 
820  memset(&addr, 0, sizeof(addr));
821 
822  if (config->socket_type == TRAP_IFC_TCPIP) {
823  addr.tcpip_addr.ai_family = AF_UNSPEC;
824  addr.tcpip_addr.ai_socktype = SOCK_STREAM;
825 
826  if ((rv = getaddrinfo(dest_addr, dest_port, &addr.tcpip_addr, &servinfo)) != 0) {
827  VERBOSE(CL_ERROR, "getaddrinfo: %s", gai_strerror(rv));
828  return TRAP_E_IO_ERROR;
829  }
830 
831  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv Try to connect"));
832 
833  if (tv != NULL) {
834  /* compute uniform intervals for all possible address */
835  for (p = servinfo; p != NULL; p = p->ai_next) {
836  addr_count++;
837  }
838  tv->tv_sec = (tv->tv_sec * 1000000 + tv->tv_usec) / addr_count;
839  tv->tv_usec = tv->tv_sec % 1000000;
840  tv->tv_sec /= 1000000;
841  VERBOSE(CL_VERBOSE_LIBRARY, "Every address will be tried for timeout: %"PRId64"s%"PRId64"us",
842  tv->tv_sec, tv->tv_usec);
843  }
844 
845  // loop through all the results and connect to the first we can
846  for (p = servinfo; p != NULL; p = p->ai_next) {
847  if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
848  continue;
849  }
850 
851  /* Change the socket to be non-blocking if required by user. */
852  if (tv != NULL) {
853  if ((options = fcntl(sockfd, F_GETFL)) != -1) {
854  if (fcntl(sockfd, F_SETFL, O_NONBLOCK | options) == -1) {
855  VERBOSE(CL_ERROR, "Could not set socket to non-blocking.");
856  }
857  }
858  }
859 
860  if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
861  if (errno != EINPROGRESS && errno != EAGAIN) {
862  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv TCPIP ifc connect error %d (%s)", errno,
863  strerror(errno)));
864  close(sockfd);
865  continue;
866  } else {
867  rv = wait_for_connection(sockfd, tv);
868  if (rv == TRAP_E_TIMEOUT) {
869  close(sockfd);
870  if (config->is_terminated) {
871  rv = TRAP_E_TERMINATED;
872  break;
873  }
874  /* try another address */
875  continue;
876  } else {
877  /* success */
878  rv = TRAP_E_OK;
879  break;
880  }
881  }
882  }
883  break;
884  }
885 
886  if (p != NULL) {
887  if (inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), s, sizeof s) != NULL) {
888  VERBOSE(CL_VERBOSE_LIBRARY, "recv client: connected to %s", s);
889  }
890  }
891  freeaddrinfo(servinfo); // all done with this structure
892  } else if (config->socket_type == TRAP_IFC_TCPIP_UNIX) {
893  /* UNIX socket */
894  addr.unix_addr.sun_family = AF_UNIX;
895  snprintf(addr.unix_addr.sun_path, sizeof(addr.unix_addr.sun_path) - 1, trap_default_socket_path_format, dest_port);
896  sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
897  if (sockfd != -1) {
898  if (connect(sockfd, (struct sockaddr *) &addr.unix_addr, sizeof(addr.unix_addr)) < 0) {
899  VERBOSE(CL_VERBOSE_LIBRARY, "recv UNIX domain socket connect error %d (%s)", errno, strerror(errno));
900  close(sockfd);
901  } else {
902  p = (struct addrinfo *) &addr.unix_addr;
903  }
904  rv = TRAP_E_OK;
905  } else {
906  rv = TRAP_E_IO_ERROR;
907  }
908  }
909 
910  if (p == NULL) {
911  VERBOSE(CL_VERBOSE_LIBRARY, "recv client: Connection failed.");
912  rv = TRAP_E_TIMEOUT;
913  }
914 
915  if (rv != TRAP_E_OK) { /*something went wrong while setting up connection */
916  if (sockfd >= 0) {
917  close(sockfd);
918  }
919  return rv;
920  }
921 
922  *socket_descriptor = sockfd;
923 
924 
925  /** Input interface negotiation */
926 #ifdef ENABLE_NEGOTIATION
928  case NEG_RES_FMT_UNKNOWN:
929  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (unknown data format of the output interface).");
930  close(sockfd);
931  return TRAP_E_TIMEOUT;
932 
933  case NEG_RES_CONT:
934  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success.");
935  return TRAP_E_OK;
936 
937  case NEG_RES_FMT_CHANGED: // used on format change with JSON
938  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (format has changed; it was not first negotiation).");
939  return TRAP_E_OK;
940 
941  case NEG_RES_RECEIVER_FMT_SUBSET: // used on format change with UniRec
942  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (required set of fields of the input interface is subset of the recevied format).");
943  return TRAP_E_OK;
944 
945  case NEG_RES_SENDER_FMT_SUBSET: // used on format change with UniRec
946  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (new recevied format specifier is subset of the old one; it was not first negotiation).");
947  return TRAP_E_OK;
948 
949  case NEG_RES_FAILED:
950  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (error while receiving hello message from output interface).");
952 
954  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (data type or data format specifier mismatch).");
955  return TRAP_E_FIELDS_MISMATCH;
956 
957  default:
958  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: default case");
959  break;
960  }
961 #endif
962 
963 
964  return rv;
965 }
966 
967 /**
968  * @}
969  *//* tcpip_receiver */
970 
971 /**
972  * \addtogroup tcpip_sender
973  * @{
974  */
975 
976 /**
977  * \brief This function is called when a client was/is being disconnected.
978  *
979  * \param[in] priv Pointer to interface's private data structure.
980  * \param[in] cl_id Index of the client in 'clients' array.
981  */
982 static inline void disconnect_client(tcpip_sender_private_t *priv, int cl_id)
983 {
984  int i;
985  client_t *c = &priv->clients[cl_id];
986 
987  for (i = 0; i < priv->buffer_count; ++i) {
988  del_index(&priv->buffers[i].clients_bit_arr, cl_id);
989  if (priv->buffers[i].clients_bit_arr == 0) {
990  pthread_cond_broadcast(&priv->cond_full_buffer);
991  }
992  }
993  del_index(&priv->clients_bit_arr, cl_id);
994  __sync_sub_and_fetch(&priv->connected_clients, 1);
995 
996  shutdown(c->sd, SHUT_RDWR);
997  close(c->sd);
998  c->sd = -1;
999  c->pfds_index = -1;
1000  c->pending_bytes = 0;
1001  c->sending_pointer = NULL;
1002 }
1003 
1004 /**
1005  * \brief Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter.
1006  *
1007  * \param[in] priv Pointer to output interface private structure.
1008  */
1010 {
1011  uint32_t i;
1013 
1014  for (i = 0; i<c->clients_arr_size; i++) {
1015  if (c->clients[i].sd > 0) {
1016  disconnect_client(priv, i);
1017  }
1018  }
1019 }
1020 
1021 /**
1022  * \brief This function runs in a separate thread and handles new client's connection requests.
1023  *
1024  * \param[in] arg Pointer to interface's private data structure.
1025  */
1026 static void *accept_clients_thread(void *arg)
1027 {
1028  char remoteIP[INET6_ADDRSTRLEN];
1029  struct sockaddr_storage remoteaddr; // client address
1030  struct client_s *cl;
1031  socklen_t addrlen;
1032  int newclient;
1034  int i;
1035  struct sockaddr *tmpaddr;
1036  struct ucred ucred;
1037  uint32_t ucredlen = sizeof(struct ucred);
1038  uint32_t client_id = 0;
1039  struct pollfd pfds;
1040 
1041  /* handle new connections */
1042  addrlen = sizeof(remoteaddr);
1043  while (1) {
1044  if (c->is_terminated != 0) {
1045  break;
1046  }
1047  pfds = (struct pollfd) {.fd = c->server_sd, .events = POLLIN};
1048 
1049  if (poll(&pfds, 1, -1) == -1) {
1050  if (errno == EINTR) {
1051  if (c->is_terminated != 0) {
1052  break;
1053  }
1054  continue;
1055  } else {
1056  VERBOSE(CL_ERROR, "%s:%d unexpected error code %d", __func__, __LINE__, errno);
1057  }
1058  }
1059 
1060  if (pfds.revents & POLLIN) {
1061  newclient = accept(c->server_sd, (struct sockaddr *) &remoteaddr, &addrlen);
1062  if (newclient == -1) {
1063  VERBOSE(CL_ERROR, "Accepting new client failed.");
1064  } else {
1065  if (c->socket_type == TRAP_IFC_TCPIP) {
1066  tmpaddr = (struct sockaddr *) &remoteaddr;
1067  switch (((struct sockaddr *) tmpaddr)->sa_family) {
1068  case AF_INET:
1069  client_id = ntohs(((struct sockaddr_in *) tmpaddr)->sin_port);
1070  break;
1071  case AF_INET6:
1072  client_id = ntohs(((struct sockaddr_in6 *) tmpaddr)->sin6_port);
1073  break;
1074  }
1075  VERBOSE(CL_VERBOSE_ADVANCED, "Client connected via TCP socket, port=%u", client_id);
1076  } else {
1077  if (getsockopt(newclient, SOL_SOCKET, SO_PEERCRED, &ucred, &ucredlen) == -1) {
1078  goto refuse_client;
1079  }
1080  client_id = (uint32_t) ucred.pid;
1081  VERBOSE(CL_VERBOSE_ADVANCED, "Client connected via UNIX socket, pid=%ld", (long) ucred.pid);
1082  }
1083 
1084  VERBOSE(CL_VERBOSE_ADVANCED, "New connection from %s on socket %d",
1085  inet_ntop(remoteaddr.ss_family, get_in_addr((struct sockaddr*) &remoteaddr), remoteIP, INET6_ADDRSTRLEN),
1086  newclient);
1087 
1088  if (c->connected_clients < c->clients_arr_size) {
1089  cl = NULL;
1090  for (i = 0; i < c->clients_arr_size; ++i) {
1091  if (check_index(c->clients_bit_arr, i) == 0) {
1092  cl = &c->clients[i];
1093  break;
1094  }
1095  }
1096  if (cl == NULL) {
1097  goto refuse_client;
1098  }
1099 
1100  cl->sd = newclient;
1101  cl->pfds_index = -1;
1102  cl->sending_pointer = NULL;
1103  cl->pending_bytes = 0;
1104  cl->timer_total = 0;
1105  cl->id = client_id;
1106  cl->assigned_buffer = c->active_buffer;
1107  cl->timeouts = 0;
1108 
1109 #ifdef ENABLE_NEGOTIATION
1110  int ret_val = output_ifc_negotiation(c, TRAP_IFC_TYPE_TCPIP, i);
1111  if (ret_val == NEG_RES_OK) {
1112  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: success.");
1113  } else if (ret_val == NEG_RES_FMT_UNKNOWN) {
1114  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: failed (unknown data format of this output interface -> refuse client).");
1115  cl->sd = -1;
1116  goto refuse_client;
1117  } else { // ret_val == NEG_RES_FAILED, sending the data to input interface failed, refuse client
1118  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: failed (error while sending hello message to input interface).");
1119  cl->sd = -1;
1120  goto refuse_client;
1121  }
1122 #endif
1123 
1124  set_index(&c->clients_bit_arr, i);
1125  __sync_add_and_fetch(&c->connected_clients, 1);
1126  } else {
1127 refuse_client:
1128  VERBOSE(CL_VERBOSE_LIBRARY, "Shutting down client we do not have additional resources (%u/%u)", c->connected_clients, c->clients_arr_size);
1129  shutdown(newclient, SHUT_RDWR);
1130  close(newclient);
1131  }
1132  }
1133  }
1134  }
1135  pthread_exit(NULL);
1136 }
1137 
1138 /**
1139  * \brief Write buffer size to its header and shift active index.
1140  *
1141  * \param[in] priv Pointer to output interface private structure.
1142  * \param[in] buffer Pointer to the buffer.
1143  */
1144 static inline void finish_buffer(tcpip_sender_private_t *priv, buffer_t *buffer)
1145 {
1147 
1148  if (buffer->clients_bit_arr == 0 && buffer->wr_index != 0) {
1149  uint32_t header = htonl(buffer->wr_index);
1150  memcpy(buffer->header, &header, sizeof(header));
1151 
1152  priv->active_buffer = (priv->active_buffer + 1) % priv->buffer_count;
1153 
1154  buffer->clients_bit_arr = priv->clients_bit_arr;
1155  buffer->wr_index = 0;
1156  }
1157 
1158  pthread_mutex_lock(&priv->mtx_no_data);
1159  pthread_cond_broadcast(&priv->cond_no_data);
1160  pthread_mutex_unlock(&priv->mtx_no_data);
1161 }
1162 
1163 /**
1164  * \brief Force flush of active buffer
1165  *
1166  * \param[in] priv pointer to interface private data
1167  */
1168 void tcpip_sender_flush(void *priv)
1169 {
1171 
1172  pthread_mutex_lock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1173  finish_buffer(c, &c->buffers[c->active_buffer]);
1174  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1175 
1176  __sync_add_and_fetch(&c->ctx->counter_autoflush[c->ifc_idx], 1);
1177 }
1178 
1179 /**
1180  * \brief Send data to client from his assigned buffer.
1181  *
1182  * \param[in] priv Pointer to iterface's private data structure.
1183  * \param[in] c Pointer to the client's structure.
1184  * \param[in] cl_id Client's index in the 'clients' array.
1185  *
1186  * \return TRAP_E_OK successfully sent.
1187  * \return TRAP_E_TERMINATED TRAP was terminated.
1188  * \return TRAP_E_IO_ERROR send failed although TRAP was not terminated.
1189  */
1190 static inline int send_data(tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id)
1191 {
1192  int sent;
1193  /* Pointer to client's assigned buffer */
1194  buffer_t *buffer = &priv->buffers[c->assigned_buffer];
1195 
1196 again:
1197  sent = send(c->sd, c->sending_pointer, c->pending_bytes, MSG_NOSIGNAL);
1198 
1199  if (sent < 0) {
1200  /* Send failed */
1201  if (priv->is_terminated != 0) {
1202  return TRAP_E_TERMINATED;
1203  }
1204  switch (errno) {
1205  case EBADF:
1206  case EPIPE:
1207  case EFAULT:
1208  return TRAP_E_IO_ERROR;
1209  case EAGAIN:
1210  goto again;
1211  default:
1212  VERBOSE(CL_VERBOSE_OFF, "Unhandled error from send in send_data (errno: %i)", errno);
1213  return TRAP_E_IO_ERROR;
1214  }
1215  } else {
1216  c->pending_bytes -= sent;
1217  c->sending_pointer = (uint8_t *) c->sending_pointer + sent;
1218 
1219  /* Client received whole buffer */
1220  if (c->pending_bytes <= 0) {
1221  del_index(&buffer->clients_bit_arr, cl_id);
1222  if (buffer->clients_bit_arr == 0) {
1223  __sync_add_and_fetch(&priv->ctx->counter_send_buffer[priv->ifc_idx], 1);
1224  pthread_cond_broadcast(&priv->cond_full_buffer);
1225  }
1226 
1227  /* Assign client the next buffer in sequence */
1228  c->assigned_buffer = (c->assigned_buffer + 1) % priv->buffer_count;
1229  }
1230  }
1231  return TRAP_E_OK;
1232 }
1233 
1234 /**
1235  * \brief This function runs in a separate thread. It handles sending data
1236  to connected clients for TCPIP and UNIX interfaces.
1237  * \param[in] priv pointer to interface private data
1238  */
1239 static void *sending_thread_func(void *priv)
1240 {
1241  uint32_t i, j;
1242  int res;
1243  client_t *cl;
1244  buffer_t *assigned_buffer;
1245  uint8_t buffer[DEFAULT_MAX_DATA_LENGTH];
1246  uint64_t send_entry_time;
1247  uint64_t send_exit_time;
1248  uint8_t waiting_clients;
1249  int poll_timeout;
1250  int clients_pfds_size;
1251  struct pollfd *pfds;
1252  int64_t time_since_flush;
1253  int receiving_clients_array[DEFAULT_MAX_CLIENTS] = {0}; // Array of clients for whom we have data for
1254 
1256 
1257  while (1) {
1258  if (c->is_terminated != 0) {
1259  pthread_exit(NULL);
1260  }
1261  if (c->connected_clients == 0) {
1262  usleep(NO_CLIENTS_SLEEP);
1263  continue;
1264  }
1265 
1266  time_since_flush = get_cur_timestamp() - c->autoflush_timestamp;
1267  if (time_since_flush > c->ctx->out_ifc_list[c->ifc_idx].timeout) {
1268  tcpip_sender_flush(c);
1269  }
1270 
1271  clients_pfds_size = 0;
1272  waiting_clients = 0;
1273  poll_timeout = 1;
1274 
1275  /* Add term_pipe for reading into the disconnect client set */
1276  c->clients_pfds[clients_pfds_size++] = (struct pollfd) {.fd = c->term_pipe[0], .events = POLLIN};
1277 
1278  /* Check whether clients are connected and there is data for them to receive. */
1279  for (i = j = 0; i < c->clients_arr_size; ++i) {
1280  if (j == c->connected_clients) {
1281  break;
1282  }
1283 
1284  if (check_index(c->clients_bit_arr, i) == 0) {
1285  continue;
1286  }
1287 
1288  ++j;
1289  receiving_clients_array[i] = 0;
1290 
1291  cl = &(c->clients[i]);
1292  assigned_buffer = &c->buffers[cl->assigned_buffer];
1293 
1294  cl->pfds_index = j;
1295  pfds = c->clients_pfds + j;
1296  ++clients_pfds_size;
1297  *pfds = (struct pollfd) {.fd = cl->sd, .events = POLLIN};
1298 
1299  if (check_index(assigned_buffer->clients_bit_arr, i) == 0) {
1300  ++waiting_clients;
1301  continue;
1302  }
1303 
1304  if (cl->pending_bytes <= 0) {
1305  cl->sending_pointer = assigned_buffer->header;
1306  cl->pending_bytes = ntohl(*((uint32_t *) assigned_buffer->header)) + sizeof(uint32_t);
1307  }
1308 
1309  pfds->events = pfds->events | POLLOUT;
1310  receiving_clients_array[i] = 1;
1311  }
1312 
1313  if (waiting_clients == c->connected_clients) {
1314  int timeout = c->ctx->out_ifc_list[c->ifc_idx].timeout - time_since_flush;
1315  struct timespec ts;
1316  clock_gettime(CLOCK_REALTIME, &ts);
1317 
1318  ts.tv_nsec += (ts.tv_sec * 1000000000L) + (timeout * 1000L);
1319  ts.tv_sec = (ts.tv_nsec / 1000000000L);
1320  ts.tv_nsec %= 1000000000L;
1321 
1322  pthread_mutex_lock(&c->mtx_no_data);
1323  pthread_cond_timedwait(&c->cond_no_data, &c->mtx_no_data, &ts);
1324  pthread_mutex_unlock(&c->mtx_no_data);
1325  continue;
1326  }
1327 
1328  res = poll(c->clients_pfds, clients_pfds_size, poll_timeout);
1329  if (res < 0) {
1330  /* Select returned with an error */
1331  if (c->is_terminated == 0) {
1332  switch (errno) {
1333  case EINTR:
1334  continue;
1335  default:
1336  VERBOSE(CL_ERROR, "Sending thread: unexpected error in select (errno: %i)", errno);
1337  pthread_exit(NULL);
1338  }
1339  } else {
1340  VERBOSE(CL_VERBOSE_ADVANCED, "Sending thread: terminating...");
1341  pthread_exit(NULL);
1342  }
1343  } else if (res == 0) {
1344  /* Select timed out - no client will be receiving */
1345  for (i = j = 0; i < c->clients_arr_size; ++i) {
1346  if (j == c->connected_clients) {
1347  break;
1348  }
1349  if (check_index(c->clients_bit_arr, i) == 0) {
1350  continue;
1351  }
1352  j++;
1353  cl = &(c->clients[i]);
1354  if (receiving_clients_array[i] && cl->timeouts > 0) {
1355  /* Disconnect clients that are unable to receive data fast enough and are blocking the whole module. */
1356  disconnect_client(c, i);
1357  receiving_clients_array[i] = 0;
1358  VERBOSE(CL_VERBOSE_ADVANCED, "Sending thread: Client %" PRIu32 " could not receive data fast enough and was disconnected", cl->id);
1359  } else if (cl->sd < 0) {
1360  disconnect_client(c, i);
1361  receiving_clients_array[i] = 0;
1362  }
1363  }
1364  continue;
1365  }
1366 
1367  if (c->clients_pfds[0].revents & POLLIN) {
1368  /* Sending was interrupted by terminate(), exit even from TRAP_WAIT function call. */
1369  VERBOSE(CL_VERBOSE_ADVANCED, "Sending thread: Sending was interrupted by terminate()");
1370  pthread_exit(NULL);
1371  }
1372 
1373  /* Check file descriptors. Disconnect "inactive" clients and send data to those designated by select */
1374  for (i = j = 0; i < c->clients_arr_size; ++i) {
1375  if (j == c->connected_clients) {
1376  break;
1377  }
1378 
1379  receiving_clients_array[i] = 0;
1380  cl = &(c->clients[i]);
1381  if (cl->sd < 1) {
1382  continue;
1383  }
1384 
1385  ++j;
1386  if (cl->pfds_index < 0) {
1387  continue;
1388  }
1389 
1390  pfds = c->clients_pfds + cl->pfds_index;
1391  assert(pfds->fd == cl->sd);
1392 
1393  /* Check if client is still connected */
1394  if (pfds->revents & POLLIN) {
1395  res = recv(cl->sd, buffer, DEFAULT_MAX_DATA_LENGTH, 0);
1396  if (res < 1) {
1397  disconnect_client(c, i);
1398  VERBOSE(CL_VERBOSE_LIBRARY, "Sending thread: Client %" PRIu32 " disconnected", cl->id);
1399  continue;
1400  }
1401  }
1402 
1403  /* Check if client is ready for data */
1404  if (pfds->revents & POLLOUT) {
1405  send_entry_time = get_cur_timestamp();
1406  res = send_data(c, cl, i);
1407  send_exit_time = get_cur_timestamp();
1408 
1409  /* Measure how much time we spent sending to this client (in microseconds) */
1410  cl->timer_last = (send_exit_time - send_entry_time);
1411  cl->timer_total += cl->timer_last;
1412 
1413  if (res != TRAP_E_OK) {
1414  VERBOSE(CL_VERBOSE_OFF, "Sending thread: Disconnected client %" PRIu32 " (ret val: %d)", cl->id, res);
1415  disconnect_client(c, i);
1416  }
1417  }
1418  }
1419  }
1420 }
1421 
1422 /**
1423  * \brief Store message into buffer.
1424  *
1425  * \param[in] priv pointer to module private data
1426  * \param[in] data pointer to data to write
1427  * \param[in] size size of data to write
1428  * \param[in] timeout maximum time spent waiting for the message to be stored [microseconds]
1429  *
1430  * \return TRAP_E_OK Success.
1431  * \return TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
1432  * \return TRAP_E_TERMINATED Libtrap was terminated during the process.
1433  */
1434 int tcpip_sender_send(void *priv, const void *data, uint16_t size, int timeout)
1435 {
1436  int res, i;
1437  uint32_t free_bytes;
1438  struct timespec ts;
1439  buffer_t *buffer;
1440 
1442  uint8_t block = (timeout == TRAP_WAIT || (timeout == TRAP_HALFWAIT && c->connected_clients != 0)) ? 1 : 0;
1443 
1444  /* Can we put message at least into empty buffer? In the worst case, we could end up with SEGFAULT -> rather skip with error */
1445  if ((size + sizeof(size)) > c->buffer_size) {
1446  VERBOSE(CL_ERROR, "Buffer is too small for this message. Skipping...");
1447  goto timeout;
1448  }
1449 
1450  /* If timeout is wait or half wait, we need to set some valid timeout value (>= 0)*/
1451  if (timeout == TRAP_WAIT || timeout == TRAP_HALFWAIT) {
1452  timeout = 10000;
1453  }
1454 
1455 repeat:
1456  if (c->is_terminated != 0) {
1457  return TRAP_E_TERMINATED;
1458  }
1459  if (block && c->connected_clients == 0) {
1460  usleep(NO_CLIENTS_SLEEP);
1461  goto repeat;
1462  }
1463 
1464  pthread_mutex_lock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1465  buffer = &c->buffers[c->active_buffer];
1466  while (buffer->clients_bit_arr != 0) {
1467  clock_gettime(CLOCK_REALTIME, &ts);
1468 
1469  ts.tv_nsec += (ts.tv_sec * 1000000000L) + (timeout * 1000L);
1470  ts.tv_sec = (ts.tv_nsec / 1000000000L);
1471  ts.tv_nsec %= 1000000000L;
1472 
1473  /* Wait until woken up by sending thread or until timeout elapses */
1474  res = pthread_cond_timedwait(&c->cond_full_buffer, &c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx, &ts);
1475  switch (res) {
1476  case 0:
1477  /* Succesfully locked, buffer can be used */
1478  break;
1479  case ETIMEDOUT:
1480  /* Desired buffer is still full after timeout */
1481  if (block) {
1482  /* Blocking send, wait until buffer is free to use */
1483  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1484  goto repeat;
1485  } else {
1486  /* Non-blocking send, drop message or force buffer reset (not implemented) */
1487  goto timeout;
1488  }
1489  default:
1490  VERBOSE(CL_ERROR, "Unexpected error in pthread_mutex_timedlock()");
1491  goto timeout;
1492  }
1493  }
1494 
1495  /* Check if there is enough space in buffer */
1496  free_bytes = c->buffer_size - buffer->wr_index;
1497  if (free_bytes >= (size + sizeof(size))) {
1498  /* Store message into buffer */
1499  insert_into_buffer(buffer, data, size);
1500 
1501  /* If bufferswitch is 0, only 1 message is allowed to be stored in buffer */
1502  if (c->ctx->out_ifc_list[c->ifc_idx].bufferswitch == 0) {
1503  finish_buffer(c, buffer);
1504  }
1505 
1506  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1507  return TRAP_E_OK;
1508  } else {
1509  /* Not enough space for message, finish current buffer and try to store message into next buffer */
1510  finish_buffer(c, buffer);
1511  buffer = &c->buffers[c->active_buffer];
1512 
1513  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1514  goto repeat;
1515  }
1516 
1517 timeout:
1518  for (i = 0; i < c->clients_arr_size; i++) {
1519  if (c->clients[i].sd > 0 && c->clients[i].assigned_buffer == c->active_buffer) {
1520  c->clients[i].timeouts++;
1521  }
1522  }
1523  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1524  return TRAP_E_TIMEOUT;
1525 }
1526 
1527 /**
1528  * \brief Set interface state as terminated.
1529  * \param[in] priv pointer to module private data
1530  */
1531 void tcpip_sender_terminate(void *priv)
1532 {
1534 
1535  uint32_t i;
1536  uint64_t sum;
1537 
1538  /* Wait for connected clients to receive all finished buffers before terminating */
1539  if (c != NULL) {
1540  do {
1541  usleep(10000); //prevents busy waiting
1542  sum = 0;
1543  for (i = 0; i < c->buffer_count; i++) {
1544  sum |= c->buffers[i].clients_bit_arr;
1545  }
1546  } while (sum != 0);
1547 
1548  c->is_terminated = 1;
1549  close(c->term_pipe[1]);
1550  VERBOSE(CL_VERBOSE_LIBRARY, "Closed term_pipe, it should break poll()");
1551  } else {
1552  VERBOSE(CL_ERROR, "Destroying IFC that is probably not initialized.");
1553  }
1554  return;
1555 }
1556 
1557 /**
1558  * \brief Destructor of TCP sender (output ifc)
1559  * \param[in] priv pointer to module private data
1560  */
1561 void tcpip_sender_destroy(void *priv)
1562 {
1564  char *unix_socket_path = NULL;
1565  void *res;
1566  int32_t i;
1567 
1568 #define X(x) free(x); x = NULL;
1569  // Free private data
1570  if (c != NULL) {
1572  if (asprintf(&unix_socket_path, trap_default_socket_path_format, c->server_port) != -1) {
1573  if (unix_socket_path != NULL) {
1574  unlink(unix_socket_path);
1575  X(unix_socket_path);
1576  }
1577  }
1578  }
1579  if (c->server_port != NULL) {
1580  X(c->server_port);
1581  }
1582  if ((c->initialized) && (c->socket_type != TRAP_IFC_TCPIP_SERVICE)) {
1583  pthread_cancel(c->send_thr);
1584  pthread_cancel(c->accept_thr);
1585  pthread_join(c->send_thr, &res);
1586  pthread_join(c->accept_thr, &res);
1587  }
1588 
1589  /* close server socket */
1590  close(c->server_sd);
1591 
1592  if (c->clients_pfds != NULL) {
1593  X(c->clients_pfds);
1594  }
1595  /* disconnect all clients */
1596  if (c->clients != NULL) {
1598  X(c->clients);
1599  }
1600 
1601  if (c->buffers != NULL) {
1602  for (i = 0; i < c->buffer_count; i++) {
1603  X(c->buffers[i].header);
1604  }
1605  X(c->buffers);
1606  }
1607 
1608  pthread_mutex_destroy(&c->mtx_no_data);
1609  pthread_cond_destroy(&c->cond_no_data);
1610  pthread_cond_destroy(&c->cond_full_buffer);
1611  X(c)
1612  }
1613 #undef X
1614 }
1615 
1617 {
1619 
1620  if (c == NULL) {
1621  return 0;
1622  }
1623 
1624  return c->connected_clients;
1625 }
1626 
1627 int8_t tcpip_sender_get_client_stats_json(void *priv, json_t *client_stats_arr)
1628 {
1629  int i;
1630  json_t *client_stats = NULL;
1632 
1633  if (c == NULL) {
1634  return 0;
1635  }
1636 
1637  for (i = 0; i < c->clients_arr_size; ++i) {
1638  if (check_index(c->clients_bit_arr, i) == 0) {
1639  continue;
1640  }
1641 
1642  client_stats = json_pack("{sisisisi}", "id", c->clients[i].id, "timer_total", c->clients[i].timer_total, "timer_last", c->clients[i].timer_last, "timeouts", c->clients[i].timeouts);
1643  if (client_stats == NULL) {
1644  return 0;
1645  }
1646 
1647  if (json_array_append_new(client_stats_arr, client_stats) == -1) {
1648  return 0;
1649  }
1650  }
1651  return 1;
1652 }
1653 
1654 static void tcpip_sender_create_dump(void *priv, uint32_t idx, const char *path)
1655 {
1657  /* return value */
1658  int r;
1659  /* config file trap-i<number>-config.txt */
1660  char *conf_file = NULL;
1661  FILE *f = NULL;
1662  int32_t i;
1663  client_t *cl;
1664 
1665  r = asprintf(&conf_file, "%s/trap-o%02"PRIu32"-config.txt", path, idx);
1666  if (r == -1) {
1667  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
1668  conf_file = NULL;
1669  goto exit;
1670  }
1671  f = fopen(conf_file, "w");
1672  fprintf(f, "Server port: %s\n"
1673  "Server socket descriptor: %d\n"
1674  "Connected clients: %d\n"
1675  "Max clients: %d\n"
1676  "Active buffer: %d\n"
1677  "Buffer count: %u\n"
1678  "Buffer size: %u\n"
1679  "Terminated: %d\n"
1680  "Initialized: %d\n"
1681  "Socket type: %s\n"
1682  "Timeout: %u us\n",
1683  c->server_port,
1684  c->server_sd,
1685  c->connected_clients,
1686  c->clients_arr_size,
1687  c->active_buffer,
1688  c->buffer_size,
1689  c->buffer_size,
1690  c->is_terminated,
1691  c->initialized,
1693  c->ctx->out_ifc_list[idx].datatimeout);
1694  fprintf(f, "Clients:\n");
1695  for (i = 0; i < c->clients_arr_size; i++) {
1696  cl = &c->clients[i];
1697  fprintf(f, "\t{%d, %d, %p, %d}\n", cl->sd, cl->assigned_buffer, cl->sending_pointer, cl->pending_bytes);
1698  }
1699  fclose(f);
1700 exit:
1701  free(conf_file);
1702  return;
1703 }
1704 
1705 char *tcpip_send_ifc_get_id(void *priv)
1706 {
1707  if (priv == NULL) {
1708  return NULL;
1709  }
1710 
1712  if (config->server_port == NULL) {
1713  return NULL;
1714  }
1715  return config->server_port;
1716 }
1717 
1718 /**
1719  * \brief Constructor of output TCP/IP IFC module.
1720  * This function is called by TRAP library to initialize one output interface.
1721  *
1722  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
1723  * \param[in] params Configuration string containing interface specific parameters -
1724  * - tcp port/unix socket, max number of clients, buffer size, buffer count.
1725  * \param[in,out] ifc IFC interface used for calling TCP/IP module.
1726  * \param[in] idx Index of IFC that is created.
1727  * \param [in] type select the type of socket (see #tcpip_ifc_sockettype for options)
1728  * \return 0 on success (TRAP_E_OK)
1729  */
1730 int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
1731 {
1732  int result = TRAP_E_OK;
1733  char *param_iterator = NULL;
1734  char *param_str = NULL;
1735  char *server_port = NULL;
1736  tcpip_sender_private_t *priv = NULL;
1737  unsigned int max_clients = DEFAULT_MAX_CLIENTS;
1738  unsigned int buffer_count = DEFAULT_BUFFER_COUNT;
1739  unsigned int buffer_size = DEFAULT_BUFFER_SIZE;
1740  uint32_t i;
1741 
1742 #define X(pointer) free(pointer); \
1743  pointer = NULL;
1744 
1745  // Check parameter
1746  if (params == NULL) {
1747  VERBOSE(CL_ERROR, "IFC requires at least one parameter (%s).",
1748  type == TRAP_IFC_TCPIP ? "TCP port" : "UNIX socket name");
1749  return TRAP_E_BADPARAMS;
1750  }
1751 
1752  // Create structure to store private data
1753  priv = (tcpip_sender_private_t *) calloc(1, sizeof(tcpip_sender_private_t));
1754  if (priv == NULL) {
1755  result = TRAP_E_MEMORY;
1756  goto failsafe_cleanup;
1757  }
1758 
1759  /* Parsing params */
1760  param_iterator = trap_get_param_by_delimiter(params, &server_port, TRAP_IFC_PARAM_DELIMITER);
1761  if ((server_port == NULL) || (strlen(server_port) == 0)) {
1762  VERBOSE(CL_ERROR, "Missing 'port' for %s IFC.", (type == TRAP_IFC_TCPIP ? "TCPIP" : "UNIX socket"));
1763  result = TRAP_E_BADPARAMS;
1764  goto failsafe_cleanup;
1765  }
1766 
1767  /* Optional params */
1768  while (param_iterator != NULL) {
1769  param_iterator = trap_get_param_by_delimiter(param_iterator, &param_str, TRAP_IFC_PARAM_DELIMITER);
1770  if (param_str == NULL)
1771  continue;
1772  if (strncmp(param_str, "buffer_count=x", BUFFER_COUNT_PARAM_LENGTH) == 0) {
1773  if (sscanf(param_str + BUFFER_COUNT_PARAM_LENGTH, "%u", &buffer_count) != 1) {
1774  VERBOSE(CL_ERROR, "Optional buffer count given, but it is probably in wrong format.");
1775  buffer_count = DEFAULT_BUFFER_COUNT;
1776  }
1777  } else if (strncmp(param_str, "buffer_size=x", BUFFER_SIZE_PARAM_LENGTH) == 0) {
1778  if (sscanf(param_str + BUFFER_SIZE_PARAM_LENGTH, "%u", &buffer_size) != 1) {
1779  VERBOSE(CL_ERROR, "Optional buffer size given, but it is probably in wrong format.");
1780  buffer_size = DEFAULT_BUFFER_SIZE;
1781  }
1782  } else if (strncmp(param_str, "max_clients=x", MAX_CLIENTS_PARAM_LENGTH) == 0) {
1783  if (sscanf(param_str + MAX_CLIENTS_PARAM_LENGTH, "%u", &max_clients) != 1 || max_clients > 64) {
1784  VERBOSE(CL_ERROR, "Optional max clients number given, but it is probably in wrong format.");
1785  max_clients = DEFAULT_MAX_CLIENTS;
1786  }
1787  } else {
1788  VERBOSE(CL_ERROR, "Unknown parameter \"%s\".", param_str);
1789  }
1790  X(param_str);
1791  }
1792  /* Parsing params ended */
1793 
1794  priv->buffers = calloc(buffer_count, sizeof(buffer_t));
1795  if (priv->buffers == NULL) {
1796  /* if some memory could not have been allocated, we cannot continue */
1797  goto failsafe_cleanup;
1798  }
1799  for (i = 0; i < buffer_count; ++i) {
1800  buffer_t *b = &(priv->buffers[i]);
1801 
1802  b->header = malloc(buffer_size + sizeof(buffer_size));
1803  if (b->header == NULL) {
1804  /* if some memory could not have been allocated, we cannot continue */
1805  result = TRAP_E_MEMORY;
1806  goto failsafe_cleanup;
1807  }
1808 
1809  b->data = b->header + sizeof(buffer_size);
1810  b->wr_index = 0;
1811  b->clients_bit_arr = 0;
1812  }
1813  priv->clients_pfds = calloc(max_clients + 1, sizeof(*priv->clients_pfds));
1814  if (priv->clients_pfds == NULL) {
1815  /* if some memory could not have been allocated, we cannot continue */
1816  result = TRAP_E_MEMORY;
1817  goto failsafe_cleanup;
1818  }
1819  priv->clients = calloc(max_clients, sizeof(client_t));
1820  if (priv->clients == NULL) {
1821  /* if some memory could not have been allocated, we cannot continue */
1822  result = TRAP_E_MEMORY;
1823  goto failsafe_cleanup;
1824  }
1825  for (i = 0; i < max_clients; ++i) {
1826  client_t *client = &(priv->clients[i]);
1827 
1828  client->assigned_buffer = 0;
1829  client->sd = -1;
1830  client->pfds_index = -1;
1831  client->timer_total = 0;
1832  client->pending_bytes = 0;
1833  client->sending_pointer = NULL;
1834  }
1835 
1836  priv->ctx = ctx;
1837  priv->socket_type = type;
1838  priv->ifc_idx = idx;
1839  priv->server_port = server_port;
1840  priv->buffer_size = buffer_size;
1841  priv->buffer_count = buffer_count;
1842  priv->clients_arr_size = max_clients;
1843  priv->clients_bit_arr = 0;
1844  priv->connected_clients = 0;
1845  priv->is_terminated = 0;
1846  priv->active_buffer = 0;
1848 
1849  pthread_mutex_init(&priv->mtx_no_data, NULL);
1850  pthread_cond_init(&priv->cond_no_data, NULL);
1851  pthread_cond_init(&priv->cond_full_buffer, NULL);
1852 
1853  VERBOSE(CL_VERBOSE_ADVANCED, "config:\nserver_port:\t%s\nmax_clients:\t%u\nbuffer count:\t%u\nbuffer size:\t%uB\n",
1854  priv->server_port, priv->clients_arr_size, priv->buffer_count, priv->buffer_size);
1855 
1856  result = server_socket_open(priv);
1857  if (result != TRAP_E_OK) {
1858  VERBOSE(CL_ERROR, "Socket could not be opened on given port '%s'.", server_port);
1859  goto failsafe_cleanup;
1860  }
1861 
1862  if (pipe(priv->term_pipe) != 0) {
1863  VERBOSE(CL_ERROR, "Opening of pipe failed. Using stdin as a fall back.");
1864  priv->term_pipe[0] = 0;
1865  }
1866 
1867  // Fill struct defining the interface
1869  ifc->send = tcpip_sender_send;
1870  ifc->flush = tcpip_sender_flush;
1876  ifc->priv = priv;
1878  return result;
1879 
1880 failsafe_cleanup:
1881  X(server_port);
1882  X(param_str);
1883  if (priv != NULL) {
1884  if (priv->buffers != NULL) {
1885  for (i = 0; i < priv->buffer_count; i++) {
1886  X(priv->buffers[i].header);
1887  }
1888  X(priv->buffers)
1889  }
1890  if (priv->clients_pfds != NULL) {
1891  X(priv->clients_pfds);
1892  }
1893  if (priv->clients != NULL) {
1894  X(priv->clients);
1895  }
1896  pthread_mutex_destroy(&priv->mtx_no_data);
1897  pthread_cond_destroy(&priv->cond_no_data);
1898  pthread_cond_destroy(&priv->cond_full_buffer);
1899  X(priv);
1900  }
1901 #undef X
1902  return result;
1903 }
1904 
1905 /**
1906  * \brief Open TCPIP socket for sender module
1907  * \param[in] priv tcpip_sender_private_t structure (private data)
1908  * \return 0 on success (TRAP_E_OK), TRAP_E_IO_ERROR on error
1909  */
1910 static int server_socket_open(void *priv)
1911 {
1912  int yes = 1; // for setsockopt() SO_REUSEADDR, below
1913  int rv;
1914 
1915  union tcpip_socket_addr addr;
1916  struct addrinfo *ai, *p = NULL;
1918  if (c->server_port == NULL) {
1919  return TRAP_E_BAD_FPARAMS;
1920  }
1921 
1922  memset(&addr, 0, sizeof(addr));
1923 
1924  if (c->socket_type == TRAP_IFC_TCPIP) {
1925  if (check_portrange(c->server_port) == EXIT_FAILURE) {
1926  return TRAP_E_BADPARAMS;
1927  }
1928 
1929  // get us a socket and bind it
1930  addr.tcpip_addr.ai_family = AF_UNSPEC;
1931  addr.tcpip_addr.ai_socktype = SOCK_STREAM;
1932  addr.tcpip_addr.ai_flags = AI_PASSIVE;
1933  if ((rv = getaddrinfo(NULL, c->server_port, &addr.tcpip_addr, &ai)) != 0) {
1934  return trap_errorf(c->ctx, TRAP_E_IO_ERROR, "selectserver: %s\n", gai_strerror(rv));
1935  }
1936 
1937  for (p = ai; p != NULL; p = p->ai_next) {
1938  c->server_sd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
1939  if (c->server_sd < 0) {
1940  continue;
1941  }
1942 
1943  // lose the pesky "address already in use" error message
1944  if (setsockopt(c->server_sd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
1945  VERBOSE(CL_ERROR, "Failed to set socket to reuse address. (%d)", errno);
1946  }
1947 
1948  if (bind(c->server_sd, p->ai_addr, p->ai_addrlen) < 0) {
1949  close(c->server_sd);
1950  continue;
1951  }
1952  break; /* found socket to bind */
1953  }
1954  freeaddrinfo(ai); // all done with this
1955  } else if ((c->socket_type == TRAP_IFC_TCPIP_UNIX) || (c->socket_type == TRAP_IFC_TCPIP_SERVICE)) {
1956  /* UNIX socket */
1957  addr.unix_addr.sun_family = AF_UNIX;
1958  snprintf(addr.unix_addr.sun_path, sizeof(addr.unix_addr.sun_path) - 1, trap_default_socket_path_format, c->server_port);
1959  /* if socket file exists, it could be hard to create new socket and bind */
1960  unlink(addr.unix_addr.sun_path); /* error when file does not exist is not a problem */
1961  c->server_sd = socket(AF_UNIX, SOCK_STREAM, 0);
1962  if (c->server_sd != -1) {
1963  if (bind(c->server_sd, (struct sockaddr *) &addr.unix_addr, sizeof(addr.unix_addr)) != -1) {
1964  p = (struct addrinfo *) &addr.unix_addr;
1965  if (chmod(addr.unix_addr.sun_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) == -1) {
1966  VERBOSE(CL_ERROR, "Failed to set permissions to socket (%s).", addr.unix_addr.sun_path);
1967  }
1968  } else {
1969  /* error bind() failed */
1970  p = NULL;
1971  VERBOSE(CL_ERROR, "Failed bind() with the following socket path: %s", addr.unix_addr.sun_path);
1972  }
1973  } else {
1974  VERBOSE(CL_ERROR, "Failed to create socket.");
1975  p = NULL;
1976  }
1977  }
1978 
1979  if (p == NULL) {
1980  // if we got here, it means we didn't get bound
1981  VERBOSE(CL_VERBOSE_LIBRARY, "selectserver: failed to bind");
1982  return TRAP_E_IO_ERROR;
1983  }
1984 
1985  // listen
1986  if (listen(c->server_sd, c->clients_arr_size) == -1) {
1987  VERBOSE(CL_ERROR, "Listen failed");
1988  return TRAP_E_IO_ERROR;
1989  }
1990 
1991  if (c->socket_type != TRAP_IFC_TCPIP_SERVICE) {
1992  if (pthread_create(&c->send_thr, NULL, sending_thread_func, priv) != 0) {
1993  VERBOSE(CL_ERROR, "Failed to create sending thread.");
1994  return TRAP_E_IO_ERROR;
1995  }
1996  }
1997 
1998  if (c->socket_type != TRAP_IFC_TCPIP_SERVICE) {
1999  if (pthread_create(&c->accept_thr, NULL, accept_clients_thread, priv) != 0) {
2000  VERBOSE(CL_ERROR, "Failed to create accept_thread.");
2001  return TRAP_E_IO_ERROR;
2002  }
2003  }
2004 
2005  c->initialized = 1;
2006  return 0;
2007 }
2008 
2009 /**
2010  * @}
2011  *//* tcpip_sender */
2012 
2013 
2014 /**
2015  * @}
2016  *//* tcpip module */
2017 
2018 /**
2019  * @}
2020  *//* ifc modules */
2021 
2022 
2023 // Local variables:
2024 // c-basic-offset: 3
2025 // End:
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+ + + +
static int client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv)
client_socket is used as a receiver
Definition: ifc_tcpip.c:804
+
uint8_t * data
+
#define BUFFER_SIZE_PARAM_LENGTH
+ +
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+ + +
int tcpip_receiver_recv(void *priv, void *data, uint32_t *size, int timeout)
Receive data from interface.
Definition: ifc_tcpip.c:302
+ +
#define MAX_RECOVERY_TRY
Definition: ifc_tcpip.c:82
+
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
Definition: trap.c:1160
+ +
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
void * sending_pointer
+
#define NEG_RES_SENDER_FMT_SUBSET
If the data format of input and output interfaces is the same and new data specifier of the output in...
Definition: trap_internal.h:76
+
char * tcpip_send_ifc_get_id(void *priv)
Definition: ifc_tcpip.c:1705
+ +
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+
static void disconnect_client(tcpip_sender_private_t *priv, int cl_id)
This function is called when a client was/is being disconnected.
Definition: ifc_tcpip.c:982
+ +
uint32_t wr_index
+
Output buffer structure.
+
#define TRAP_IFC_PARAM_DELIMITER
Definition: trap.h:165
+
int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tcpip.c:636
+ +
pthread_cond_t cond_full_buffer
+
struct trap_buffer_header_s trap_buffer_header_t
+
uint64_t timer_total
+ +
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:246
+
char * trap_default_socket_path_format
+
static int server_socket_open(void *priv)
Open TCPIP socket for sender module.
Definition: ifc_tcpip.c:1910
+ +
#define NEG_RES_FAILED
If receiving the data from output interface fails or sending the data to input interface fails...
Definition: trap_internal.h:84
+
void tcpip_sender_terminate(void *priv)
Set interface state as terminated.
Definition: ifc_tcpip.c:1531
+ +
void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1211
+ +
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
enum tcpip_ifc_sockettype socket_type
+
#define TRAP_TIMEOUT_STR(t)
Definition: trap.h:132
+
uint32_t assigned_buffer
+
#define TRAP_E_FIELDS_MISMATCH
Returned when receiver fields are not subset of sender fields.
Definition: trap.h:98
+
static uint64_t get_cur_timestamp()
Definition: ifc_tcpip.c:258
+
struct sockaddr_un unix_addr
used for path of UNIX socket
Definition: ifc_tcpip.c:102
+
TRAP TCP/IP interfaces private structures.
+
static void tcpip_receiver_create_dump(void *priv, uint32_t idx, const char *path)
Definition: ifc_tcpip.c:541
+
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
Definition: trap.c:2833
+
static void insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size)
Definition: ifc_file.c:647
+
static void set_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 1.
+ + +
void tcpip_receiver_destroy(void *priv)
Destructor of TCPIP receiver (input ifc)
Definition: ifc_tcpip.c:520
+ +
#define X(p)
+
#define UNIX_PATH_FILENAME_FORMAT
Definition: ifc_tcpip.h:64
+ + +
void tcpip_sender_flush(void *priv)
Force flush of active buffer.
Definition: ifc_tcpip.c:1168
+ + +
use UNIX socket as a service interface
Definition: ifc_tcpip.h:73
+
static void del_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 0.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
static void client_socket_disconnect(void *priv)
Definition: ifc_tcpip.c:751
+
static int wait_for_connection(int sock, struct timeval *tv)
Definition: ifc_tcpip.c:769
+ +
uint64_t timeouts
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
#define TRAP_HALFWAIT
Definition: trap.h:130
+
void tcpip_sender_destroy(void *priv)
Destructor of TCP sender (output ifc)
Definition: ifc_tcpip.c:1561
+
#define TRAP_E_IO_ERROR
IO Error.
Definition: trap.h:93
+
#define NEG_RES_FMT_CHANGED
If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) ...
Definition: trap_internal.h:78
+
struct pollfd * clients_pfds
+
#define VERBOSE(level, format, args...)
+
static void tcpip_sender_create_dump(void *priv, uint32_t idx, const char *path)
Definition: ifc_tcpip.c:1654
+ +
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
Definition: trap_error.h:92
+ + +
uint8_t data[0]
+ + +
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
#define NEG_RES_CONT
If the data format and data specifier of input and output interface are the same (input interface can...
Definition: trap_internal.h:74
+
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
Definition: trap_ifc.h:237
+
int32_t tcpip_sender_get_client_count(void *priv)
Definition: ifc_tcpip.c:1616
+
uint32_t timer_last
+
void tcpip_receiver_terminate(void *priv)
Set interface state as terminated.
Definition: ifc_tcpip.c:504
+
Structure for TCP/IP IFC private information.
+
int8_t tcpip_sender_get_client_stats_json(void *priv, json_t *client_stats_arr)
Definition: ifc_tcpip.c:1627
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+
#define TRAP_E_BAD_FPARAMS
Bad parameters of function.
Definition: trap.h:92
+
use UNIX socket for local communication
Definition: ifc_tcpip.h:72
+
int tcpip_sender_send(void *priv, const void *data, uint16_t size, int timeout)
Store message into buffer.
Definition: ifc_tcpip.c:1434
+ + +
static void * accept_clients_thread(void *arg)
This function runs in a separate thread and handles new client&#39;s connection requests.
Definition: ifc_tcpip.c:1026
+
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
Definition: trap_ifc.h:250
+
#define TRAP_IFC_TYPE_TCPIP
trap_ifc_tcpip (input&output part)
Definition: trap.h:173
+
#define DEFAULT_BUFFER_SIZE
+
#define DEBUG_IFC(X)
+
trap_buffer_header_t int_mess_header
+
static uint64_t check_index(uint64_t bits, int i)
Return value of i-th element (one bit) in the &#39;bits&#39; array.
+
Structure for TCP/IP IFC client information.
+
use TCP/IP connection
Definition: ifc_tcpip.h:71
+
TRAP TCP/IP interfaces.
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
int32_t datatimeout
Timeout for *_send() calls.
Definition: trap_ifc.h:248
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
static int check_portrange(const char *port)
Check if the given port is a correct port number.
Definition: ifc_tcpip.c:138
+
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+ +
int32_t datatimeout
Timeout for *_recv() calls.
Definition: trap_ifc.h:191
+ +
void tcpip_server_disconnect_all_clients(void *priv)
Function disconnects all clients of the output interface whose private structure is passed via "priv"...
Definition: ifc_tcpip.c:1009
+ +
#define NEG_RES_FMT_UNKNOWN
If the output interface has not specified data format.
Definition: trap_internal.h:85
+ + + + +
#define DEFAULT_MAX_CLIENTS
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define NEG_RES_FMT_MISMATCH
If the data format or data specifier of input and output interfaces does not match.
Definition: trap_internal.h:77
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
#define DEFAULT_BUFFER_COUNT
+
int64_t timeout
Internal structure to send partial data after timeout (autoflush).
Definition: trap_ifc.h:247
+
uint8_t * header
+
Error handling for TRAP.
+
static int receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm)
Definition: ifc_tcpip.c:177
+
#define TRAP_E_MEMORY
Memory allocation error.
Definition: trap.h:104
+
#define NEG_RES_OK
Signaling success (hello message successfully sent to input interface)
Definition: trap_internal.h:81
+
struct addrinfo tcpip_addr
used for TCPIP socket
Definition: ifc_tcpip.c:101
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+ +
int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tcpip.c:1730
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls)...
+ +
static int send_data(tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id)
Send data to client from his assigned buffer.
Definition: ifc_tcpip.c:1190
+
uint64_t clients_bit_arr
+ + +
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
enum tcpip_ifc_sockettype socket_type
+
uint64_t * counter_autoflush
+
#define NEG_RES_RECEIVER_FMT_SUBSET
If the data format of input and output interfaces is the same and data specifier of the input interfa...
Definition: trap_internal.h:75
+
static void finish_buffer(tcpip_sender_private_t *priv, buffer_t *buffer)
Write buffer size to its header and shift active index.
Definition: ifc_tcpip.c:1144
+
#define TCPIP_SOCKETTYPE_STR(st)
Definition: ifc_tcpip.h:75
+ +
#define DEFAULT_MAX_DATA_LENGTH
+
uint32_t pending_bytes
+
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
static void * sending_thread_func(void *priv)
This function runs in a separate thread. It handles sending data to connected clients for TCPIP and U...
Definition: ifc_tcpip.c:1239
+
#define TRAP_WAIT
Definition: trap.h:124
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
uint64_t * counter_send_buffer
+
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
Definition: trap.c:2995
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
static void * get_in_addr(struct sockaddr *sa)
Get sockaddr, IPv4 or IPv6.
Definition: ifc_tcpip.c:119
+
trap_output_ifc_t * out_ifc_list
+ + +
#define MAX_CLIENTS_PARAM_LENGTH
+
Interface of TRAP interfaces.
+ +
#define BUFFER_COUNT_PARAM_LENGTH
+
uint8_t tcpip_recv_ifc_is_conn(void *priv)
Definition: ifc_tcpip.c:611
+ +
char * tcpip_recv_ifc_get_id(void *priv)
Definition: ifc_tcpip.c:598
+
trap_input_ifc_t * in_ifc_list
+
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
Definition: trap.h:90
+
#define NO_CLIENTS_SLEEP
+
tcpip_ifc_sockettype
Definition: ifc_tcpip.h:70
+
char *trap_default_socket_path_format __attribute__((used))
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8h.html b/doc/libtrap-devel/ifc__tcpip_8h.html new file mode 100644 index 00000000..1c8fdef6 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h.html @@ -0,0 +1,242 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tcpip.h File Reference
+
+
+ +

TRAP TCP/IP interfaces. +More...

+
#include "trap_ifc.h"
+
+Include dependency graph for ifc_tcpip.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + +
+
+

Go to the source code of this file.

+ + + + + + + + + + +

+Macros

#define TCPIP_IFC_PARAMS_DELIMITER   (',')
 
#define DEFAULT_SOCKET_FORMAT   "/trap-%s.sock"
 
#define UNIX_PATH_FILENAME_FORMAT   DEFAULTSOCKETDIR DEFAULT_SOCKET_FORMAT
 
#define TCPIP_SOCKETTYPE_STR(st)   (st == TRAP_IFC_TCPIP?"TCP":(st == TRAP_IFC_TCPIP_UNIX ? "UNIX": "SERVICE"))
 
+ + + +

+Enumerations

enum  tcpip_ifc_sockettype { TRAP_IFC_TCPIP, +TRAP_IFC_TCPIP_UNIX, +TRAP_IFC_TCPIP_SERVICE + }
 
+ + + + + + + +

+Functions

int create_tcpip_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
int create_tcpip_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t itx, enum tcpip_ifc_sockettype type)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
+

Detailed Description

+

TRAP TCP/IP interfaces.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2013
+
+2014
+ +

Definition in file ifc_tcpip.h.

+

Macro Definition Documentation

+ +

◆ DEFAULT_SOCKET_FORMAT

+ +
+
+ + + + +
#define DEFAULT_SOCKET_FORMAT   "/trap-%s.sock"
+
+ +

Definition at line 55 of file ifc_tcpip.h.

+ +
+
+ +

◆ TCPIP_IFC_PARAMS_DELIMITER

+ +
+
+ + + + +
#define TCPIP_IFC_PARAMS_DELIMITER   (',')
+
+

Delimiter used between params in the create_tcpip_sender_ifc and create_tcpip_receiver_ifc functions.

+ +

Definition at line 52 of file ifc_tcpip.h.

+ +
+
+ +

◆ TCPIP_SOCKETTYPE_STR

+ +
+
+ + + + + + + + +
#define TCPIP_SOCKETTYPE_STR( st)   (st == TRAP_IFC_TCPIP?"TCP":(st == TRAP_IFC_TCPIP_UNIX ? "UNIX": "SERVICE"))
+
+ +

Definition at line 75 of file ifc_tcpip.h.

+ +
+
+ +

◆ UNIX_PATH_FILENAME_FORMAT

+ +
+
+ + + + +
#define UNIX_PATH_FILENAME_FORMAT   DEFAULTSOCKETDIR DEFAULT_SOCKET_FORMAT
+
+

Communication via UNIX socket needs to specify path to socket file. It is currently placed according to this format, where s is replaced by port given as an argument of TCPIP IFC.

+ +

Definition at line 64 of file ifc_tcpip.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ tcpip_ifc_sockettype

+ +
+
+ + + + +
enum tcpip_ifc_sockettype
+
+

Type of socket that is used for the TRAP interface.

+ + + + +
Enumerator
TRAP_IFC_TCPIP 

use TCP/IP connection

+
TRAP_IFC_TCPIP_UNIX 

use UNIX socket for local communication

+
TRAP_IFC_TCPIP_SERVICE 

use UNIX socket as a service interface

+
+ +

Definition at line 70 of file ifc_tcpip.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.map b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.map new file mode 100644 index 00000000..7c119c38 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.md5 new file mode 100644 index 00000000..1c64fdf6 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.md5 @@ -0,0 +1 @@ +8fcf9081985dc4b27f16d9a4a676a116 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.png b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.png new file mode 100644 index 00000000..907ecac6 Binary files /dev/null and b/doc/libtrap-devel/ifc__tcpip_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__tcpip_8h__incl.map b/doc/libtrap-devel/ifc__tcpip_8h__incl.map new file mode 100644 index 00000000..060e4d73 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tcpip_8h__incl.md5 b/doc/libtrap-devel/ifc__tcpip_8h__incl.md5 new file mode 100644 index 00000000..6c6be14d --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h__incl.md5 @@ -0,0 +1 @@ +e592e0d707bb3d1b9848d4a1a0c78c96 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tcpip_8h__incl.png b/doc/libtrap-devel/ifc__tcpip_8h__incl.png new file mode 100644 index 00000000..fd68d308 Binary files /dev/null and b/doc/libtrap-devel/ifc__tcpip_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__tcpip_8h_source.html b/doc/libtrap-devel/ifc__tcpip_8h_source.html new file mode 100644 index 00000000..4fbd4f60 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip_8h_source.html @@ -0,0 +1,91 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tcpip.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tcpip.h
3  * \brief TRAP TCP/IP interfaces
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2013
6  * \date 2014
7  */
8 /*
9  * Copyright (C) 2013,2014 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 #ifndef _TRAP_IFC_TCPIP_H_
45 #define _TRAP_IFC_TCPIP_H_
46 
47 #include "trap_ifc.h"
48 
49 /**
50  * Delimiter used between *params* in the *create_tcpip_sender_ifc* and *create_tcpip_receiver_ifc* functions.
51  */
52 #define TCPIP_IFC_PARAMS_DELIMITER (',')
53 
54 #ifndef DEFAULT_SOCKET_FORMAT
55 #define DEFAULT_SOCKET_FORMAT "/trap-%s.sock"
56 #endif
57 
58 #ifndef UNIX_PATH_FILENAME_FORMAT
59 /**
60  * Communication via UNIX socket needs to specify path to socket file.
61  * It is currently placed according to this format, where %s is replaced by
62  * port given as an argument of TCPIP IFC.
63  */
64 #define UNIX_PATH_FILENAME_FORMAT DEFAULTSOCKETDIR DEFAULT_SOCKET_FORMAT
65 #endif
66 
67 /**
68  * Type of socket that is used for the TRAP interface.
69  */
71  TRAP_IFC_TCPIP, ///< use TCP/IP connection
72  TRAP_IFC_TCPIP_UNIX, ///< use UNIX socket for local communication
73  TRAP_IFC_TCPIP_SERVICE ///< use UNIX socket as a service interface
74 };
75 #define TCPIP_SOCKETTYPE_STR(st) (st == TRAP_IFC_TCPIP?"TCP":(st == TRAP_IFC_TCPIP_UNIX ? "UNIX": "SERVICE"))
76 /** Create TCP/IP output interface.
77  * \param [in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
78  * \param [in] params format not decided yet
79  * \param [out] ifc Created interface for library purposes
80  * \param [in] type select the type of socket (see #tcpip_ifc_sockettype for options)
81  * \return 0 on success (TRAP_E_OK)
82  */
83 int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type);
84 
85 
86 /** Create TCP/IP input interface.
87  * \param [in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
88  * \param [in] params format not decided yet
89  * \param [out] ifc Created interface for library purposes
90  * \param [in] type select the type of socket (see #tcpip_ifc_sockettype for options)
91  * \return 0 on success (TRAP_E_OK)
92  */
93 int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t itx, enum tcpip_ifc_sockettype type);
94 
95 #endif
int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t itx, enum tcpip_ifc_sockettype type)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tcpip.c:636
+ +
use UNIX socket as a service interface
Definition: ifc_tcpip.h:73
+ +
use UNIX socket for local communication
Definition: ifc_tcpip.h:72
+ +
use TCP/IP connection
Definition: ifc_tcpip.h:71
+
int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tcpip.c:1730
+
Interface of TRAP interfaces.
+
tcpip_ifc_sockettype
Definition: ifc_tcpip.h:70
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h.html b/doc/libtrap-devel/ifc__tcpip__internal_8h.html new file mode 100644 index 00000000..72778533 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h.html @@ -0,0 +1,136 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip_internal.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tcpip_internal.h File Reference
+
+
+ +

TRAP TCP/IP interfaces private structures. +More...

+
#include "ifc_socket_common.h"
+
+Include dependency graph for ifc_tcpip_internal.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + +
+
+

Go to the source code of this file.

+ + + + + + + + + + +

+Data Structures

struct  client_s
 Structure for TCP/IP IFC client information. More...
 
struct  tcpip_sender_private_s
 Structure for TCP/IP IFC private information. More...
 
struct  tcpip_receiver_private_s
 
+ + + + + + + + + +

+Typedefs

typedef struct client_s client_t
 Structure for TCP/IP IFC client information. More...
 
typedef struct tcpip_sender_private_s tcpip_sender_private_t
 Structure for TCP/IP IFC private information. More...
 
typedef struct tcpip_receiver_private_s tcpip_receiver_private_t
 
+

Detailed Description

+

TRAP TCP/IP interfaces private structures.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2014
+ +

Definition in file ifc_tcpip_internal.h.

+
+ + + + diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.map b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.map new file mode 100644 index 00000000..44c3b5a8 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.md5 new file mode 100644 index 00000000..f1c0331b --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.md5 @@ -0,0 +1 @@ +7ee28c2dec226a01665d1d1e8851e2a5 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.png b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.png new file mode 100644 index 00000000..7a21fffa Binary files /dev/null and b/doc/libtrap-devel/ifc__tcpip__internal_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.map b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.map new file mode 100644 index 00000000..9d53f832 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.md5 b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.md5 new file mode 100644 index 00000000..b89a4e1f --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.md5 @@ -0,0 +1 @@ +6e10f5188699410d05cb1c8091fbe552 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.png b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.png new file mode 100644 index 00000000..e7a13f06 Binary files /dev/null and b/doc/libtrap-devel/ifc__tcpip__internal_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__tcpip__internal_8h_source.html b/doc/libtrap-devel/ifc__tcpip__internal_8h_source.html new file mode 100644 index 00000000..22c706a8 --- /dev/null +++ b/doc/libtrap-devel/ifc__tcpip__internal_8h_source.html @@ -0,0 +1,137 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tcpip_internal.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tcpip_internal.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tcpip_internal.h
3  * \brief TRAP TCP/IP interfaces private structures
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2014
6  */
7 /*
8  * Copyright (C) 2013 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #include "ifc_socket_common.h"
45 
46 /** \addtogroup trap_ifc
47  * @{
48  */
49 
50 /** \addtogroup tcpip_ifc
51  * @{
52  */
53 
54  /**
55  * \defgroup tcpip_sender TCPIP output IFC
56  * @{
57  */
58 
59 /**
60  * \brief Structure for TCP/IP IFC client information.
61  */
62 typedef struct client_s {
63  int sd; /**< Client socket descriptor */
64  int pfds_index; /**< Client pfds struct array index. */
65  void *sending_pointer; /**< Pointer to data in client's assigned buffer */
66 
67  uint64_t timer_total; /**< Total time spent sending (microseconds) since client connection */
68  uint64_t timeouts; /**< Number of messages dropped (since connection) due to client blocking active buffer */
69 
70  uint32_t timer_last; /**< Time spent on last send call [microseconds] */
71  uint32_t pending_bytes; /**< The size of data that must be sent */
72  uint32_t id; /**< Client identification - PID for unix socket, port number for TCP socket */
73  uint32_t assigned_buffer; /**< Index of assigned buffer in array of buffers */
74 } client_t;
75 
76 /**
77  * \brief Structure for TCP/IP IFC private information.
78  */
79 typedef struct tcpip_sender_private_s {
80  trap_ctx_priv_t *ctx; /**< Libtrap context */
81 
82  enum tcpip_ifc_sockettype socket_type; /**< Socket type (TCPIP / UNIX) */
83 
84  int term_pipe[2]; /**< File descriptor pair for select() termination */
85  int server_sd; /**< Server socket descriptor */
86 
87  char *server_port; /**< TCPIP port number / UNIX socket path */
88  char is_terminated; /**< Termination flag */
89  char initialized; /**< Initialization flag */
90 
91  uint64_t autoflush_timestamp; /**< Time when the last buffer was finished - used for autoflush */
92  uint64_t clients_bit_arr; /**< Bit array of currently connected clients - lowest bit = index 0, highest bit = index 63 */
93 
94  uint32_t ifc_idx; /**< Index of interface in 'out_ifc_list' array */
95  uint32_t connected_clients; /**< Number of currently connected clients */
96  uint32_t clients_arr_size; /**< Maximum number of clients */
97  uint32_t buffer_count; /**< Number of buffers used */
98  uint32_t buffer_size; /**< Buffer size [bytes] */
99  uint32_t active_buffer; /**< Index of active buffer in 'buffers' array */
100 
101  buffer_t *buffers; /**< Array of buffer structures */
102  client_t *clients; /**< Array of client structures */
103 
104  struct pollfd *clients_pfds; /**< Array of clients pfds for poll */
105 
106  pthread_t accept_thr; /**< Pthread structure containing info about accept thread */
107  pthread_t send_thr; /**< Pthread structure containing info about sending thread */
108 
109  pthread_mutex_t mtx_no_data; /**< Mutex for cond_no_data */
110  pthread_cond_t cond_no_data; /**< Condition struct used when waiting for new data */
111  pthread_cond_t cond_full_buffer; /**< Condition struct used when waiting for free buffer */
113 
114 /**
115  * @}
116  */
117 
118 /**
119  * \defgroup tcpip_receiver TCPIP input IFC
120  * @{
121  */
122 typedef struct tcpip_receiver_private_s {
123  trap_ctx_priv_t *ctx; /**< Libtrap context */
124  char *dest_addr;
125  char *dest_port;
126  char connected;
128  int sd;
130  void *data_pointer; /**< Pointer to next free byte, if NULL, we ended in header */
131  uint32_t data_wait_size; /**< Missing data to accept in the next function call */
132  void *ext_buffer; /**< Pointer to buffer that was passed by higher layer - this is the place we write */
133  uint32_t ext_buffer_size; /**< size of content of the extbuffer */
134  trap_buffer_header_t int_mess_header; /**< Internal message header - used for message_buffer payload size \note message_buffer size is sizeof(tcpip_tdu_header_t) + payload size */
135  uint32_t ifc_idx;
137 
138 /**
139  * @}
140  */
141 
142 /**
143  * @}
144  */
145 
146 /**
147  * @}
148  */
149 
+ + + + + +
void * sending_pointer
+ + +
Output buffer structure.
+
pthread_cond_t cond_full_buffer
+
uint64_t timer_total
+ + +
enum tcpip_ifc_sockettype socket_type
+
uint32_t assigned_buffer
+ + + + + + + +
uint64_t timeouts
+
struct tcpip_receiver_private_s tcpip_receiver_private_t
+
struct pollfd * clients_pfds
+ + + + + +
uint32_t timer_last
+
Structure for TCP/IP IFC private information.
+ +
struct tcpip_sender_private_s tcpip_sender_private_t
Structure for TCP/IP IFC private information.
+
trap_buffer_header_t int_mess_header
+
Structure for TCP/IP IFC client information.
+ + + + +
struct client_s client_t
Structure for TCP/IP IFC client information.
+ + + +
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls)...
+ + + +
enum tcpip_ifc_sockettype socket_type
+ +
uint32_t pending_bytes
+ + + +
tcpip_ifc_sockettype
Definition: ifc_tcpip.h:70
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls_8c.html b/doc/libtrap-devel/ifc__tls_8c.html new file mode 100644 index 00000000..718cf049 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8c.html @@ -0,0 +1,296 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tls.c File Reference
+
+
+ +

TRAP TCP with TLS interfaces. +More...

+
#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <pthread.h>
+#include <errno.h>
+#include <semaphore.h>
+#include <assert.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/bio.h>
+#include <openssl/pem.h>
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include "../include/libtrap/trap.h"
+#include "trap_internal.h"
+#include "trap_ifc.h"
+#include "trap_error.h"
+#include "ifc_tls.h"
+#include "ifc_tls_internal.h"
+#include "ifc_socket_common.h"
+
+Include dependency graph for ifc_tls.c:
+
+
+ + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

union  tls_socket_addr
 
+ + + + + + + + + + + + + + + + + + + +

+Macros

#define _GNU_SOURCE
 
#define MAX_RECOVERY_TRY   10
 
#define RECOVERY_WAIT_USEC   500000
 
#define USEC_IN_SEC   1000000
 
#define ACK_MESS_SIZE   1
 
#define CRIT_1VS2SEND   10000
 
#define MAX(a, b)   ((a)<(b)?(b):(a))
 
#define MIN(a, b)   ((a)>(b)?(b):(a))
 
#define X(pointer)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static SSL_CTX * tlsserver_create_context ()
 
static SSL_CTX * tlsclient_create_context ()
 
static int verify_certificate (SSL *arg)
 Verify context of ssl. More...
 
static int tls_server_configure_ctx (const char *cert, SSL_CTX *ctx)
 Configure context of ssl server. More...
 
static int tls_configure_ctx (SSL_CTX *ctx, const char *key, const char *crt, const char *ca)
 Configure ssl context of new connection. More...
 
static int client_socket_connect (tls_receiver_private_t *c, struct timeval *tv)
 client_socket is used as a receiver More...
 
static void client_socket_disconnect (void *priv)
 
static int server_socket_open (void *priv)
 Open TLS socket for sender module. More...
 
static void * get_in_addr (struct sockaddr *sa)
 Get sockaddr, IPv4 or IPv6. More...
 
static int receive_part (void *priv, void **data, uint32_t *size, struct timeval *tm)
 
int tls_receiver_recv (void *priv, void *data, uint32_t *size, int timeout)
 Receive data from interface. More...
 
void tls_receiver_terminate (void *priv)
 Set interface state as terminated. More...
 
void tls_receiver_destroy (void *priv)
 Destructor of TLS receiver (input ifc) More...
 
static void tls_receiver_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tls_recv_ifc_get_id (void *priv)
 
uint8_t tls_recv_ifc_is_conn (void *priv)
 
int create_tls_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
static int wait_for_connection (int sock, struct timeval *tv)
 
static void disconnect_client (tls_sender_private_t *priv, int cl_id)
 This function is called when a client was/is being disconnected. More...
 
void tls_server_disconnect_all_clients (void *priv)
 Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter. More...
 
static uint64_t get_cur_timestamp ()
 
static void * accept_clients_thread (void *arg)
 This function runs in a separate thread and handles new client's connection requests. More...
 
static void finish_buffer (tls_sender_private_t *priv, buffer_t *buffer)
 Write buffer size to its header and shift active index. More...
 
void tls_sender_flush (void *priv)
 Force flush of active buffer. More...
 
static int send_data (tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id)
 Send data to client from his assigned buffer. More...
 
static void * sending_thread_func (void *priv)
 This function runs in a separate thread. It handles sending data to connected clients for TLS interface. More...
 
int tls_sender_send (void *priv, const void *data, uint16_t size, int timeout)
 Store message into buffer. More...
 
void tls_sender_terminate (void *priv)
 Set interface state as terminated. More...
 
void tls_sender_destroy (void *priv)
 Destructor of TCP sender (output ifc) More...
 
int32_t tls_sender_get_client_count (void *priv)
 
int8_t tls_sender_get_client_stats_json (void *priv, json_t *client_stats_arr)
 
static void tls_sender_create_dump (void *priv, uint32_t idx, const char *path)
 
char * tls_send_ifc_get_id (void *priv)
 
int create_tls_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
+

Detailed Description

+

TRAP TCP with TLS interfaces.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
+Jaroslav Hlavac hlava.nosp@m.j20@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2018
+ +

Definition in file ifc_tls.c.

+

Macro Definition Documentation

+ +

◆ _GNU_SOURCE

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+ +

Definition at line 45 of file ifc_tls.c.

+ +
+
+ +

◆ X

+ +
+
+ + + + + + + + +
#define X( pointer)
+
+Value:
free(pointer); \
pointer = NULL;
+
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls_8c__incl.map b/doc/libtrap-devel/ifc__tls_8c__incl.map new file mode 100644 index 00000000..a42bed7b --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8c__incl.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/doc/libtrap-devel/ifc__tls_8c__incl.md5 b/doc/libtrap-devel/ifc__tls_8c__incl.md5 new file mode 100644 index 00000000..04535d87 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8c__incl.md5 @@ -0,0 +1 @@ +9f4519a7231be327d4a17522327227d7 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tls_8c__incl.png b/doc/libtrap-devel/ifc__tls_8c__incl.png new file mode 100644 index 00000000..db884125 Binary files /dev/null and b/doc/libtrap-devel/ifc__tls_8c__incl.png differ diff --git a/doc/libtrap-devel/ifc__tls_8c_source.html b/doc/libtrap-devel/ifc__tls_8c_source.html new file mode 100644 index 00000000..de6e7ecc --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8c_source.html @@ -0,0 +1,265 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tls.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tls.c
3  * \brief TRAP TCP with TLS interfaces
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \author Jaroslav Hlavac <hlavaj20@fit.cvut.cz>
6  * \date 2018
7  */
8 /*
9  * Copyright (C) 2013-2018 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 
45 #define _GNU_SOURCE
46 #include <arpa/inet.h>
47 #include <netdb.h>
48 #include <netinet/in.h>
49 #include <stdio.h>
50 #include <stdlib.h>
51 #include <string.h>
52 #include <sys/socket.h>
53 #include <sys/un.h>
54 #include <sys/types.h>
55 #include <sys/stat.h>
56 #include <unistd.h>
57 #include <fcntl.h>
58 #include <inttypes.h>
59 #include <pthread.h>
60 #include <errno.h>
61 #include <semaphore.h>
62 #include <assert.h>
63 
64 #include <openssl/ssl.h>
65 #include <openssl/err.h>
66 #include <openssl/bio.h>
67 #include <openssl/pem.h>
68 #include <openssl/x509.h>
69 #include <openssl/x509_vfy.h>
70 
71 
72 #include "../include/libtrap/trap.h"
73 #include "trap_internal.h"
74 #include "trap_ifc.h"
75 #include "trap_error.h"
76 #include "ifc_tls.h"
77 #include "ifc_tls_internal.h"
78 #include "ifc_socket_common.h"
79 
80 /**
81  * \addtogroup trap_ifc TRAP communication module interface
82  * @{
83  */
84 /**
85  * \addtogroup tls_ifc TLS communication interface module
86  * @{
87  */
88 
89 #define MAX_RECOVERY_TRY 10
90 /* must be smaller than 1000000 */
91 #define RECOVERY_WAIT_USEC 500000
92 #define USEC_IN_SEC 1000000
93 #define ACK_MESS_SIZE 1
94 #define CRIT_1VS2SEND 10000
95 #ifndef MAX
96 #define MAX(a,b) ((a)<(b)?(b):(a))
97 #endif
98 #ifndef MIN
99 #define MIN(a,b) ((a)>(b)?(b):(a))
100 #endif
101 
102 static SSL_CTX *tlsserver_create_context()
103 {
104  const SSL_METHOD *method;
105  SSL_CTX *ctx;
106 
107  method = SSLv23_server_method();
108 
109  ctx = SSL_CTX_new(method);
110  if (!ctx) {
111  perror("Unable to create SSL context");
112  ERR_print_errors_fp(stderr);
113  return NULL;
114  }
115 
116 #if defined(SSL_CTX_set_ecdh_auto)
117  SSL_CTX_set_ecdh_auto(ctx, 1);
118 #else
119  SSL_CTX_set_tmp_ecdh(ctx, EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
120 #endif
121 
122  return ctx;
123 }
124 
125 static SSL_CTX *tlsclient_create_context()
126 {
127  const SSL_METHOD *method;
128  SSL_CTX *ctx = NULL;
129 
130  method = SSLv23_client_method();
131 
132  ctx = SSL_CTX_new(method);
133  if (!ctx) {
134  perror("Unable to create SSL context");
135  ERR_print_errors_fp(stderr);
136  }
137 
138  return ctx;
139 }
140 
141 /**
142  * \brief Verify context of ssl.
143  * \param[in] arg pointer to SSL (usually stored in tls_receiver_private_t resp. in an array of tlsclient_s inside tls_sender_private_t for input resp. output IFC)
144  * \return 1 on failure, 0 on success
145  * Disabling undesired versions of TLS/SSL and adding supported CAs to SSL_CTX.
146  */
147 static int verify_certificate(SSL *arg)
148 {
149  X509 *cert = NULL;
150  int ret = 0;
151 
152  cert = SSL_get_peer_certificate(arg);
153  if (cert == NULL) {
154  VERBOSE(CL_ERROR, "Could not retrieve peer certificate file.");
155  return EXIT_FAILURE;
156  }
157 
158  if (SSL_get_verify_result(arg) == X509_V_OK) {
159  ret = EXIT_SUCCESS;
160  } else {
161  ret = EXIT_FAILURE;
162  }
163 
164  X509_free(cert);
165  return ret;
166 }
167 
168 /**
169  * \brief Configure context of ssl server.
170  * \param[in] cert path to certfile
171  * \param[in] ctx ssl context to be configured
172  * \return 1 on failure, 0 on success
173  * Disabling undesired versions of TLS/SSL and adding supported CAs to SSL_CTX.
174  */
175 static int tls_server_configure_ctx(const char *cert, SSL_CTX *ctx)
176 {
177  X509* certificate = X509_new();
178  BIO* bio_cert = BIO_new_file(cert, "r");
179 
180  PEM_read_bio_X509(bio_cert, &certificate, NULL, NULL);
181  if (certificate == NULL) {
182  VERBOSE(CL_ERROR, "Could not load certificate file.");
183  return EXIT_FAILURE;
184  }
185  if (SSL_CTX_add_client_CA(ctx, certificate) != 1) {
186  VERBOSE(CL_ERROR, "Could not add certificate to SSL_CTX.");
187  return EXIT_FAILURE;
188  }
189  /* disabling undesired versions of TLS */
190  SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
191  SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3);
192  SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1);
193  SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_1);
194 
195  X509_free(certificate);
196  BIO_free_all(bio_cert);
197  return EXIT_SUCCESS;
198 }
199 
200 /**
201  * \brief Configure ssl context of new connection.
202  * \param[in] ctx ssl context to be configured
203  * \param[in] key path to keyfile
204  * \param[in] crt path to certfile
205  * \param[in] ca path to CA file
206  * \return 1 on failure, 0 on success
207  * Loading certificate and key to SSL_CTX. Setting location of CA that is used for verification of
208  * incomming certificates. Also forcing peer to send it's certificate.
209  */
210 static int tls_configure_ctx(SSL_CTX *ctx, const char *key, const char *crt, const char *ca)
211 {
212  int ret;
213 
214  /* Set the key and cert */
215  ret = SSL_CTX_use_certificate_chain_file(ctx, crt);
216  if (ret != 1) {
217  VERBOSE(CL_ERROR, "Loading certificate (%s) failed. %s",
218  crt, ERR_reason_error_string(ERR_get_error()));
219  return EXIT_FAILURE;
220  }
221 
222  ret = SSL_CTX_use_PrivateKey_file(ctx, key, SSL_FILETYPE_PEM);
223  if (ret != 1) {
224  VERBOSE(CL_ERROR, "Loading private key (%s) failed: %s",
225  key, ERR_reason_error_string(ERR_get_error()));
226  return EXIT_FAILURE;
227  }
228 
229  if (SSL_CTX_check_private_key(ctx) == 0) {
230  VERBOSE(CL_ERROR, "Private key does not match the certificate public key.");
231  return EXIT_FAILURE;
232  }
233 
234 
235  if (SSL_CTX_load_verify_locations(ctx, ca, NULL) != 1) {
236  VERBOSE(CL_ERROR, "Could not load CA location used for verification.");
237  return EXIT_FAILURE;
238  }
239  SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
240 
241  return EXIT_SUCCESS;
242 }
243 
244 /***** TCPIP server *****/
245 
246 /**
247  * Internal union for host address storage, common for tcpip & unix
248  */
250  struct addrinfo tls_addr; ///< used for TCPIP socket
251  struct sockaddr_un unix_addr; ///< used for path of UNIX socket
252 };
253 
254 static int client_socket_connect(tls_receiver_private_t *priv, struct timeval *tv);
255 static void client_socket_disconnect(void *priv);
256 static int server_socket_open(void *priv);
257 
258 /**
259  * \brief Get sockaddr, IPv4 or IPv6
260  * \param[in] sa structure with input socket address
261  * \return converted ponter to address
262  */
263 static void *get_in_addr(struct sockaddr *sa)
264 {
265  if (sa->sa_family == AF_INET) {
266  return &(((struct sockaddr_in*)sa)->sin_addr);
267  }
268 
269  return &(((struct sockaddr_in6*)sa)->sin6_addr);
270 }
271 
272 /**
273  * \addtogroup tls_receiver TLS Input IFC
274  * @{
275  */
276 /* Receiver (client socket) */
277 // Receiver is a client that connects itself to the source of data (to sender) = server
278 
279 /**
280  * Receive data
281  * \param[in] priv private IFC data
282  * \param[out] data received data
283  * \param[in,out] size expected size to wait for, it is used to return size that was not read
284  * \param[in] tm timeout
285  */
286 static int receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm)
287 {
288  void *data_p = (*data);
290  ssize_t numbytes = *size;
291  int recvb, retval;
292  fd_set set;
293 
294  assert(data_p != NULL);
295 
296  while (config->is_terminated == 0) {
297  DEBUG_IFC(if (tm) {VERBOSE(CL_VERBOSE_LIBRARY, "Try to receive data in timeout %" PRIu64
298  "s%"PRIu64"us", tm->tv_sec, tm->tv_usec)});
299 
300  FD_ZERO(&set);
301  FD_SET(config->sd, &set);
302  /*
303  * Blocking or with timeout?
304  * With timeout 0,0 - non-blocking
305  */
306  retval = select(config->sd + 1, &set, NULL, NULL, tm);
307  if (retval > 0) {
308  if (FD_ISSET(config->sd, &set)) {
309  do {
310  recvb = SSL_read(config->ssl, data_p, numbytes);
311  if (recvb < 1) {
312  if (recvb == 0) {
313  errno = EPIPE;
314  }
315  switch (errno) {
316  case EINTR:
317  VERBOSE(CL_ERROR, "EINTR occured");
318  if (config->is_terminated == 1) {
320  return TRAP_E_TERMINATED;
321  }
322  break;
323  case EBADF:
324  case EPIPE:
326  return TRAP_E_IO_ERROR;
327  case EAGAIN:
328  (*size) = numbytes;
329  (*data) = data_p;
330  return TRAP_E_TIMEOUT;
331  }
332  }
333  numbytes -= recvb;
334  data_p += recvb;
335  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "receive_part got %" PRId32 "B", recvb));
336  } while (numbytes > 0);
337  (*size) = numbytes;
338  (*data) = data_p;
339  return TRAP_E_OK;
340  } else {
341  continue;
342  }
343  } else if (retval == 0) {
344  VERBOSE(CL_VERBOSE_LIBRARY, "Timeout elapsed - non-blocking call used.");
345  (*size) = numbytes;
346  return TRAP_E_TIMEOUT;
347  } else if (retval < 0 && errno == EINTR) { /* signal received */
348  /** \todo continue with timeout minus time already waited */
349  VERBOSE(CL_VERBOSE_BASIC, "select interrupted");
350  continue;
351  } else { /* some error has occured */
352  VERBOSE(CL_VERBOSE_OFF, "select() returned %i (%s)", retval, strerror(errno));
354  return TRAP_E_IO_ERROR;
355  }
356  }
357  return TRAP_E_TERMINATED;
358 }
359 
360 /**
361  * \brief Receive data from interface.
362  *
363  * It is expected that data is always the same pointer because it is buffer given by trap.c.
364  *
365  * This function contains finite state machine that controls receiving messages (header
366  * and payload), handles timeouts and sleep (to offload CPU during waiting for connection).
367  * The transition graph is:
368  * \dot
369  * digraph fsm { label="tls_receiver_recv()";labelloc=t;
370  * init -> conn_wait;
371  * init -> head_wait;
372  * init -> mess_wait;
373  * discard -> reset;
374  * reset -> init;
375  * reset -> init;
376  * reset -> reset;
377  * reset -> init;
378  * conn_wait -> reset;
379  * conn_wait -> head_wait;
380  * head_wait -> discard;
381  * head_wait -> reset;
382  * head_wait -> reset;
383  * head_wait -> mess_wait;
384  * mess_wait -> discard;
385  * mess_wait -> reset;
386  * }
387  * \enddot
388  *
389  * \param [in,out] priv private configuration structure
390  * \param [out] data where received data are stored
391  * \param [out] size size of received data
392  * \param [in] timeout timeout in usec, can be TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT
393  * \return TRAP_E_OK (0) on success
394  */
395 int tls_receiver_recv(void *priv, void *data, uint32_t *size, int timeout)
396 {
397 #ifdef LIMITED_RECOVERY
398  uint32_t recovery = 0;
399 #endif
400  /** messageframe contains header that is read (even partially) in HEAD_WAIT */
401  trap_buffer_header_t messageframe;
403  void *p = &messageframe;
404  struct timeval tm, *temptm;
405  int retval;
406  /* first timestamp for global timeout in this function...
407  * in the RESET state, we should check the timeout given by caller
408  * with elapsed time from entry_time.
409  * Timeout is in microseconds... */
410  struct timespec spec_time;
411 
412  clock_gettime(CLOCK_MONOTONIC, &spec_time);
413  /* entry_time is in microseconds seconds -> secs * microsends + nanoseconds */
414  uint64_t entry_time = spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
415  uint64_t curr_time = 0;
416 
417  /* sleeptime (in usec) with sleeptimespec are used to wait
418  * for a while before next connecting when non-blocking. */
419  uint64_t sleeptime;
420  struct timespec sleeptimespec;
421 
422  /* correct module will pass only possitive timeout or TRAP_WAIT.
423  * TRAP_HALFWAIT is not valid value */
424  assert(timeout > TRAP_HALFWAIT);
425 
426  if ((config == NULL) || (data == NULL) || (size == NULL)) {
427  return TRAP_E_BAD_FPARAMS;
428  }
429  (*size) = 0;
430 
431  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv trap_recv() was called"));
432 
433  /* convert libtrap timeout into timespec and timeval */
434  trap_set_timeouts(timeout, &tm, NULL);
435  temptm = (timeout==TRAP_WAIT?NULL:&tm);
436 
437  while (config->is_terminated == 0) {
438 init:
439  p = &messageframe;
440  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv INIT"));
441  if (config->connected == 0) {
442  goto conn_wait;
443  } else {
444  if (config->data_pointer == NULL) {
445  goto head_wait;
446  } else {
447  /* continue where we timedout earlier */
448  p = config->data_pointer;
449  goto mess_wait;
450  }
451  }
452 discard:
453  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv DISCARD"));
454  config->data_pointer = NULL;
455  goto reset;
456 reset:
457  if (config->is_terminated != 0) {
458  /* TRAP_E_TERMINATED is returned outside the loop */
459  break;
460  }
461  /* failure, next state is exit when we are non-blocking or INIT on blocking,
462  this state is a great place for handling timeouts. */
463  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv RESET"));
464  if (timeout == TRAP_WAIT) {
465 #ifdef LIMITED_RECOVERY
466  if (++recovery > MAX_RECOVERY_TRY) {
467  goto init;
468  } else {
469  return TRAP_E_TIMEOUT;
470  }
471 #else
472  goto init;
473 #endif
474  } else {
475  /* non-blocking mode, let's check elapsed time */
476  clock_gettime(CLOCK_MONOTONIC, &spec_time);
477  curr_time = spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
478  if ((curr_time - entry_time) >= timeout) {
479  return TRAP_E_TIMEOUT;
480  } else {
481  if (config->connected == 0) {
482  /* wait at most 1 second before return to INIT */
483 
484  /* sleeptime is in usec */
485  sleeptime = timeout - (curr_time - entry_time);
486  /* if remaining sleeptime is higher than 1s, use 1s */
487  if (sleeptime < 1000000) {
488  sleeptimespec.tv_sec = sleeptime / 1000000;
489  sleeptimespec.tv_nsec = (sleeptime % 1000000) * 1000;
490  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "sleep time set %" PRIu64
491  " us: %"PRIu64"s%"PRIu64"ns", sleeptime,
492  sleeptimespec.tv_sec, sleeptimespec.tv_nsec));
493  } else {
494  sleeptimespec.tv_sec = 1;
495  sleeptimespec.tv_nsec = 0;
496  }
497  /* We are not interested in reminder, because timeout will be
498  * checked again later. */
499  if (nanosleep(&sleeptimespec, NULL) == -1) {
500  if (errno == EINTR) {
501  goto reset;
502  } else {
503  VERBOSE(CL_ERROR, "recv nanosleep(): %s", strerror(errno));
504  }
505  }
506  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv nanosleep finished"));
507  }
508 
509  /* update timeout that is used for recv after successful connection */
510  clock_gettime(CLOCK_MONOTONIC, &spec_time);
511  curr_time = spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
512  sleeptime = timeout - (int) (curr_time - entry_time);
513  if ((int) sleeptime > 0) {
514  trap_set_timeouts(sleeptime, &tm, NULL);
515  } else {
516  return TRAP_E_TIMEOUT;
517  }
518 
519  goto init;
520  }
521  }
522 conn_wait:
523  /* check if connected -> try to connect -> check if connected; next state is RESET or HEAD_WAIT */
524  /* expected next state is waiting for header */
525  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv CONN_WAIT"));
526  if (config->connected == 0) {
527  /* we don't have connection, we must try to connect before accepting header */
528  retval = client_socket_connect(config, temptm);
529  if (retval == TRAP_E_FIELDS_MISMATCH) {
530  config->connected = 1;
531  return TRAP_E_FORMAT_MISMATCH;
532  } else if (retval == TRAP_E_OK) {
533  config->connected = 1;
534  /* ok, wait for header as we planned */
535  } else if (TRAP_E_BAD_CERT) {
536  /* TODO replace with TRAP_E_IO_ERROR and change it in test_echo_reply.c */
537  return TRAP_E_TERMINATED;
538  } else {
539  /* failed, reseting... */
540  if (timeout == TRAP_WAIT) {
541  /* Create a delay when blocking...
542  * This is specific situation, many attempts would be unpleasant */
543  sleep(1);
544  }
545  goto reset;
546  }
547  }
548  goto head_wait;
549 head_wait:
550  /* get and check header of message, next state can be MESS_WAIT or RESET */
551  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv HEAD_WAIT (%p)", p));
552  config->data_wait_size = sizeof(trap_buffer_header_t);
553  retval = receive_part(config, &p, &config->data_wait_size, temptm);
554  if (retval != TRAP_E_OK) {
555  /* receiving failed */
556  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv failed HEAD (%p) waiting %d B", p, config->data_wait_size));
557  if (retval == TRAP_E_IO_ERROR) {
558  /* disconnected -> drop data */
559  goto discard;
560  }
561  goto reset;
562  } else {
563  /* we expect to receive data */
564  messageframe.data_length = ntohl(messageframe.data_length);
565  config->data_wait_size = messageframe.data_length;
566  config->ext_buffer_size = messageframe.data_length;
567 #ifdef ENABLE_CHECK_HEADER
568  /* check if header is ok: */
569  if (tls_check_header(&messageframe) == 0) {
570  goto reset;
571  }
572 #endif
573  /* we got header, now we can start receiving payload */
574  p = data;
575  config->ext_buffer = data;
576  goto mess_wait;
577  }
578 mess_wait:
579  /* get and check payload of message, next state can be RESET or success exit */
580  /* receive payload */
581  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv waiting MESS (%p) %d B", p, config->data_wait_size));
582  retval = receive_part(config, &p, &config->data_wait_size, temptm);
583  if (retval == TRAP_E_OK) {
584  /* Success! Data was already set by recv */
585  config->data_pointer = NULL;
586  (*size) = messageframe.data_length;
587  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv get MESS (%p) remains: %d B", p, config->data_wait_size));
588  return TRAP_E_OK;
589  } else {
590  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv get MESS (%p) still waiting for %d B", p, config->data_wait_size));
591  if (retval == TRAP_E_IO_ERROR) {
592  /* disconnected -> drop data */
593  goto discard;
594  }
595  config->data_pointer = p;
596  goto reset;
597  }
598  }
599  return TRAP_E_TERMINATED;
600 }
601 
602 /**
603  * \brief Set interface state as terminated.
604  * \param[in] priv pointer to module private data
605  */
606 void tls_receiver_terminate(void *priv)
607 {
609  if (config != NULL) {
610  config->is_terminated = 1;
611  } else {
612  VERBOSE(CL_ERROR, "Bad parameter of tls_receiver_terminate()!");
613  }
614  return;
615 }
616 
617 
618 /**
619  * \brief Destructor of TLS receiver (input ifc)
620  * \param[in] priv pointer to module private data
621  */
622 void tls_receiver_destroy(void *priv)
623 {
625  if (config != NULL) {
626  if (config->connected == 1) {
627  close(config->sd);
628  }
629  free(config->ssl);
630  free(config->sslctx);
631  free(config->dest_addr);
632  free(config->dest_port);
633  free(config->keyfile);
634  free(config->certfile);
635  free(config->cafile);
636  free(config);
637  } else {
638  VERBOSE(CL_ERROR, "Destroying IFC that is probably not initialized.");
639  }
640  return;
641 }
642 
643 static void tls_receiver_create_dump(void *priv, uint32_t idx, const char *path)
644 {
646  /* return value */
647  int r;
648  /* config file trap-i<number>-config.txt */
649  char *conf_file = NULL;
650  /* config file trap-i<number>-buffer.dat */
651  char *buf_file = NULL;
652  FILE *f = NULL;
653  trap_buffer_header_t aux = { 0 };
654  aux.data_length = htonl(c->ext_buffer_size);
655 
656  r = asprintf(&conf_file, "%s/trap-i%02"PRIu32"-config.txt", path, idx);
657  if (r == -1) {
658  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
659  conf_file = NULL;
660  goto exit;
661  }
662  f = fopen(conf_file, "w");
663  fprintf(f, "Dest addr: %s\nDest port: %s\nConnected: %d\n"
664  "Terminated: %d\nSocket descriptor: %d\n"
665  "Data pointer: %p\nData wait size: %"PRIu32"\nMessage header: %"PRIu32"\n"
666  "Extern buffer pointer: %p\nExtern buffer data size: %"PRIu32"\n"
667  "Timeout: %"PRId32"us (%s)\nPrivate key: %s\nCertificate: %s\n",
668  c->dest_addr, c->dest_port, c->connected, c->is_terminated, c->sd,
671  c->ctx->in_ifc_list[idx].datatimeout,
673  c->keyfile, c->certfile);
674  fclose(f);
675  f = NULL;
676 
677  r = asprintf(&buf_file, "%s/trap-i%02"PRIu32"-buffer.dat", path, idx);
678  if (r == -1) {
679  buf_file = NULL;
680  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
681  goto exit;
682  }
683  f = fopen(buf_file, "w");
684  if (fwrite(&aux, sizeof(c->ext_buffer_size), 1, f) != 1) {
685  VERBOSE(CL_ERROR, "Writing buffer header failed. (%s:%d)", __FILE__, __LINE__);
686  goto exit;
687  }
688  if (fwrite(c->ext_buffer, c->ext_buffer_size, 1, f) != 1) {
689  VERBOSE(CL_ERROR, "Writing buffer content failed. (%s:%d)", __FILE__, __LINE__);
690  goto exit;
691  }
692 exit:
693  if (f != NULL) {
694  fclose(f);
695  }
696  free(conf_file);
697  free(buf_file);
698  return;
699 }
700 
701 char *tls_recv_ifc_get_id(void *priv)
702 {
703  if (priv == NULL) {
704  return NULL;
705  }
706 
708  if (config->dest_port == NULL) {
709  return NULL;
710  }
711  return config->dest_port;
712 }
713 
714 uint8_t tls_recv_ifc_is_conn(void *priv)
715 {
716  if (priv == NULL) {
717  return 0;
718  }
720  if (config->connected == 1) {
721  return 1;
722  }
723  return 0;
724 }
725 
726 /**
727  * \brief Constructor of input TCP/IP IFC module.
728  * This function is called by TRAP library to initialize one input interface.
729  *
730  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
731  * \param[in] params Configuration string containing space separated values of these parameters (in this exact order): *dest_addr* *dest_port*,
732  * where dest_addr is destination address of output TCP/IP IFC module and
733  * dest_port is the port where sender is listening.
734  * \param[in,out] ifc IFC interface used for calling TCP/IP module.
735  * \param[in] idx Index of IFC that is created.
736  * \return 0 on success (TRAP_E_OK)
737  */
738 int create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
739 {
740  int result = TRAP_E_OK;
741  char *param_iterator = NULL;
742  char *dest_addr = NULL;
743  char *dest_port = NULL;
744  char *keyfile = NULL;
745  char *certfile = NULL;
746  char *cafile = NULL;
747  tls_receiver_private_t *config = NULL;
748 
749  if (params == NULL) {
750  VERBOSE(CL_ERROR, "IFC requires at least three parameters (port:keyfile:certfile).");
751  return TRAP_E_BADPARAMS;
752  }
753 
754  config = (tls_receiver_private_t *) calloc(1, sizeof(tls_receiver_private_t));
755  if (config == NULL) {
756  VERBOSE(CL_ERROR, "Failed to allocate internal memory for input IFC.");
757  return TRAP_E_MEMORY;
758  }
759  config->ctx = ctx;
760  config->is_terminated = 0;
761  config->ifc_idx = idx;
762 
763  /* Parsing params */
764  param_iterator = trap_get_param_by_delimiter(params, &dest_addr, TRAP_IFC_PARAM_DELIMITER);
765  /* error! we expect 2 parameters */
766  if ((dest_addr == NULL) || (strlen(dest_addr) == 0)) {
767  VERBOSE(CL_ERROR, "Expected parameters: 'destination address:port:keyfile:certfile' are missing.");
768  result = TRAP_E_BADPARAMS;
769  goto failsafe_cleanup;
770  }
771  if (param_iterator != NULL) {
772  param_iterator = trap_get_param_by_delimiter(param_iterator, &dest_port, TRAP_IFC_PARAM_DELIMITER);
773  } else {
774  VERBOSE(CL_ERROR, "Missing 'dest_port', 'keyfile', 'certfile' and trusted 'CAfile' parameters.");
775  result = TRAP_E_BADPARAMS;
776  goto failsafe_cleanup;
777  }
778  if (param_iterator != NULL) {
779  param_iterator = trap_get_param_by_delimiter(param_iterator, &keyfile, TRAP_IFC_PARAM_DELIMITER);
780  } else {
781  VERBOSE(CL_ERROR, "Missing 'keyfile', 'certfile' and trusted 'CAfile' parameters.");
782  result = TRAP_E_BADPARAMS;
783  goto failsafe_cleanup;
784  }
785  if (param_iterator != NULL) {
786  param_iterator = trap_get_param_by_delimiter(param_iterator, &certfile, TRAP_IFC_PARAM_DELIMITER);
787  } else {
788  VERBOSE(CL_ERROR, "Missing 'certfile' and trusted 'CAfile' parameters.");
789  result = TRAP_E_BADPARAMS;
790  goto failsafe_cleanup;
791  }
792  if (param_iterator != NULL) {
793  param_iterator = trap_get_param_by_delimiter(param_iterator, &cafile, TRAP_IFC_PARAM_DELIMITER);
794  } else {
795  /* dest_addr skipped, move parameters */
796  cafile = certfile;
797  certfile = keyfile;
798  keyfile = dest_port;
799  dest_port = dest_addr;
800  dest_addr = strdup("localhost");
801  VERBOSE(CL_ERROR, "Only 3 parameters given, using 'localhost' as a destination address.");
802  }
803 
804  /* set global buffer size */
806  /* Parsing params ended */
807 
808  config->dest_addr = dest_addr;
809  config->dest_port = dest_port;
810  config->keyfile = keyfile;
811  config->certfile = certfile;
812  config->cafile = cafile;
813 
814  if ((config->dest_addr == NULL) || (config->dest_port == NULL)) {
815  /* no delimiter found even if we expect two parameters */
816  VERBOSE(CL_ERROR, "Malformed params for input IFC, missing destination address and port.");
817  result = TRAP_E_BADPARAMS;
818  goto failsafe_cleanup;
819  }
820 
821  VERBOSE(CL_VERBOSE_ADVANCED, "config:\ndest_addr=\"%s\"\ndest_port=\"%s\"\n"
822  "TDU size: %u\n", config->dest_addr, config->dest_port,
823  config->int_mess_header.data_length);
824 
825  config->sslctx = tlsclient_create_context();
826  if (config->sslctx == NULL) {
827  result = TRAP_E_MEMORY;
828  goto failsafe_cleanup;
829  }
830  if (tls_configure_ctx(config->sslctx, keyfile, certfile, cafile) == EXIT_FAILURE) {
831  result = TRAP_E_BADPARAMS;
832  goto failsafe_cleanup;
833  }
834 
835  /*
836  * In constructor, we do not know timeout yet.
837  * Use 5 seconds to wait for connection to output interface.
838  */
839 #ifndef ENABLE_NEGOTIATION
840  int retval = 0;
841  struct timeval tv = {5, 0};
842  retval = client_socket_connect(config, &tv);
843  if (retval != TRAP_E_OK) {
844  config->connected = 0;
845  if ((retval == TRAP_E_BAD_FPARAMS) || (retval == TRAP_E_IO_ERROR)) {
846  VERBOSE(CL_VERBOSE_BASIC, "Could not connect to sender due to bad parameters.");
847  result = TRAP_E_BADPARAMS;
848  goto failsafe_cleanup;
849  }
850  } else {
851  config->connected = 1;
852  }
853 #endif
854 
855  /* hook functions and store priv */
856  ifc->recv = tls_receiver_recv;
860  ifc->priv = config;
863 
864 #ifndef ENABLE_NEGOTIATION
865  if (config->connected == 0) {
866  VERBOSE(CL_VERBOSE_BASIC, "Could not connect to sender.");
867  if ((retval == TRAP_E_BAD_FPARAMS) || (retval == TRAP_E_IO_ERROR)) {
868  result = retval;
869  goto failsafe_cleanup;
870  }
871  }
872 #endif
873  return TRAP_E_OK;
874 failsafe_cleanup:
875  free(dest_addr);
876  free(dest_port);
877  free(keyfile);
878  free(certfile);
879  free(cafile);
880  if (config != NULL && config->sslctx != NULL) {
881  SSL_CTX_free(config->sslctx);
882  }
883  free(config);
884  return result;
885 }
886 
887 /**
888  * Disconnect from output IFC.
889  *
890  * \param[in,out] priv pointer to private structure of input IFC (client)
891  */
892 static void client_socket_disconnect(void *priv)
893 {
895  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv Disconnected."));
896  if (config->connected == 1) {
897  VERBOSE(CL_VERBOSE_BASIC, "TLS ifc client disconnecting");
898  SSL_free(config->ssl);
899  config->ssl = NULL;
900  close(config->sd);
901  config->connected = 0;
902  }
903 }
904 
905 /**
906  * Function waits for non-blocking connect().
907  *
908  * \param[in] sock socket descriptor of client
909  * \param[in] tv timeout
910  * \return TRAP_E_OK on success, TRAP_E_TIMEOUT on error (can be caused by interrupt)
911  */
912 static int wait_for_connection(int sock, struct timeval *tv)
913 {
914  int rv;
915  fd_set fdset;
916  FD_ZERO(&fdset);
917  FD_SET(sock, &fdset);
918  VERBOSE(CL_VERBOSE_LIBRARY, "wait for connection");
919 
920  rv = select(sock + 1, NULL, &fdset, NULL, tv);
921  if (rv == 1) {
922  int so_error;
923  socklen_t len = sizeof so_error;
924 
925  getsockopt(sock, SOL_SOCKET, SO_ERROR, &so_error, &len);
926 
927  if (so_error == 0) {
928  return TRAP_E_OK;
929  }
930  }
931  return TRAP_E_TIMEOUT;
932 }
933 
934 
935 /**
936  * \brief client_socket is used as a receiver
937  * \param[in] c pointer to module private data
938  * \param[in] tv timeout
939  * \return TRAP_E_OK on success
940  */
941 static int client_socket_connect(tls_receiver_private_t *c, struct timeval *tv)
942 {
943  int sockfd = -1, options;
944  union tls_socket_addr addr;
945  struct addrinfo *servinfo, *p = NULL;
946  int rv, addr_count = 0;
947  char s[INET6_ADDRSTRLEN];
948 
949  if ((c == NULL) || (c->dest_addr == NULL) || (c->dest_port == NULL)) {
950  return TRAP_E_BAD_FPARAMS;
951  }
952 
953  memset(&addr, 0, sizeof(addr));
954 
955  addr.tls_addr.ai_family = AF_UNSPEC;
956  addr.tls_addr.ai_socktype = SOCK_STREAM;
957 
958  if ((rv = getaddrinfo(c->dest_addr, c->dest_port, &addr.tls_addr, &servinfo)) != 0) {
959  VERBOSE(CL_ERROR, "getaddrinfo: %s", gai_strerror(rv));
960  return TRAP_E_IO_ERROR;
961  }
962 
963  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv Try to connect"));
964 
965  if (tv != NULL) {
966  /* compute uniform intervals for all possible address */
967  for (p = servinfo; p != NULL; p = p->ai_next) {
968  addr_count++;
969  }
970  tv->tv_sec = (tv->tv_sec * 1000000 + tv->tv_usec) / addr_count;
971  tv->tv_usec = tv->tv_sec % 1000000;
972  tv->tv_sec /= 1000000;
973  VERBOSE(CL_VERBOSE_LIBRARY, "Every address will be tried for timeout: %"PRId64"s%"PRId64"us",
974  tv->tv_sec, tv->tv_usec);
975  }
976 
977  /* loop through all the results and connect to the first we can */
978  for (p = servinfo; p != NULL; p = p->ai_next) {
979  if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
980  continue;
981  }
982  if ((options = fcntl(sockfd, F_GETFL)) != -1) {
983  if (fcntl(sockfd, F_SETFL, O_NONBLOCK | options) == -1) {
984  VERBOSE(CL_ERROR, "Could not set socket to non-blocking.");
985  }
986  }
987  if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
988  if (errno != EINPROGRESS && errno != EAGAIN) {
989  DEBUG_IFC(VERBOSE(CL_VERBOSE_LIBRARY, "recv TLS ifc connect error %d (%s)", errno,
990  strerror(errno)));
991  close(sockfd);
992  sockfd = -1;
993  continue;
994  } else {
995  rv = wait_for_connection(sockfd, tv);
996  if (rv == TRAP_E_TIMEOUT) {
997  if (c->is_terminated) {
998  rv = TRAP_E_TERMINATED;
999  break;
1000  }
1001  /* try another address */
1002  close(sockfd);
1003  sockfd = -1;
1004  continue;
1005  } else {
1006  /* success */
1007  rv = TRAP_E_OK;
1008  break;
1009  }
1010  }
1011  }
1012  break;
1013  }
1014  /* there was no successfull connection for whole servinfo struct */
1015  if (p == NULL) {
1016  VERBOSE(CL_VERBOSE_LIBRARY, "recv client: Connection failed.");
1017  rv = TRAP_E_TIMEOUT;
1018  }
1019 
1020  /* catching all possible errors from setting up socket before atempting tls handshake */
1021  if (rv != TRAP_E_OK) {
1022  freeaddrinfo(servinfo);
1023  if (sockfd >= 0)
1024  close(sockfd);
1025  return rv;
1026  }
1027 
1028  if (p != NULL) {
1029  if (inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), s, sizeof s) != NULL) {
1030  VERBOSE(CL_VERBOSE_LIBRARY, "recv client: connected to %s", s);
1031  }
1032  }
1033  freeaddrinfo(servinfo);
1034  servinfo = NULL;
1035 
1036  c->sd = sockfd;
1037  c->ssl = SSL_new(c->sslctx);
1038  if (c->ssl == NULL) {
1039  VERBOSE(CL_ERROR, "Creating SSL structure failed: %s", ERR_reason_error_string(ERR_get_error()));
1040  return TRAP_E_MEMORY;
1041  }
1042 
1043  /* setting tcp socket to be used for ssl connection */
1044  if (SSL_set_fd(c->ssl, c->sd) != 1) {
1045  VERBOSE(CL_ERROR, "Setting SSL file descriptor to tcp socket failed: %s",
1046  ERR_reason_error_string(ERR_get_error()));
1047  return TRAP_E_IO_ERROR;
1048  }
1049  SSL_set_connect_state(c->ssl);
1050 
1051  do {
1052  rv = SSL_connect(c->ssl);
1053  if (rv < 1) {
1054  rv = ERR_get_error();
1055  switch (rv) {
1056  case SSL_ERROR_NONE:
1057  case SSL_ERROR_WANT_CONNECT:
1058  case SSL_ERROR_WANT_X509_LOOKUP:
1059  case SSL_ERROR_WANT_READ:
1060  case SSL_ERROR_WANT_WRITE:
1061  break;
1062  default:
1063  VERBOSE(CL_ERROR, "SSL connection failed, could be wrong certificate. %s",
1064  ERR_reason_error_string(ERR_get_error()));
1065  SSL_free(c->ssl);
1066  c->ssl = NULL;
1067  close(c->sd);
1068  return TRAP_E_IO_ERROR;
1069  }
1070  }
1071  } while (rv < 1);
1072  VERBOSE(CL_VERBOSE_BASIC, "SSL successfully connected")
1073 
1074  int ret_ver = verify_certificate(c->ssl); /* server certificate verification */
1075  if (ret_ver != 0){
1076  VERBOSE(CL_VERBOSE_LIBRARY, "verify_certificate: failed to verify server's certificate");
1077  SSL_free(c->ssl);
1078  c->ssl = NULL;
1079  return TRAP_E_BAD_CERT;
1080  }
1081 
1082  /** Input interface negotiation */
1083 #ifdef ENABLE_NEGOTIATION
1085  case NEG_RES_FMT_UNKNOWN:
1086  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (unknown data format of the output interface).");
1087  close(sockfd);
1088  return TRAP_E_TIMEOUT;
1089 
1090  case NEG_RES_CONT:
1091  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success.");
1092  return TRAP_E_OK;
1093 
1094  case NEG_RES_FMT_CHANGED: /* used on format change with JSON */
1095  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (format has changed; it was not first negotiation).");
1096  return TRAP_E_OK;
1097 
1098  case NEG_RES_RECEIVER_FMT_SUBSET: /* used on format change with UniRec */
1099  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (required set of fields of the input interface is subset of the recevied format).");
1100  return TRAP_E_OK;
1101 
1102  case NEG_RES_SENDER_FMT_SUBSET: /* used on format change with UniRec */
1103  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: success (new recevied format specifier is subset of the old one; it was not first negotiation).");
1104  return TRAP_E_OK;
1105 
1106  case NEG_RES_FAILED:
1107  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (error while receiving hello message from output interface).");
1109 
1110  case NEG_RES_FMT_MISMATCH:
1111  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: failed (data type or data format specifier mismatch).");
1112  return TRAP_E_FIELDS_MISMATCH;
1113 
1114  default:
1115  VERBOSE(CL_VERBOSE_LIBRARY, "Input_ifc_negotiation result: default case");
1116  break;
1117  }
1118 #endif
1119 
1120 
1121  return TRAP_E_OK;
1122 }
1123 
1124 /**
1125  * @}
1126  *//* tls_receiver */
1127 
1128 /**
1129  * \addtogroup tls_sender TLS Output IFC
1130  * @{
1131  */
1132 
1133 /**
1134  * \brief This function is called when a client was/is being disconnected.
1135  *
1136  * \param[in] priv Pointer to interface's private data structure.
1137  * \param[in] cl_id Index of the client in 'clients' array.
1138  */
1139 static inline void disconnect_client(tls_sender_private_t *priv, int cl_id)
1140 {
1141  int i;
1142  tlsclient_t *c = &priv->clients[cl_id];
1143 
1144  for (i = 0; i < priv->buffer_count; ++i) {
1145  del_index(&priv->buffers[i].clients_bit_arr, cl_id);
1146  if (priv->buffers[i].clients_bit_arr == 0) {
1147  pthread_cond_broadcast(&priv->cond_full_buffer);
1148  }
1149  }
1150  del_index(&priv->clients_bit_arr, cl_id);
1151  __sync_sub_and_fetch(&priv->connected_clients, 1);
1152 
1153  shutdown(c->sd, SHUT_RDWR);
1154  close(c->sd);
1155  SSL_free(c->ssl);
1156  c->sd = -1;
1157  c->ssl = NULL;
1158  c->pending_bytes = 0;
1159  c->sending_pointer = NULL;
1160 }
1161 
1162 /**
1163  * \brief Function disconnects all clients of the output interface whose private structure is passed via "priv" parameter.
1164  *
1165  * \param[in] priv Pointer to output interface private structure.
1166  */
1168 {
1169  uint32_t i;
1171 
1172  for (i = 0; i<c->clients_arr_size; i++) {
1173  if (c->clients[i].sd > 0) {
1174  disconnect_client(priv, i);
1175  }
1176  }
1177 }
1178 
1179 /**
1180  * Return current time in microseconds.
1181  *
1182  * This is used to get current timestamp in tls_sender_send().
1183  *
1184  * \return current timestamp
1185  */
1186 static inline uint64_t get_cur_timestamp()
1187 {
1188  struct timespec spec_time;
1189 
1190  clock_gettime(CLOCK_MONOTONIC, &spec_time);
1191  /* time in microseconds seconds -> secs * microsends + nanoseconds */
1192  return spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
1193 }
1194 
1195 /**
1196  * \brief This function runs in a separate thread and handles new client's connection requests.
1197  *
1198  * \param[in] arg Pointer to interface's private data structure.
1199  */
1200 static void *accept_clients_thread(void *arg)
1201 {
1202  char remoteIP[INET6_ADDRSTRLEN];
1203  struct sockaddr_storage remoteaddr; /* client address */
1204  struct tlsclient_s *cl;
1205  socklen_t addrlen;
1206  int newclient, fdmax;
1207  fd_set scset;
1209  int i;
1210  struct sockaddr *tmpaddr;
1211  uint32_t client_id = 0;
1212 
1213  /* handle new connections */
1214  addrlen = sizeof(remoteaddr);
1215  while (1) {
1216  if (c->is_terminated != 0) {
1217  break;
1218  }
1219  FD_ZERO(&scset);
1220  FD_SET(c->server_sd, &scset);
1221  fdmax = c->server_sd;
1222 
1223  if (select(fdmax + 1, &scset, NULL, NULL, NULL) == -1) {
1224  if (errno == EINTR) {
1225  if (c->is_terminated != 0) {
1226  break;
1227  }
1228  continue;
1229  } else {
1230  VERBOSE(CL_ERROR, "%s:%d unexpected error code %d", __func__, __LINE__, errno);
1231  }
1232  }
1233 
1234  if (FD_ISSET(c->server_sd, &scset)) {
1235  newclient = accept(c->server_sd, (struct sockaddr *) &remoteaddr, &addrlen);
1236  if (newclient == -1) {
1237  VERBOSE(CL_ERROR, "Accepting new client failed.");
1238  } else {
1239  tmpaddr = (struct sockaddr *) &remoteaddr;
1240  switch(((struct sockaddr *) tmpaddr)->sa_family) {
1241  case AF_INET:
1242  client_id = ntohs(((struct sockaddr_in *) tmpaddr)->sin_port);
1243  break;
1244  case AF_INET6:
1245  client_id = ntohs(((struct sockaddr_in6 *) tmpaddr)->sin6_port);
1246  break;
1247  }
1248  VERBOSE(CL_VERBOSE_ADVANCED, "New connection from %s on socket %d",
1249  inet_ntop(remoteaddr.ss_family, get_in_addr((struct sockaddr*) &remoteaddr), remoteIP, INET6_ADDRSTRLEN),
1250  newclient);
1251 
1252  if (c->connected_clients < c->clients_arr_size) {
1253  cl = NULL;
1254  for (i = 0; i < c->clients_arr_size; ++i) {
1255  if (c->clients[i].sd < 1) {
1256  cl = &c->clients[i];
1257  break;
1258  }
1259  }
1260  if (cl == NULL) {
1261  goto refuse_client;
1262  }
1263  cl->ssl = SSL_new(c->sslctx);
1264  if (cl->ssl == NULL) {
1265  VERBOSE(CL_ERROR, "Creating SSL structure failed: %s", ERR_reason_error_string(ERR_get_error()));
1266  goto refuse_client;
1267  }
1268  if (SSL_set_fd(cl->ssl, newclient) != 1) {
1269  VERBOSE(CL_ERROR, "Setting SSL file descriptor to tcp socket failed: %s",
1270  ERR_reason_error_string(ERR_get_error()));
1271  SSL_free(cl->ssl);
1272  cl->ssl = NULL;
1273  goto refuse_client;
1274  }
1275 
1276  if (SSL_accept(cl->ssl) <= 0) {
1277  ERR_print_errors_fp(stderr);
1278  SSL_free(cl->ssl);
1279  cl->ssl = NULL;
1280  goto refuse_client;
1281  }
1282 
1283  /** Verifying SSL certificate of client. */
1284  int ret_ver = verify_certificate(cl->ssl);
1285  if (ret_ver != 0){
1286  VERBOSE(CL_VERBOSE_LIBRARY, "verify_certificate: failed to verify client's certificate");
1287  goto refuse_client;
1288  }
1289 
1290  cl->sd = newclient;
1291  cl->sending_pointer = NULL;
1292  cl->pending_bytes = 0;
1293  cl->timer_total = 0;
1294  cl->id = client_id;
1295  cl->assigned_buffer = c->active_buffer;
1296  cl->timeouts = 0;
1297 
1298 #ifdef ENABLE_NEGOTIATION
1299  int ret_val = output_ifc_negotiation(c, TRAP_IFC_TYPE_TLS, i);
1300  if (ret_val == NEG_RES_OK) {
1301  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: success.");
1302  } else if (ret_val == NEG_RES_FMT_UNKNOWN) {
1303  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: failed (unknown data format of this output interface -> refuse client).");
1304  cl->sd = -1;
1305  goto refuse_client;
1306  } else { // ret_val == NEG_RES_FAILED, sending the data to input interface failed, refuse client
1307  VERBOSE(CL_VERBOSE_LIBRARY, "Output_ifc_negotiation result: failed (error while sending hello message to input interface).");
1308  cl->sd = -1;
1309  goto refuse_client;
1310  }
1311 #endif
1312 
1313  set_index(&c->clients_bit_arr, i);
1314  __sync_add_and_fetch(&c->connected_clients, 1);
1315  } else {
1316 refuse_client:
1317  VERBOSE(CL_VERBOSE_LIBRARY, "Shutting down client we do not have additional resources (%u/%u)",
1319  shutdown(newclient, SHUT_RDWR);
1320  close(newclient);
1321  }
1322  }
1323  }
1324  }
1325  pthread_exit(NULL);
1326 }
1327 
1328 /**
1329  * \brief Write buffer size to its header and shift active index.
1330  *
1331  * \param[in] priv Pointer to output interface private structure.
1332  * \param[in] buffer Pointer to the buffer.
1333  */
1334 static inline void finish_buffer(tls_sender_private_t *priv, buffer_t *buffer)
1335 {
1337 
1338  if (buffer->clients_bit_arr == 0 && buffer->wr_index != 0) {
1339  uint32_t header = htonl(buffer->wr_index);
1340  memcpy(buffer->header, &header, sizeof(header));
1341 
1342  priv->active_buffer = (priv->active_buffer + 1) % priv->buffer_count;
1343 
1344  buffer->clients_bit_arr = priv->clients_bit_arr;
1345  buffer->wr_index = 0;
1346  }
1347 
1348  pthread_mutex_lock(&priv->mtx_no_data);
1349  pthread_cond_broadcast(&priv->cond_no_data);
1350  pthread_mutex_unlock(&priv->mtx_no_data);
1351 }
1352 
1353 /**
1354  * \brief Force flush of active buffer
1355  *
1356  * \param[in] priv pointer to interface private data
1357  */
1358 void tls_sender_flush(void *priv)
1359 {
1362 
1363  pthread_mutex_lock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1364 
1365  buffer_t *buffer = &c->buffers[c->active_buffer];
1366  if (buffer->clients_bit_arr == 0 && buffer->wr_index != 0) {
1367  finish_buffer(c, buffer);
1368  __sync_add_and_fetch(&c->ctx->counter_autoflush[c->ifc_idx], 1);
1369  }
1370 
1371  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1372 }
1373 
1374 /**
1375  * \brief Send data to client from his assigned buffer.
1376  *
1377  * \param[in] priv Pointer to iterface's private data structure.
1378  * \param[in] c Pointer to the client's structure.
1379  * \param[in] cl_id Client's index in the 'clients' array.
1380  *
1381  * \return TRAP_E_OK successfully sent.
1382  * \return TRAP_E_TERMINATED TRAP was terminated.
1383  * \return TRAP_E_IO_ERROR send failed although TRAP was not terminated.
1384  */
1385 static inline int send_data(tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id)
1386 {
1387  int sent;
1388  /* Pointer to client's assigned buffer */
1389  buffer_t *buffer = &priv->buffers[c->assigned_buffer];
1390 
1391 again:
1392  sent = SSL_write(c->ssl, c->sending_pointer, c->pending_bytes);
1393 
1394  if (sent < 0) {
1395  /* Send failed */
1396  if (priv->is_terminated != 0) {
1397  return TRAP_E_TERMINATED;
1398  }
1399  switch (SSL_get_error(c->ssl, sent)) {
1400  case SSL_ERROR_ZERO_RETURN:
1401  case SSL_ERROR_SYSCALL:
1402  return TRAP_E_IO_ERROR;
1403  case SSL_ERROR_WANT_READ:
1404  case SSL_ERROR_WANT_WRITE:
1405  goto again;
1406  default:
1407  VERBOSE(CL_VERBOSE_OFF, "Unhandled error from ssl_write in send_data");
1408  return TRAP_E_IO_ERROR;
1409  }
1410  } else {
1411  c->pending_bytes -= sent;
1412  c->sending_pointer = (uint8_t *) c->sending_pointer + sent;
1413 
1414  /* Client received whole buffer */
1415  if (c->pending_bytes <= 0) {
1416  del_index(&buffer->clients_bit_arr, cl_id);
1417  if (buffer->clients_bit_arr == 0) {
1418  __sync_add_and_fetch(&priv->ctx->counter_send_buffer[priv->ifc_idx], 1);
1419  pthread_cond_broadcast(&priv->cond_full_buffer);
1420  }
1421 
1422  /* Assign client the next buffer in sequence */
1423  c->assigned_buffer = (c->assigned_buffer + 1) % priv->buffer_count;
1424  }
1425  }
1426  return TRAP_E_OK;
1427 }
1428 
1429 /**
1430  * \brief This function runs in a separate thread. It handles sending data
1431  to connected clients for TLS interface.
1432  * \param[in] priv pointer to interface private data
1433  */
1434 static void *sending_thread_func(void *priv)
1435 {
1436  uint32_t i, j;
1437  int res;
1438  int maxsd = -1;
1439  fd_set set, disset;
1440  tlsclient_t *cl;
1441  buffer_t *assigned_buffer;
1442  uint8_t buffer[DEFAULT_MAX_DATA_LENGTH];
1443  uint64_t send_entry_time;
1444  uint64_t send_exit_time;
1445  uint8_t waiting_clients;
1446  struct timeval select_timeout;
1447 
1449 
1450  while (1) {
1451  if (c->is_terminated != 0) {
1452  pthread_exit(NULL);
1453  }
1454  if (c->connected_clients == 0) {
1455  usleep(NO_CLIENTS_SLEEP);
1456  continue;
1457  }
1458 
1459  if ((get_cur_timestamp() - c->autoflush_timestamp) > c->ctx->out_ifc_list[c->ifc_idx].timeout) {
1460  tls_sender_flush(c);
1461  }
1462 
1463  FD_ZERO(&disset);
1464  FD_ZERO(&set);
1465  waiting_clients = 0;
1466  select_timeout.tv_sec = 1;
1467  select_timeout.tv_usec = 0;
1468 
1469  /* Add term_pipe for reading into the disconnect client set */
1470  FD_SET(c->term_pipe[0], &disset);
1471  if (maxsd < c->term_pipe[0]) {
1472  maxsd = c->term_pipe[0];
1473  }
1474 
1475  /* Check whether clients are connected and there is data for them to receive. */
1476  for (i = j = 0; i < c->clients_arr_size; ++i) {
1477  if (j == c->connected_clients) {
1478  break;
1479  }
1480 
1481  if (check_index(c->clients_bit_arr, i) == 0) {
1482  continue;
1483  }
1484 
1485  ++j;
1486 
1487  cl = &(c->clients[i]);
1488  assigned_buffer = &c->buffers[cl->assigned_buffer];
1489 
1490  if (cl->sd >= 0) {
1491  FD_SET(cl->sd, &disset);
1492  }
1493 
1494  if (maxsd < cl->sd) {
1495  maxsd = cl->sd;
1496  }
1497 
1498  if (check_index(assigned_buffer->clients_bit_arr, i) == 0) {
1499  ++waiting_clients;
1500  continue;
1501  }
1502 
1503  if (cl->pending_bytes <= 0) {
1504  cl->sending_pointer = assigned_buffer->header;
1505  cl->pending_bytes = ntohl(*((uint32_t *) assigned_buffer->header)) + sizeof(uint32_t);
1506  }
1507 
1508  if (cl->sd >= 0) {
1509  FD_SET(cl->sd, &set);
1510  }
1511  }
1512 
1513  if (waiting_clients == c->connected_clients) {
1514  pthread_mutex_lock(&c->mtx_no_data);
1515  pthread_cond_wait(&c->cond_no_data, &c->mtx_no_data);
1516  pthread_mutex_unlock(&c->mtx_no_data);
1517  continue;
1518  }
1519 
1520  res = select(maxsd + 1, &disset, &set, NULL, &select_timeout);
1521  if (res < 0) {
1522  /* Select returned with an error */
1523  if (c->is_terminated == 0) {
1524  switch (errno) {
1525  case EINTR:
1526  continue;
1527  default:
1528  VERBOSE(CL_ERROR, "Sending thread: unexpected error in select (errno: %i)", errno);
1529  pthread_exit(NULL);
1530  }
1531  } else {
1532  VERBOSE(CL_VERBOSE_ADVANCED, "Sending thread: terminating...");
1533  pthread_exit(NULL);
1534  }
1535  } else if (res == 0) {
1536  /* Select timed out - no client will be receiving */
1537  continue;
1538  }
1539 
1540  if (FD_ISSET(c->term_pipe[0], &disset)) {
1541  /* Sending was interrupted by terminate(), exit even from TRAP_WAIT function call. */
1542  VERBOSE(CL_VERBOSE_ADVANCED, "Sending was interrupted by terminate()");
1543  pthread_exit(NULL);
1544  }
1545 
1546  /* Check file descriptors. Disconnect "inactive" clients and send data to those designated by select */
1547  for (i = j = 0; i < c->clients_arr_size; ++i) {
1548  if (j == c->connected_clients) {
1549  break;
1550  }
1551 
1552  cl = &(c->clients[i]);
1553  if (cl->sd < 1) {
1554  continue;
1555  }
1556 
1557  ++j;
1558 
1559  /* Check if client is still connected */
1560  if (FD_ISSET(cl->sd, &disset)) {
1561  res = recv(cl->sd, buffer, DEFAULT_MAX_DATA_LENGTH, 0);
1562  if (res < 1) {
1563  disconnect_client(c, i);
1564  VERBOSE(CL_VERBOSE_LIBRARY, "Client %u disconnected", cl->id);
1565  continue;
1566  }
1567  }
1568 
1569  /* Check if client is ready for data */
1570  if (FD_ISSET(cl->sd, &set)) {
1571  send_entry_time = get_cur_timestamp();
1572  res = send_data(c, cl, i);
1573  send_exit_time = get_cur_timestamp();
1574 
1575  /* Measure how much time we spent sending to this client (in microseconds) */
1576  cl->timer_last = (send_exit_time - send_entry_time);
1577  cl->timer_total += cl->timer_last;
1578 
1579  if (res != TRAP_E_OK) {
1580  VERBOSE(CL_VERBOSE_OFF, "Disconnected client %d (ret val: %d)", cl->id, res);
1581  disconnect_client(c, i);
1582  }
1583  }
1584  }
1585  }
1586 }
1587 
1588 /**
1589  * \brief Store message into buffer.
1590  *
1591  * \param[in] priv pointer to module private data
1592  * \param[in] data pointer to data to write
1593  * \param[in] size size of data to write
1594  * \param[in] timeout maximum time spent waiting for the message to be stored [microseconds]
1595  *
1596  * \return TRAP_E_OK Success.
1597  * \return TRAP_E_TIMEOUT Message was not stored into buffer and the attempt should be repeated.
1598  * \return TRAP_E_TERMINATED Libtrap was terminated during the process.
1599  */
1600 int tls_sender_send(void *priv, const void *data, uint16_t size, int timeout)
1601 {
1602  int res, i;
1603  uint32_t free_bytes;
1604  struct timespec ts;
1605  buffer_t *buffer;
1606 
1608  uint8_t block = (timeout == TRAP_WAIT || (timeout == TRAP_HALFWAIT && c->connected_clients != 0)) ? 1 : 0;
1609 
1610  /* Can we put message at least into empty buffer? In the worst case, we could end up with SEGFAULT -> rather skip with error */
1611  if ((size + sizeof(size)) > c->buffer_size) {
1612  VERBOSE(CL_ERROR, "Buffer is too small for this message. Skipping...");
1613  goto timeout;
1614  }
1615 
1616  /* If timeout is wait or half wait, we need to set some valid timeout value (>= 0)*/
1617  if (timeout == TRAP_WAIT || timeout == TRAP_HALFWAIT) {
1618  timeout = 10000;
1619  }
1620 
1621 repeat:
1622  if (c->is_terminated != 0) {
1623  return TRAP_E_TERMINATED;
1624  }
1625  if (block && c->connected_clients == 0) {
1626  usleep(NO_CLIENTS_SLEEP);
1627  goto repeat;
1628  }
1629 
1630  pthread_mutex_lock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1631  buffer = &c->buffers[c->active_buffer];
1632  while (buffer->clients_bit_arr != 0) {
1633  clock_gettime(CLOCK_REALTIME, &ts);
1634 
1635  ts.tv_nsec += (ts.tv_sec * 1000000000L) + (timeout * 1000L);
1636  ts.tv_sec = (ts.tv_nsec / 1000000000L);
1637  ts.tv_nsec %= 1000000000L;
1638 
1639  /* Wait until woken up by sending thread or until timeout elapses */
1640  res = pthread_cond_timedwait(&c->cond_full_buffer, &c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx, &ts);
1641  switch (res) {
1642  case 0:
1643  /* Succesfully locked, buffer can be used */
1644  break;
1645  case ETIMEDOUT:
1646  /* Desired buffer is still full after timeout */
1647  if (block) {
1648  /* Blocking send, wait until buffer is free to use */
1649  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1650  goto repeat;
1651  } else {
1652  /* Non-blocking send, drop message or force buffer reset (not implemented) */
1653  goto timeout;
1654  }
1655  default:
1656  VERBOSE(CL_ERROR, "Unexpected error in pthread_mutex_timedlock()");
1657  goto timeout;
1658  }
1659  }
1660 
1661  /* Check if there is enough space in buffer */
1662  free_bytes = c->buffer_size - buffer->wr_index;
1663  if (free_bytes >= (size + sizeof(size))) {
1664  /* Store message into buffer */
1665  insert_into_buffer(buffer, data, size);
1666 
1667  /* If bufferswitch is 0, only 1 message is allowed to be stored in buffer */
1668  if (c->ctx->out_ifc_list[c->ifc_idx].bufferswitch == 0) {
1669  finish_buffer(c, buffer);
1670  }
1671 
1672  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1673  return TRAP_E_OK;
1674  } else {
1675  /* Not enough space for message, finish current buffer and try to store message into next buffer */
1676  finish_buffer(c, buffer);
1677  buffer = &c->buffers[c->active_buffer];
1678 
1679  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1680  goto repeat;
1681  }
1682 
1683 timeout:
1684  for (i = 0; i < c->clients_arr_size; i++) {
1685  if (c->clients[i].sd > 0 && c->clients[i].assigned_buffer == c->active_buffer) {
1686  c->clients[i].timeouts++;
1687  }
1688  }
1689  pthread_mutex_unlock(&c->ctx->out_ifc_list[c->ifc_idx].ifc_mtx);
1690  return TRAP_E_TIMEOUT;
1691 }
1692 
1693 /**
1694  * \brief Set interface state as terminated.
1695  * \param[in] priv pointer to module private data
1696  */
1697 void tls_sender_terminate(void *priv)
1698 {
1700 
1701  uint32_t i;
1702  uint64_t sum;
1703 
1704  /* Wait for connected clients to receive all finished buffers before terminating */
1705  if (c != NULL) {
1706  do {
1707  usleep(10000); //prevents busy waiting
1708  sum = 0;
1709  for (i = 0; i < c->buffer_count; i++) {
1710  sum |= c->buffers[i].clients_bit_arr;
1711  }
1712  } while (sum != 0);
1713 
1714  c->is_terminated = 1;
1715  close(c->term_pipe[1]);
1716  VERBOSE(CL_VERBOSE_LIBRARY, "Closed term_pipe, it should break select()");
1717  } else {
1718  VERBOSE(CL_ERROR, "Destroying IFC that is probably not initialized.");
1719  }
1720  return;
1721 }
1722 
1723 /**
1724  * \brief Destructor of TCP sender (output ifc)
1725  * \param[in] priv pointer to module private data
1726  */
1727 void tls_sender_destroy(void *priv)
1728 {
1730  void *res;
1731  int32_t i;
1732 
1733  /* free private data */
1734  if (c != NULL) {
1735  SSL_CTX_free(c->sslctx);
1736  free(c->server_port);
1737  free(c->keyfile);
1738  free(c->certfile);
1739  free(c->cafile);
1740 
1741  if (c->initialized) {
1742  pthread_cancel(c->send_thr);
1743  pthread_cancel(c->accept_thr);
1744  pthread_join(c->send_thr, &res);
1745  pthread_join(c->accept_thr, &res);
1746  }
1747 
1748  /* close server socket */
1749  close(c->server_sd);
1750 
1751  /* disconnect all clients */
1752  if (c->clients != NULL) {
1754  free(c->clients);
1755  }
1756 
1757  if (c->buffers != NULL) {
1758  for (i = 0; i < c->buffer_count; i++) {
1759  free(c->buffers[i].header);
1760  }
1761  free(c->buffers);
1762  }
1763 
1764  pthread_mutex_destroy(&c->mtx_no_data);
1765  pthread_cond_destroy(&c->cond_no_data);
1766  pthread_cond_destroy(&c->cond_full_buffer);
1767  free(c);
1768  }
1769 }
1770 
1771 int32_t tls_sender_get_client_count(void *priv)
1772 {
1774 
1775  if (c == NULL) {
1776  return 0;
1777  }
1778 
1779  return c->connected_clients;
1780 }
1781 
1782 int8_t tls_sender_get_client_stats_json(void* priv, json_t *client_stats_arr)
1783 {
1784  int i;
1785  json_t *client_stats = NULL;
1787 
1788  if (c == NULL) {
1789  return 0;
1790  }
1791 
1792  for (i = 0; i < c->clients_arr_size; ++i) {
1793  if (check_index(c->clients_bit_arr, i) == 0) {
1794  continue;
1795  }
1796 
1797  client_stats = json_pack("{sisisisi}", "id", c->clients[i].id, "timer_total", c->clients[i].timer_total, "timer_last", c->clients[i].timer_last, "timeouts", c->clients[i].timeouts);
1798  if (client_stats == NULL) {
1799  return 0;
1800  }
1801 
1802  if (json_array_append_new(client_stats_arr, client_stats) == -1) {
1803  return 0;
1804  }
1805  }
1806  return 1;
1807 }
1808 
1809 static void tls_sender_create_dump(void *priv, uint32_t idx, const char *path)
1810 {
1812  /* return value */
1813  int r;
1814  /* config file trap-i<number>-config.txt */
1815  char *conf_file = NULL;
1816  FILE *f = NULL;
1817  int32_t i;
1818  tlsclient_t *cl;
1819 
1820  r = asprintf(&conf_file, "%s/trap-o%02"PRIu32"-config.txt", path, idx);
1821  if (r == -1) {
1822  VERBOSE(CL_ERROR, "Not enough memory, dump failed. (%s:%d)", __FILE__, __LINE__);
1823  conf_file = NULL;
1824  goto exit;
1825  }
1826  f = fopen(conf_file, "w");
1827  fprintf(f, "Server port: %s\n"
1828  "Server socket descriptor: %d\n"
1829  "Connected clients: %d\n"
1830  "Max clients: %d\n"
1831  "Active buffer: %d\n"
1832  "Buffer count: %u\n"
1833  "Buffer size: %u\n"
1834  "Terminated: %d\n"
1835  "Initialized: %d\n"
1836  "Timeout: %u us\n",
1837  c->server_port,
1838  c->server_sd,
1839  c->connected_clients,
1840  c->clients_arr_size,
1841  c->active_buffer,
1842  c->buffer_size,
1843  c->buffer_size,
1844  c->is_terminated,
1845  c->initialized,
1846  c->ctx->out_ifc_list[idx].datatimeout);
1847  fprintf(f, "Clients:\n");
1848  for (i = 0; i < c->clients_arr_size; i++) {
1849  cl = &c->clients[i];
1850  fprintf(f, "\t{%d, %d, %p, %d}\n", cl->sd, cl->assigned_buffer, cl->sending_pointer, cl->pending_bytes);
1851  }
1852  fclose(f);
1853 exit:
1854  free(conf_file);
1855  return;
1856 }
1857 
1858 char *tls_send_ifc_get_id(void *priv)
1859 {
1860  if (priv == NULL) {
1861  return NULL;
1862  }
1863 
1864  tls_sender_private_t *config = (tls_sender_private_t *) priv;
1865  if (config->server_port == NULL) {
1866  return NULL;
1867  }
1868  return config->server_port;
1869 }
1870 
1871 /**
1872  * \brief Constructor of output TCP/IP IFC module.
1873  * This function is called by TRAP library to initialize one output interface.
1874  *
1875  * \param[in,out] ctx Pointer to the private libtrap context data (trap_ctx_init()).
1876  * \param[in] params Configuration string containing space separated values of these parameters (in this exact order): *server_port* *max_clients*,
1877  * where dest_addr is destination address of output TCP/IP IFC module and
1878  * dest_port is the port where sender is listening.
1879  * \param[in,out] ifc IFC interface used for calling TCP/IP module.
1880  * \param[in] idx Index of IFC that is created.
1881  * \return 0 on success (TRAP_E_OK)
1882  */
1883 int create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
1884 {
1885  int result = TRAP_E_OK;
1886  char *param_iterator = NULL;
1887  char *param_str = NULL;
1888  char *server_port = NULL;
1889  char *keyfile = NULL;
1890  char *certfile = NULL;
1891  char *cafile = NULL;
1892  tls_sender_private_t *priv = NULL;
1893  unsigned int max_clients = DEFAULT_MAX_CLIENTS;
1894  unsigned int buffer_count = DEFAULT_BUFFER_COUNT;
1895  unsigned int buffer_size = DEFAULT_BUFFER_SIZE;
1896  uint32_t i;
1897 
1898 #define X(pointer) free(pointer); \
1899  pointer = NULL;
1900 
1901  /* Check parameters */
1902  if (params == NULL) {
1903  VERBOSE(CL_ERROR, "IFC requires at least three parameters (port:keyfile:certfile).");
1904  return TRAP_E_BADPARAMS;
1905  }
1906 
1907  /* Create structure to store private data */
1908  priv = (tls_sender_private_t *) calloc(1, sizeof(tls_sender_private_t));
1909  if (priv == NULL) {
1910  result = TRAP_E_MEMORY;
1911  goto failsafe_cleanup;
1912  }
1913 
1914  /* Parsing params */
1915  param_iterator = trap_get_param_by_delimiter(params, &server_port, TRAP_IFC_PARAM_DELIMITER);
1916  if ((server_port == NULL) || (strlen(server_port) == 0)) {
1917  VERBOSE(CL_ERROR, "Missing 'port' for TLS IFC.");
1918  result = TRAP_E_BADPARAMS;
1919  goto failsafe_cleanup;
1920  }
1921  if (param_iterator != NULL) {
1922  param_iterator = trap_get_param_by_delimiter(param_iterator, &keyfile, TRAP_IFC_PARAM_DELIMITER);
1923  } else {
1924  VERBOSE(CL_ERROR, "Missing 'keyfile', 'certfile' and trusted 'CAfile' for TLS IFC.");
1925  result = TRAP_E_BADPARAMS;
1926  goto failsafe_cleanup;
1927  }
1928  if (param_iterator != NULL) {
1929  param_iterator = trap_get_param_by_delimiter(param_iterator, &certfile, TRAP_IFC_PARAM_DELIMITER);
1930  } else {
1931  VERBOSE(CL_ERROR, "Missing 'certfile' and trusted 'CAfile' for TLS IFC.");
1932  result = TRAP_E_BADPARAMS;
1933  goto failsafe_cleanup;
1934  }
1935  if (param_iterator != NULL) {
1936  param_iterator = trap_get_param_by_delimiter(param_iterator, &cafile, TRAP_IFC_PARAM_DELIMITER);
1937  } else {
1938  VERBOSE(CL_ERROR, "Missing trusted 'CAfile' for TLS IFC.");
1939  result = TRAP_E_BADPARAMS;
1940  goto failsafe_cleanup;
1941  }
1942 
1943  /* Optional params */
1944  while (param_iterator != NULL) {
1945  param_iterator = trap_get_param_by_delimiter(param_iterator, &param_str, TRAP_IFC_PARAM_DELIMITER);
1946  if (param_str == NULL)
1947  continue;
1948  if (strncmp(param_str, "buffer_count=x", BUFFER_COUNT_PARAM_LENGTH) == 0) {
1949  if (sscanf(param_str + BUFFER_COUNT_PARAM_LENGTH, "%u", &buffer_count) != 1) {
1950  VERBOSE(CL_ERROR, "Optional buffer count given, but it is probably in wrong format.");
1951  buffer_count = DEFAULT_BUFFER_COUNT;
1952  }
1953  } else if (strncmp(param_str, "buffer_size=x", BUFFER_SIZE_PARAM_LENGTH) == 0) {
1954  if (sscanf(param_str + BUFFER_SIZE_PARAM_LENGTH, "%u", &buffer_size) != 1) {
1955  VERBOSE(CL_ERROR, "Optional buffer size given, but it is probably in wrong format.");
1956  buffer_size = DEFAULT_BUFFER_SIZE;
1957  }
1958  } else if (strncmp(param_str, "max_clients=x", MAX_CLIENTS_PARAM_LENGTH) == 0) {
1959  if (sscanf(param_str + MAX_CLIENTS_PARAM_LENGTH, "%u", &max_clients) != 1) {
1960  VERBOSE(CL_ERROR, "Optional max clients number given, but it is probably in wrong format.");
1961  max_clients = DEFAULT_MAX_CLIENTS;
1962  }
1963  } else {
1964  VERBOSE(CL_ERROR, "Unknown parameter \"%s\".", param_str);
1965  }
1966  X(param_str);
1967  }
1968  /* Parsing params ended */
1969 
1970  priv->buffers = calloc(buffer_count, sizeof(buffer_t));
1971  if (priv->buffers == NULL) {
1972  /* if some memory could not have been allocated, we cannot continue */
1973  goto failsafe_cleanup;
1974  }
1975  for (i = 0; i < buffer_count; ++i) {
1976  buffer_t *b = &(priv->buffers[i]);
1977 
1978  b->header = malloc(buffer_size + sizeof(buffer_size));
1979  b->data = b->header + sizeof(buffer_size);
1980  b->wr_index = 0;
1981  b->clients_bit_arr = 0;
1982  }
1983 
1984  priv->clients = calloc(max_clients, sizeof(tlsclient_t));
1985  if (priv->clients == NULL) {
1986  /* if some memory could not have been allocated, we cannot continue */
1987  goto failsafe_cleanup;
1988  }
1989  for (i = 0; i < max_clients; ++i) {
1990  tlsclient_t *client = &(priv->clients[i]);
1991 
1992  client->assigned_buffer = 0;
1993  client->sd = -1;
1994  client->timer_total = 0;
1995  client->pending_bytes = 0;
1996  client->sending_pointer = NULL;
1997  }
1998 
1999  priv->keyfile = keyfile;
2000  priv->certfile = certfile;
2001  priv->cafile = cafile;
2002  priv->ctx = ctx;
2003  priv->ifc_idx = idx;
2004  priv->server_port = server_port;
2005  priv->buffer_size = buffer_size;
2006  priv->buffer_count = buffer_count;
2007  priv->clients_arr_size = max_clients;
2008  priv->clients_bit_arr = 0;
2009  priv->connected_clients = 0;
2010  priv->is_terminated = 0;
2011  priv->active_buffer = 0;
2013 
2014  pthread_mutex_init(&priv->mtx_no_data, NULL);
2015  pthread_cond_init(&priv->cond_no_data, NULL);
2016  pthread_cond_init(&priv->cond_full_buffer, NULL);
2017 
2018  VERBOSE(CL_VERBOSE_ADVANCED, "config:\nserver_port:\t%s\nmax_clients:\t%u\nbuffer count:\t%u\nbuffer size:\t%uB\n",
2019  priv->server_port, priv->clients_arr_size,priv->buffer_count, priv->buffer_size);
2020 
2021  result = server_socket_open(priv);
2022  if (result != TRAP_E_OK) {
2023  VERBOSE(CL_ERROR, "Socket could not be opened on given port '%s'.", server_port);
2024  goto failsafe_cleanup;
2025  }
2026 
2027  if (pipe(priv->term_pipe) != 0) {
2028  VERBOSE(CL_ERROR, "Opening of pipe failed. Using stdin as a fall back.");
2029  priv->term_pipe[0] = 0;
2030  }
2031 
2032  priv->sslctx = tlsserver_create_context();
2033  if (priv->sslctx == NULL) {
2034  result = TRAP_E_MEMORY;
2035  goto failsafe_cleanup;
2036  }
2037 
2038  if (tls_server_configure_ctx(priv->certfile, priv->sslctx) != 0) {
2039  VERBOSE(CL_ERROR, "Configuring server context failed.");
2040  goto failsafe_cleanup;
2041  }
2042 
2043  if (tls_configure_ctx(priv->sslctx, keyfile, certfile, cafile) == EXIT_FAILURE) {
2044  result = TRAP_E_BADPARAMS;
2045  goto failsafe_cleanup;
2046  }
2047 
2048  /* Fill struct defining the interface */
2050  ifc->send = tls_sender_send;
2051  ifc->flush = tls_sender_flush;
2053  ifc->destroy = tls_sender_destroy;
2057  ifc->priv = priv;
2058  ifc->get_id = tls_send_ifc_get_id;
2059  return result;
2060 
2061 failsafe_cleanup:
2062  X(server_port);
2063  X(param_str);
2064  X(certfile);
2065  X(cafile);
2066  X(keyfile);
2067  if (priv != NULL) {
2068  if (priv->buffers != NULL) {
2069  for (i = 0; i < priv->buffer_count; i++) {
2070  X(priv->buffers[i].header);
2071  }
2072  X(priv->buffers)
2073  }
2074  if (priv->clients != NULL) {
2075  X(priv->clients);
2076  }
2077  pthread_mutex_destroy(&priv->mtx_no_data);
2078  pthread_cond_destroy(&priv->cond_no_data);
2079  pthread_cond_destroy(&priv->cond_full_buffer);
2080  X(priv);
2081  }
2082 #undef X
2083  return result;
2084 }
2085 
2086 /**
2087  * \brief Open TLS socket for sender module
2088  * \param[in] priv tls_sender_private_t structure (private data)
2089  * \return 0 on success (TRAP_E_OK), TRAP_E_IO_ERROR on error
2090  */
2091 static int server_socket_open(void *priv)
2092 {
2093  int yes = 1; /* for setsockopt() SO_REUSEADDR, below */
2094  int rv;
2095 
2096  union tls_socket_addr addr;
2097  struct addrinfo *ai, *p = NULL;
2099  if (c->server_port == NULL) {
2100  return TRAP_E_BAD_FPARAMS;
2101  }
2102 
2103  memset(&addr, 0, sizeof(addr));
2104 
2105  /* get us a socket and bind it */
2106  addr.tls_addr.ai_family = AF_UNSPEC;
2107  addr.tls_addr.ai_socktype = SOCK_STREAM;
2108  addr.tls_addr.ai_flags = AI_PASSIVE;
2109  if ((rv = getaddrinfo(NULL, c->server_port, &addr.tls_addr, &ai)) != 0) {
2110  return trap_errorf(c->ctx, TRAP_E_IO_ERROR, "selectserver: %s\n", gai_strerror(rv));
2111  }
2112 
2113  for (p = ai; p != NULL; p = p->ai_next) {
2114  c->server_sd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
2115  if (c->server_sd < 0) {
2116  continue;
2117  }
2118 
2119  /* lose the pesky "address already in use" error message */
2120  if (setsockopt(c->server_sd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
2121  VERBOSE(CL_ERROR, "Failed to set socket to reuse address. (%d)", errno);
2122  }
2123 
2124  if (bind(c->server_sd, p->ai_addr, p->ai_addrlen) < 0) {
2125  close(c->server_sd);
2126  continue;
2127  }
2128  break; /* found socket to bind */
2129  }
2130  freeaddrinfo(ai);
2131 
2132  if (p == NULL) {
2133  /* if we got here, it means we didn't get bound */
2134  VERBOSE(CL_VERBOSE_LIBRARY, "selectserver: failed to bind");
2135  return TRAP_E_IO_ERROR;
2136  }
2137 
2138  /* listen */
2139  if (listen(c->server_sd, c->clients_arr_size) == -1) {
2140  VERBOSE(CL_ERROR, "Listen failed");
2141  return TRAP_E_IO_ERROR;
2142  }
2143 
2144  if (pthread_create(&c->send_thr, NULL, sending_thread_func, priv) != 0) {
2145  VERBOSE(CL_ERROR, "Failed to create sending thread.");
2146  return TRAP_E_IO_ERROR;
2147  }
2148 
2149  if (pthread_create(&c->accept_thr, NULL, accept_clients_thread, priv) != 0) {
2150  VERBOSE(CL_ERROR, "Failed to create accept_thread.");
2151  return TRAP_E_IO_ERROR;
2152  }
2153 
2154  c->initialized = 1;
2155  return 0;
2156 }
2157 
2158 /**
2159  * @}
2160  *//* tls_sender */
2161 
2162 
2163 /**
2164  * @}
2165  *//* tls_ifc module */
2166 
2167 /**
2168  * @}
2169  *//* ifc modules */
uint64_t timer_total
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+ + + + +
uint8_t * data
+
#define BUFFER_SIZE_PARAM_LENGTH
+
static uint64_t get_cur_timestamp()
Definition: ifc_tls.c:1186
+
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+ + + +
int create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tls.c:738
+
static SSL_CTX * tlsserver_create_context()
Definition: ifc_tls.c:102
+
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
Definition: trap.c:1160
+
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
pthread_cond_t cond_full_buffer
+ +
#define NEG_RES_SENDER_FMT_SUBSET
If the data format of input and output interfaces is the same and new data specifier of the output in...
Definition: trap_internal.h:76
+
static void tls_sender_create_dump(void *priv, uint32_t idx, const char *path)
Definition: ifc_tls.c:1809
+
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+ + + +
uint32_t wr_index
+
Output buffer structure.
+
#define TRAP_IFC_PARAM_DELIMITER
Definition: trap.h:165
+ +
static int receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm)
Definition: ifc_tls.c:286
+
static void * accept_clients_thread(void *arg)
This function runs in a separate thread and handles new client&#39;s connection requests.
Definition: ifc_tls.c:1200
+
void tls_receiver_terminate(void *priv)
Set interface state as terminated.
Definition: ifc_tls.c:606
+
struct trap_buffer_header_s trap_buffer_header_t
+ +
uint32_t pending_bytes
+
static int tls_configure_ctx(SSL_CTX *ctx, const char *key, const char *crt, const char *ca)
Configure ssl context of new connection.
Definition: ifc_tls.c:210
+ +
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:246
+ + +
#define NEG_RES_FAILED
If receiving the data from output interface fails or sending the data to input interface fails...
Definition: trap_internal.h:84
+ +
void tls_sender_destroy(void *priv)
Destructor of TCP sender (output ifc)
Definition: ifc_tls.c:1727
+ + +
pthread_cond_t cond_no_data
+
void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1211
+
static void disconnect_client(tls_sender_private_t *priv, int cl_id)
This function is called when a client was/is being disconnected.
Definition: ifc_tls.c:1139
+ +
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
#define TRAP_TIMEOUT_STR(t)
Definition: trap.h:132
+ +
static int wait_for_connection(int sock, struct timeval *tv)
Definition: ifc_tls.c:912
+
#define TRAP_E_FIELDS_MISMATCH
Returned when receiver fields are not subset of sender fields.
Definition: trap.h:98
+ +
Structure for TLS IFC private information.
+ + + +
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
Definition: trap.c:2833
+
static void insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size)
Definition: ifc_file.c:647
+
static void set_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 1.
+
trap_ctx_priv_t * ctx
+
void tls_server_disconnect_all_clients(void *priv)
Function disconnects all clients of the output interface whose private structure is passed via "priv"...
Definition: ifc_tls.c:1167
+
void tls_receiver_destroy(void *priv)
Destructor of TLS receiver (input ifc)
Definition: ifc_tls.c:622
+ + +
#define X(pointer)
+
static void del_index(uint64_t *bits, int i)
Set i-th element (one bit) of &#39;bits&#39; to 0.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+ +
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
#define TRAP_HALFWAIT
Definition: trap.h:130
+
static void client_socket_disconnect(void *priv)
Definition: ifc_tls.c:892
+
#define TRAP_E_IO_ERROR
IO Error.
Definition: trap.h:93
+ +
#define NEG_RES_FMT_CHANGED
If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) ...
Definition: trap_internal.h:78
+
#define VERBOSE(level, format, args...)
+
TRAP TCP/IP interfaces private structures.
+
struct sockaddr_un unix_addr
used for path of UNIX socket
Definition: ifc_tls.c:251
+
static int verify_certificate(SSL *arg)
Verify context of ssl.
Definition: ifc_tls.c:147
+ +
int tls_receiver_recv(void *priv, void *data, uint32_t *size, int timeout)
Receive data from interface.
Definition: ifc_tls.c:395
+
trap_ctx_priv_t * ctx
+
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
Definition: trap_error.h:92
+ +
uint8_t data[0]
+
int create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tls.c:1883
+ +
void tls_sender_flush(void *priv)
Force flush of active buffer.
Definition: ifc_tls.c:1358
+
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
#define NEG_RES_CONT
If the data format and data specifier of input and output interface are the same (input interface can...
Definition: trap_internal.h:74
+
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
Definition: trap_ifc.h:237
+ +
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+
#define TRAP_E_BAD_FPARAMS
Bad parameters of function.
Definition: trap.h:92
+
static int server_socket_open(void *priv)
Open TLS socket for sender module.
Definition: ifc_tls.c:2091
+
static int tls_server_configure_ctx(const char *cert, SSL_CTX *ctx)
Configure context of ssl server.
Definition: ifc_tls.c:175
+ + +
uint8_t tls_recv_ifc_is_conn(void *priv)
Definition: ifc_tls.c:714
+
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
Definition: trap_ifc.h:250
+ +
struct addrinfo tls_addr
used for TCPIP socket
Definition: ifc_tls.c:250
+ + +
#define DEFAULT_BUFFER_SIZE
+
#define DEBUG_IFC(X)
+ +
static uint64_t check_index(uint64_t bits, int i)
Return value of i-th element (one bit) in the &#39;bits&#39; array.
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
int32_t datatimeout
Timeout for *_send() calls.
Definition: trap_ifc.h:248
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
Structure for TLS IFC client information.
+
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+
int32_t datatimeout
Timeout for *_recv() calls.
Definition: trap_ifc.h:191
+
void * sending_pointer
+
#define NEG_RES_FMT_UNKNOWN
If the output interface has not specified data format.
Definition: trap_internal.h:85
+
#define TRAP_IFC_TYPE_TLS
trap_ifc_tls (input&output part)
Definition: trap.h:174
+ + +
#define DEFAULT_MAX_CLIENTS
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define NEG_RES_FMT_MISMATCH
If the data format or data specifier of input and output interfaces does not match.
Definition: trap_internal.h:77
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
#define DEFAULT_BUFFER_COUNT
+ +
uint8_t * header
+
Error handling for TRAP.
+
#define TRAP_E_MEMORY
Memory allocation error.
Definition: trap.h:104
+
int8_t tls_sender_get_client_stats_json(void *priv, json_t *client_stats_arr)
Definition: ifc_tls.c:1782
+
#define NEG_RES_OK
Signaling success (hello message successfully sent to input interface)
Definition: trap_internal.h:81
+
int tls_sender_send(void *priv, const void *data, uint16_t size, int timeout)
Store message into buffer.
Definition: ifc_tls.c:1600
+
uint32_t timer_last
+
static void finish_buffer(tls_sender_private_t *priv, buffer_t *buffer)
Write buffer size to its header and shift active index.
Definition: ifc_tls.c:1334
+
static void * get_in_addr(struct sockaddr *sa)
Get sockaddr, IPv4 or IPv6.
Definition: ifc_tls.c:263
+
#define MAX_RECOVERY_TRY
Definition: ifc_tls.c:89
+
int32_t tls_sender_get_client_count(void *priv)
Definition: ifc_tls.c:1771
+
#define TRAP_E_BAD_CERT
Wrong certificate given to TLS interface.
Definition: trap.h:96
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls)...
+
uint64_t clients_bit_arr
+
static int send_data(tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id)
Send data to client from his assigned buffer.
Definition: ifc_tls.c:1385
+ +
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
static SSL_CTX * tlsclient_create_context()
Definition: ifc_tls.c:125
+
uint32_t assigned_buffer
+ +
uint64_t * counter_autoflush
+
#define NEG_RES_RECEIVER_FMT_SUBSET
If the data format of input and output interfaces is the same and data specifier of the input interfa...
Definition: trap_internal.h:75
+
static void * sending_thread_func(void *priv)
This function runs in a separate thread. It handles sending data to connected clients for TLS interfa...
Definition: ifc_tls.c:1434
+ +
void tls_sender_terminate(void *priv)
Set interface state as terminated.
Definition: ifc_tls.c:1697
+
#define DEFAULT_MAX_DATA_LENGTH
+ + +
static int client_socket_connect(tls_receiver_private_t *priv, struct timeval *tv)
client_socket is used as a receiver
Definition: ifc_tls.c:941
+ +
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
uint64_t timeouts
+
trap_buffer_header_t int_mess_header
+
char * tls_send_ifc_get_id(void *priv)
Definition: ifc_tls.c:1858
+
#define TRAP_WAIT
Definition: trap.h:124
+ +
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
static void tls_receiver_create_dump(void *priv, uint32_t idx, const char *path)
Definition: ifc_tls.c:643
+
uint64_t * counter_send_buffer
+
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
Definition: trap.c:2995
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
pthread_mutex_t mtx_no_data
+
trap_output_ifc_t * out_ifc_list
+ +
char * tls_recv_ifc_get_id(void *priv)
Definition: ifc_tls.c:701
+
#define MAX_CLIENTS_PARAM_LENGTH
+
Interface of TRAP interfaces.
+
#define BUFFER_COUNT_PARAM_LENGTH
+ +
trap_input_ifc_t * in_ifc_list
+
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
Definition: trap.h:90
+ +
#define NO_CLIENTS_SLEEP
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls_8h.html b/doc/libtrap-devel/ifc__tls_8h.html new file mode 100644 index 00000000..85b8323c --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h.html @@ -0,0 +1,136 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tls.h File Reference
+
+
+
#include "trap_ifc.h"
+
+Include dependency graph for ifc_tls.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + +

+Macros

#define TLS_PARAMS_DELIMITER   (',')
 
+ + + + + + + +

+Functions

int create_tls_sender_ifc (trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
 Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one output interface. More...
 
int create_tls_receiver_ifc (trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one input interface. More...
 
+

Macro Definition Documentation

+ +

◆ TLS_PARAMS_DELIMITER

+ +
+
+ + + + +
#define TLS_PARAMS_DELIMITER   (',')
+
+

Delimiter used between params in the create_tls_sender_ifc and create_tls_receiver_ifc functions.

+ +

Definition at line 52 of file ifc_tls.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls_8h__dep__incl.map b/doc/libtrap-devel/ifc__tls_8h__dep__incl.map new file mode 100644 index 00000000..4ad771c0 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tls_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__tls_8h__dep__incl.md5 new file mode 100644 index 00000000..09e338bd --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h__dep__incl.md5 @@ -0,0 +1 @@ +aaac5ee0ba2788d069817a36478309bb \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tls_8h__dep__incl.png b/doc/libtrap-devel/ifc__tls_8h__dep__incl.png new file mode 100644 index 00000000..d64c9c0e Binary files /dev/null and b/doc/libtrap-devel/ifc__tls_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__tls_8h__incl.map b/doc/libtrap-devel/ifc__tls_8h__incl.map new file mode 100644 index 00000000..b2c4a64c --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tls_8h__incl.md5 b/doc/libtrap-devel/ifc__tls_8h__incl.md5 new file mode 100644 index 00000000..a12ae55d --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h__incl.md5 @@ -0,0 +1 @@ +482eebcf756772ae3948a7127dedcd0e \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tls_8h__incl.png b/doc/libtrap-devel/ifc__tls_8h__incl.png new file mode 100644 index 00000000..7085a2c3 Binary files /dev/null and b/doc/libtrap-devel/ifc__tls_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__tls_8h_source.html b/doc/libtrap-devel/ifc__tls_8h_source.html new file mode 100644 index 00000000..058bf28e --- /dev/null +++ b/doc/libtrap-devel/ifc__tls_8h_source.html @@ -0,0 +1,87 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tls.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tcpip.h
3  * \brief TRAP TCP/IP interfaces
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2013
6  * \date 2014
7  */
8 /*
9  * Copyright (C) 2013,2014 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 #ifndef _TRAP_IFC_TLS_H_
45 #define _TRAP_IFC_TLS_H_
46 
47 #include "trap_ifc.h"
48 
49 /**
50  * Delimiter used between *params* in the *create_tls_sender_ifc* and *create_tls_receiver_ifc* functions.
51  */
52 #define TLS_PARAMS_DELIMITER (',')
53 
54 /** Create TLS output interface.
55  * \param [in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
56  * \param [in] params format not decided yet
57  * \param [out] ifc Created interface for library purposes
58  * \param [in] idx Index of the IFC
59  * \return 0 on success (TRAP_E_OK)
60  */
61 int create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx);
62 
63 
64 /** Create TLS input interface.
65  * \param [in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
66  * \param [in] params format not decided yet
67  * \param [out] ifc Created interface for library purposes
68  * \param [in] idx Index of the IFC
69  * \return 0 on success (TRAP_E_OK)
70  */
71 int create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx);
72 
73 #endif
int create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tls.c:738
+ + +
int create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tls.c:1883
+ +
Interface of TRAP interfaces.
+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls__internal_8h.html b/doc/libtrap-devel/ifc__tls__internal_8h.html new file mode 100644 index 00000000..1d8e290f --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h.html @@ -0,0 +1,137 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls_internal.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
ifc_tls_internal.h File Reference
+
+
+ +

TRAP TCP/IP interfaces private structures. +More...

+
#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include "ifc_socket_common.h"
+
+Include dependency graph for ifc_tls_internal.h:
+
+
+ + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + + + + + + + +

+Data Structures

struct  tlsclient_s
 Structure for TLS IFC client information. More...
 
struct  tls_sender_private_s
 Structure for TLS IFC private information. More...
 
struct  tls_receiver_private_s
 
+ + + + + + + + + +

+Typedefs

typedef struct tlsclient_s tlsclient_t
 Structure for TLS IFC client information. More...
 
typedef struct tls_sender_private_s tls_sender_private_t
 Structure for TLS IFC private information. More...
 
typedef struct tls_receiver_private_s tls_receiver_private_t
 
+

Detailed Description

+

TRAP TCP/IP interfaces private structures.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2014
+ +

Definition in file ifc_tls_internal.h.

+
+ + + + diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.map b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.map new file mode 100644 index 00000000..d6af1ca8 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.md5 b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.md5 new file mode 100644 index 00000000..866130f0 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.md5 @@ -0,0 +1 @@ +a22d583c5e53796ff63c47b578961ad4 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.png b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.png new file mode 100644 index 00000000..e5a6616f Binary files /dev/null and b/doc/libtrap-devel/ifc__tls__internal_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__incl.map b/doc/libtrap-devel/ifc__tls__internal_8h__incl.map new file mode 100644 index 00000000..574db978 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__incl.md5 b/doc/libtrap-devel/ifc__tls__internal_8h__incl.md5 new file mode 100644 index 00000000..7668ea43 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h__incl.md5 @@ -0,0 +1 @@ +987af48d8fea50417b8d1b4dca980601 \ No newline at end of file diff --git a/doc/libtrap-devel/ifc__tls__internal_8h__incl.png b/doc/libtrap-devel/ifc__tls__internal_8h__incl.png new file mode 100644 index 00000000..dfb0d249 Binary files /dev/null and b/doc/libtrap-devel/ifc__tls__internal_8h__incl.png differ diff --git a/doc/libtrap-devel/ifc__tls__internal_8h_source.html b/doc/libtrap-devel/ifc__tls__internal_8h_source.html new file mode 100644 index 00000000..184d8b14 --- /dev/null +++ b/doc/libtrap-devel/ifc__tls__internal_8h_source.html @@ -0,0 +1,142 @@ + + + + + + + +Libtrap: Internal development docs: src/ifc_tls_internal.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
ifc_tls_internal.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file ifc_tls_internal.h
3  * \brief TRAP TCP/IP interfaces private structures
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2014
6  */
7 /*
8  * Copyright (C) 2013 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 
45 #include <openssl/ssl.h>
46 #include <openssl/err.h>
47 
48 #include "ifc_socket_common.h"
49 
50 
51 /** \addtogroup trap_ifc
52  * @{
53  */
54 
55 /** \addtogroup tls_ifc
56  * @{
57  */
58 
59  /**
60  * \defgroup tls_sender TLS Output IFC
61  * @{
62  */
63 
64 /**
65  * \brief Structure for TLS IFC client information.
66  */
67 typedef struct tlsclient_s {
68  SSL *ssl; /**< Client SSL info. */
69 
70  int sd; /**< Client socket descriptor */
71  void *sending_pointer; /**< Pointer to data in client's assigned buffer */
72 
73  uint64_t timer_total; /**< Total time spent sending (microseconds) since client connection */
74  uint64_t timeouts; /**< Number of messages dropped (since connection) due to client blocking active buffer */
75 
76  uint32_t timer_last; /**< Time spent on last send call [microseconds] */
77  uint32_t pending_bytes; /**< The size of data that must be sent */
78  uint32_t id; /**< Client identification - PID for unix socket, port number for TCP socket */
79  uint32_t assigned_buffer; /**< Index of assigned buffer in array of buffers */
80 } tlsclient_t;
81 
82 /**
83  * \brief Structure for TLS IFC private information.
84  */
85 typedef struct tls_sender_private_s {
86  trap_ctx_priv_t *ctx; /**< Libtrap context */
87 
88  SSL_CTX *sslctx; /**< Server SSL context. */
89 
90  char *keyfile; /**< Path to private key file in PEM format. */
91  char *certfile; /**< Path to certificate in PEM format. */
92  char *cafile; /**< Path to trusted CAs (can be chain file) file in PEM format. */
93 
94  int term_pipe[2]; /**< File descriptor pair for select() termination */
95  int server_sd; /**< Server socket descriptor */
96 
97  char *server_port; /**< TCPIP port number / UNIX socket path */
98  char is_terminated; /**< Termination flag */
99  char initialized; /**< Initialization flag */
100 
101  uint64_t autoflush_timestamp; /**< Time when the last buffer was finished - used for autoflush */
102  uint64_t clients_bit_arr; /**< Bit array of currently connected clients - lowest bit = index 0, highest bit = index 63 */
103 
104  uint32_t ifc_idx; /**< Index of interface in 'out_ifc_list' array */
105  uint32_t connected_clients; /**< Number of currently connected clients */
106  uint32_t clients_arr_size; /**< Maximum number of clients */
107  uint32_t buffer_count; /**< Number of buffers used */
108  uint32_t buffer_size; /**< Buffer size [bytes] */
109  uint32_t active_buffer; /**< Index of active buffer in 'buffers' array */
110 
111  buffer_t *buffers; /**< Array of buffer structures */
112  tlsclient_t *clients; /**< Array of client structures */
113 
114  pthread_t accept_thr; /**< Pthread structure containing info about accept thread */
115  pthread_t send_thr; /**< Pthread structure containing info about sending thread */
116 
117  pthread_mutex_t mtx_no_data; /**< Mutex for cond_no_data */
118  pthread_cond_t cond_no_data; /**< Condition struct used when waiting for new data */
119  pthread_cond_t cond_full_buffer; /**< Condition struct used when waiting for free buffer */
121 
122 /**
123  * @}
124  */
125 
126 /**
127  * \defgroup tls_receiver TLS Input IFC
128  * @{
129  */
130 typedef struct tls_receiver_private_s {
131  trap_ctx_priv_t *ctx; /**< Libtrap context */
132  char *dest_addr; /**< Destination address */
133  char *dest_port; /**< Destination port */
134 
135  char *keyfile; /**< Path to private key file in PEM format. */
136  char *certfile; /**< Path to certificate in PEM format. */
137  char *cafile; /**< Path to trusted CAs (can be chain file) file in PEM format. */
138 
139  SSL_CTX *sslctx; /**< Whole client SSL context. */
140  SSL *ssl; /**< SSL conection info of client */
141 
142  char connected; /**< Indicates whether client is connected to server. */
143  char is_terminated; /**< Indicates whether client should be destroyed. */
144  int sd; /**< Socket descriptor */
145  void *data_pointer; /**< Pointer to next free byte, if NULL, we ended in header */
146  uint32_t data_wait_size; /** Missing data to accept in the next function call */
147  void *ext_buffer; /**< Pointer to buffer that was passed by higher layer - this is the place we write */
148  uint32_t ext_buffer_size; /** size of content of the extbuffer */
149  trap_buffer_header_t int_mess_header; /**< Internal message header - used for message_buffer payload size \note message_buffer size is sizeof(tls_tdu_header_t) + payload size */
150  uint32_t ifc_idx; /**< Index of IFC */
152 
153 /**
154  * @}
155  */
156 
157 /**
158  * @}
159  */
160 
161 /**
162  * @}
163  */
164 
uint64_t timer_total
+ + + + + +
pthread_cond_t cond_full_buffer
+ +
struct tls_sender_private_s tls_sender_private_t
Structure for TLS IFC private information.
+ + + +
Output buffer structure.
+ +
uint32_t pending_bytes
+ + + +
struct tls_receiver_private_s tls_receiver_private_t
+ +
pthread_cond_t cond_no_data
+ + + +
Structure for TLS IFC private information.
+ + + +
trap_ctx_priv_t * ctx
+ +
struct tlsclient_s tlsclient_t
Structure for TLS IFC client information.
+ + +
trap_ctx_priv_t * ctx
+ + + + + + + + +
Structure for TLS IFC client information.
+
void * sending_pointer
+ + +
uint32_t timer_last
+
This file contains common functions and structures used in socket based interfaces (tcp-ip / tls)...
+ +
uint32_t assigned_buffer
+ + + + + +
uint64_t timeouts
+
trap_buffer_header_t int_mess_header
+ +
pthread_mutex_t mtx_no_data
+ + +
+ + + + diff --git a/doc/libtrap-devel/index-devel_8txt.html b/doc/libtrap-devel/index-devel_8txt.html new file mode 100644 index 00000000..f4adfe2b --- /dev/null +++ b/doc/libtrap-devel/index-devel_8txt.html @@ -0,0 +1,77 @@ + + + + + + + +Libtrap: Internal development docs: doc/index-devel.txt File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
doc/index-devel.txt File Reference
+
+
+
+ + + + diff --git a/doc/libtrap-devel/index.html b/doc/libtrap-devel/index.html new file mode 100644 index 00000000..335ccdc9 --- /dev/null +++ b/doc/libtrap-devel/index.html @@ -0,0 +1,86 @@ + + + + + + + +Libtrap: Internal development docs: Development documentation + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Development documentation
+
+
+

Libtrap is divided into:

+

To learn how to implement a new Libtrap interface, see Development of libtrap interface.

+
+ + + + diff --git a/doc/libtrap-devel/jquery.js b/doc/libtrap-devel/jquery.js new file mode 100644 index 00000000..2771c749 --- /dev/null +++ b/doc/libtrap-devel/jquery.js @@ -0,0 +1,115 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' + + +
+
+
Modules
+
+
+
Here is a list of all modules:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Buffering sublayer
 TRAP communication module interface
 IFC API
 file interface module
 File_receiver
 File_sender
 TCP/IP and UNIX socket communication interface module
 TCPIP output IFC
 TCPIP input IFC
 TLS communication interface module
 TLS Output IFC
 TLS Input IFC
 Negotiation return values
 Macros for verbose and debug listings
 IFC counters
 Common libtrap API
 Error codes
 TRAP Timeout
 Specifier of TRAP interfaces
 Types of IFC
 Message format
 Simple API
 Message format
 Nemea module macros
 Context API
 Message format
 Supervisor monitoring feature
+ + + + + + diff --git a/doc/libtrap-devel/nav_f.png b/doc/libtrap-devel/nav_f.png new file mode 100644 index 00000000..72a58a52 Binary files /dev/null and b/doc/libtrap-devel/nav_f.png differ diff --git a/doc/libtrap-devel/nav_g.png b/doc/libtrap-devel/nav_g.png new file mode 100644 index 00000000..2093a237 Binary files /dev/null and b/doc/libtrap-devel/nav_g.png differ diff --git a/doc/libtrap-devel/nav_h.png b/doc/libtrap-devel/nav_h.png new file mode 100644 index 00000000..33389b10 Binary files /dev/null and b/doc/libtrap-devel/nav_h.png differ diff --git a/doc/libtrap-devel/open.png b/doc/libtrap-devel/open.png new file mode 100644 index 00000000..30f75c7e Binary files /dev/null and b/doc/libtrap-devel/open.png differ diff --git a/doc/libtrap-devel/pages.html b/doc/libtrap-devel/pages.html new file mode 100644 index 00000000..a6e06e2f --- /dev/null +++ b/doc/libtrap-devel/pages.html @@ -0,0 +1,84 @@ + + + + + + + +Libtrap: Internal development docs: Related Pages + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Related Pages
+
+
+
Here is a list of all related documentation pages:
+
+ + + + diff --git a/doc/libtrap-devel/search/all_0.html b/doc/libtrap-devel/search/all_0.html new file mode 100644 index 00000000..5125b940 --- /dev/null +++ b/doc/libtrap-devel/search/all_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_0.js b/doc/libtrap-devel/search/all_0.js new file mode 100644 index 00000000..1a0e72a3 --- /dev/null +++ b/doc/libtrap-devel/search/all_0.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['_5f_5fattribute_5f_5f',['__attribute__',['../group__ifctypes.html#ga0dc7518c8c83ec891c44073ca8a12974',1,'__attribute__(): trap.h'],['../group__tcpip__ifc.html#ga286096a9223f09488d24f90c788dcf01',1,'__attribute__((used)): ifc_tcpip.c'],['../trap_8c.html#a6e607992566a02a054cbc51e6a910cd4',1,'__attribute__((used)): trap.c'],['../trap__internal_8h.html#a9a45c722e7e08a072917e8022ded49f7',1,'__attribute__((__packed__)): trap_internal.h']]], + ['_5f_5fsync_5fadd_5fand_5ffetch_5f8',['__sync_add_and_fetch_8',['../trap__internal_8c.html#a280c90d38779a6dfe9a811fe90ddb719',1,'__sync_add_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#a280c90d38779a6dfe9a811fe90ddb719',1,'__sync_add_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5fand_5fand_5ffetch_5f8',['__sync_and_and_fetch_8',['../trap__internal_8c.html#aac8dc6fad1de2284c38354df2fdc959b',1,'__sync_and_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#aac8dc6fad1de2284c38354df2fdc959b',1,'__sync_and_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5fbool_5fcompare_5fand_5fswap_5f8',['__sync_bool_compare_and_swap_8',['../trap__internal_8c.html#a5dcfe918d45603882c13f14c50a07712',1,'__sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval): trap_internal.c'],['../trap__internal_8h.html#a5dcfe918d45603882c13f14c50a07712',1,'__sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval): trap_internal.c']]], + ['_5f_5fsync_5ffetch_5fand_5fadd_5f8',['__sync_fetch_and_add_8',['../trap__internal_8c.html#af7ea138068d5672a867450bf28258d7d',1,'__sync_fetch_and_add_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#af7ea138068d5672a867450bf28258d7d',1,'__sync_fetch_and_add_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5for_5fand_5ffetch_5f8',['__sync_or_and_fetch_8',['../trap__internal_8c.html#a5c425573071638073feaa8810b8697f6',1,'__sync_or_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#a5c425573071638073feaa8810b8697f6',1,'__sync_or_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5fgnu_5fsource',['_GNU_SOURCE',['../ifc__file_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_file.c'],['../ifc__tcpip_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_tcpip.c'],['../ifc__tls_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_tls.c'],['../trap_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): trap.c']]], + ['_5fmkdir',['_mkdir',['../group__file__ifc.html#ga4e35bdd146626b0b3a93d5689762fbea',1,'ifc_file.c']]] +]; diff --git a/doc/libtrap-devel/search/all_1.html b/doc/libtrap-devel/search/all_1.html new file mode 100644 index 00000000..b8ff8711 --- /dev/null +++ b/doc/libtrap-devel/search/all_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_1.js b/doc/libtrap-devel/search/all_1.js new file mode 100644 index 00000000..61c3a140 --- /dev/null +++ b/doc/libtrap-devel/search/all_1.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['accept_5fclients_5fthread',['accept_clients_thread',['../group__tcpip__sender.html#gad3a65816f2a41268758c569a7a368ff1',1,'accept_clients_thread(void *arg): ifc_tcpip.c'],['../group__tls__sender.html#gad3a65816f2a41268758c569a7a368ff1',1,'accept_clients_thread(void *arg): ifc_tls.c']]], + ['accept_5fthr',['accept_thr',['../structtcpip__sender__private__s.html#af688f39844447509add21404319679d7',1,'tcpip_sender_private_s::accept_thr()'],['../structtls__sender__private__s.html#a38c2db22ad82addfc5c582ad15c57deb',1,'tls_sender_private_s::accept_thr()']]], + ['ack_5fmess_5fsize',['ACK_MESS_SIZE',['../group__tcpip__ifc.html#ga3f1bce1e3f6856f294d36a9d60664ddc',1,'ACK_MESS_SIZE(): ifc_tcpip.c'],['../group__tls__ifc.html#ga3f1bce1e3f6856f294d36a9d60664ddc',1,'ACK_MESS_SIZE(): ifc_tls.c']]], + ['active_5fbuffer',['active_buffer',['../structtcpip__sender__private__s.html#a8cb92d563f4d8f5fabdf7957496569b8',1,'tcpip_sender_private_s::active_buffer()'],['../structtls__sender__private__s.html#ac233eb23578bf3726d4c0f95d821ebdc',1,'tls_sender_private_s::active_buffer()']]], + ['assigned_5fbuffer',['assigned_buffer',['../structclient__s.html#a58689156e1d447bc7d888164b16fb3d8',1,'client_s::assigned_buffer()'],['../structtlsclient__s.html#a89887e49546012db19081215dd06efd4',1,'tlsclient_s::assigned_buffer()']]], + ['atomic_5fmutex',['atomic_mutex',['../trap__internal_8c.html#a417e9acbbc27e47555ce6670c64121fb',1,'trap_internal.c']]], + ['autoflush_5ftimeouts',['autoflush_timeouts',['../structautoflush__timeouts.html',1,'']]], + ['autoflush_5ftimestamp',['autoflush_timestamp',['../structtcpip__sender__private__s.html#a2756e5f58f6fc3f786a8f60df248c9cf',1,'tcpip_sender_private_s::autoflush_timestamp()'],['../structtls__sender__private__s.html#adf7f478e809472a860eb1fa143e8ef9f',1,'tls_sender_private_s::autoflush_timestamp()']]] +]; diff --git a/doc/libtrap-devel/search/all_10.html b/doc/libtrap-devel/search/all_10.html new file mode 100644 index 00000000..50bc449e --- /dev/null +++ b/doc/libtrap-devel/search/all_10.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_10.js b/doc/libtrap-devel/search/all_10.js new file mode 100644 index 00000000..ac18558f --- /dev/null +++ b/doc/libtrap-devel/search/all_10.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['reader_5fthreads_5fs',['reader_threads_s',['../structreader__threads__s.html',1,'']]], + ['receive_5fpart',['receive_part',['../group__tcpip__receiver.html#gabe0a6881a61e366a8cf11c4b90ba3698',1,'receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm): ifc_tcpip.c'],['../group__tls__receiver.html#gabe0a6881a61e366a8cf11c4b90ba3698',1,'receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm): ifc_tls.c']]], + ['recovery_5fwait_5fusec',['RECOVERY_WAIT_USEC',['../group__tcpip__ifc.html#ga3c8659cd1a12b3b43cc51c02cb101438',1,'RECOVERY_WAIT_USEC(): ifc_tcpip.c'],['../group__tls__ifc.html#ga3c8659cd1a12b3b43cc51c02cb101438',1,'RECOVERY_WAIT_USEC(): ifc_tls.c']]], + ['recv',['recv',['../structtrap__input__ifc__s.html#a8db5f9ec43dbfae33f00ab64193ed47e',1,'trap_input_ifc_s']]], + ['recv_5fdelay_5ftimestamp',['recv_delay_timestamp',['../group__ctxifccounters.html#gaef1f0d9cee8a5c519c741aa5d3c8f79a',1,'trap_ctx_priv_s']]], + ['remove_5fsetter_5ffrom_5fparam',['remove_setter_from_param',['../group__contextapi.html#gab887e30e4251f7bc48485799bfad173a',1,'trap.c']]], + ['req_5fdata_5ffmt_5fspec',['req_data_fmt_spec',['../structtrap__input__ifc__s.html#a66bf6d0e2e0f2d9912e3979359e17c14',1,'trap_input_ifc_s']]], + ['req_5fdata_5ftype',['req_data_type',['../structtrap__input__ifc__s.html#a9c7711e7a191fd43ca23e39a0d274bdc',1,'trap_input_ifc_s']]] +]; diff --git a/doc/libtrap-devel/search/all_11.html b/doc/libtrap-devel/search/all_11.html new file mode 100644 index 00000000..b35c8bf0 --- /dev/null +++ b/doc/libtrap-devel/search/all_11.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_11.js b/doc/libtrap-devel/search/all_11.js new file mode 100644 index 00000000..93a0d1f7 --- /dev/null +++ b/doc/libtrap-devel/search/all_11.js @@ -0,0 +1,33 @@ +var searchData= +[ + ['sd',['sd',['../structclient__s.html#ad3adabb7ae7c7acd95fc58b8c91274d0',1,'client_s::sd()'],['../structtcpip__receiver__private__s.html#adeeedd594c051b2634657dfaa1846189',1,'tcpip_receiver_private_s::sd()'],['../structtlsclient__s.html#a51dc25444cc24571d9c6b23a51dcd81d',1,'tlsclient_s::sd()'],['../structtls__receiver__private__s.html#ad969cc2935980f27fc7bbdf5ed27ef18',1,'tls_receiver_private_s::sd()']]], + ['sem',['sem',['../structreader__threads__s.html#af62b1ad716c2fa065143b125a31dfa7b',1,'reader_threads_s']]], + ['send',['send',['../structtrap__output__ifc__s.html#ae897ccae374c5ac1287d25391b1d5ba5',1,'trap_output_ifc_s']]], + ['send_5fdata',['SEND_DATA',['../trap_8c.html#a7a5458fe1bcdcc9871a50d236a808bc3',1,'SEND_DATA(): trap.c'],['../group__tcpip__sender.html#ga1c122c5ed90b47bd03fa9e22b18d5c82',1,'send_data(tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id): ifc_tcpip.c'],['../group__tls__sender.html#ga83aa590c182c7739d18df9f42fd90944',1,'send_data(tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id): ifc_tls.c']]], + ['send_5fthr',['send_thr',['../structtcpip__sender__private__s.html#a3057afc26c4862f9245e25d31a01cbc0',1,'tcpip_sender_private_s::send_thr()'],['../structtls__sender__private__s.html#a5998112ad5f7d6e572b5f3022bcbe21d',1,'tls_sender_private_s::send_thr()']]], + ['sending_5fpointer',['sending_pointer',['../structclient__s.html#aa7ae0554314e538955d14a4bfe2ca6fc',1,'client_s::sending_pointer()'],['../structtlsclient__s.html#aa48ac2d54ce0795e30a730ed6f6a927d',1,'tlsclient_s::sending_pointer()']]], + ['sending_5fthread_5ffunc',['sending_thread_func',['../group__tcpip__sender.html#ga029de4ad961a1d3d89a52cbc5e3a10a0',1,'sending_thread_func(void *priv): ifc_tcpip.c'],['../group__tls__sender.html#ga029de4ad961a1d3d89a52cbc5e3a10a0',1,'sending_thread_func(void *priv): ifc_tls.c']]], + ['server_5fport',['server_port',['../structtcpip__sender__private__s.html#ad628d7081819b8236c693ba485cfd10b',1,'tcpip_sender_private_s::server_port()'],['../structtls__sender__private__s.html#a13c88f5e2dfdebfbbb2ab34d30897b76',1,'tls_sender_private_s::server_port()']]], + ['server_5fsd',['server_sd',['../structtcpip__sender__private__s.html#a7e0cc56dd2c6570b60ccbcfdfc6fc3ac',1,'tcpip_sender_private_s::server_sd()'],['../structtls__sender__private__s.html#addda5947d3e0b68d79c922f7300cee92',1,'tls_sender_private_s::server_sd()']]], + ['server_5fsocket_5fopen',['server_socket_open',['../group__tcpip__sender.html#gaf8253ffec1871584621b3dc838055d87',1,'server_socket_open(void *priv): ifc_tcpip.c'],['../group__tls__sender.html#gaf8253ffec1871584621b3dc838055d87',1,'server_socket_open(void *priv): ifc_tls.c']]], + ['service_5fget_5fcom',['SERVICE_GET_COM',['../trap__internal_8h.html#a86478bb24d5a308d79f0425b0eedf54b',1,'trap_internal.h']]], + ['service_5fget_5fdata',['service_get_data',['../group__supervisor.html#ga260e9f14321268444cab75b214a82811',1,'trap.c']]], + ['service_5fifc_5fname',['service_ifc_name',['../structtrap__ctx__priv__s.html#a2ff58b090a07f9fbc6795ecbcda326ee',1,'trap_ctx_priv_s']]], + ['service_5fok_5freply',['SERVICE_OK_REPLY',['../trap__internal_8h.html#a1bccd80a7d96b96e9c01bdf6c18f039e',1,'trap_internal.h']]], + ['service_5fsend_5fdata',['service_send_data',['../group__supervisor.html#ga8a8ad4e5c6ac70d1d8dece93d58da755',1,'trap.c']]], + ['service_5fset_5fcom',['SERVICE_SET_COM',['../trap__internal_8h.html#a0f4ca0b39a8bbce034c63b8cbb227ba1',1,'trap_internal.h']]], + ['service_5fthread',['service_thread',['../structtrap__ctx__priv__s.html#a8679c035870a267754ced49a2d3260e9',1,'trap_ctx_priv_s']]], + ['service_5fthread_5finitialized',['service_thread_initialized',['../structtrap__ctx__priv__s.html#a7e6b71dab19372c5baac9a9a8a6d27bd',1,'trap_ctx_priv_s']]], + ['service_5fthread_5froutine',['service_thread_routine',['../group__supervisor.html#ga5f455505997f558e3f975b54a55aa65d',1,'trap.c']]], + ['set_5findex',['set_index',['../ifc__socket__common_8h.html#a39682f44b96aabab2c05f0d8b0186bee',1,'ifc_socket_common.h']]], + ['simple_20api',['Simple API',['../group__simpleapi.html',1,'']]], + ['size_5fparam',['SIZE_PARAM',['../ifc__file_8h.html#ae6d0889243aace97bb08b801aabbac78',1,'ifc_file.h']]], + ['size_5fparam_5flen',['SIZE_PARAM_LEN',['../ifc__file_8h.html#a27a9fc95c885214eb8e9f3954deb9fab',1,'ifc_file.h']]], + ['socket_5ftype',['socket_type',['../structtcpip__sender__private__s.html#a19976c4d73b748dfd0a402fbe1d4a512',1,'tcpip_sender_private_s::socket_type()'],['../structtcpip__receiver__private__s.html#a9b9f68cd09485b9b2a50d012d9519edc',1,'tcpip_receiver_private_s::socket_type()']]], + ['ssl',['ssl',['../structtlsclient__s.html#a7784cbc5018b861a41948fbef28bc73c',1,'tlsclient_s::ssl()'],['../structtls__receiver__private__s.html#a712ad2731c418bbdbd08b01989f84f92',1,'tls_receiver_private_s::ssl()']]], + ['sslctx',['sslctx',['../structtls__sender__private__s.html#a691a55a9c7a7c50a5779afa5a5c99796',1,'tls_sender_private_s::sslctx()'],['../structtls__receiver__private__s.html#a59a066f97ece753d4c44f75af5ec4f66',1,'tls_receiver_private_s::sslctx()']]], + ['supervisor_20monitoring_20feature',['Supervisor monitoring feature',['../group__supervisor.html',1,'']]], + ['switch_5ffile',['switch_file',['../group__file__ifc.html#gac0f2fbc2888f6354257ac88d9a9853c1',1,'ifc_file.c']]], + ['switch_5ffile_5fwrapper',['switch_file_wrapper',['../group__file__ifc.html#ga32cd1cfb7fb21703391aee752a0d647e',1,'ifc_file.c']]], + ['specifier_20of_20trap_20interfaces',['Specifier of TRAP interfaces',['../group__trapifcspec.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/all_12.html b/doc/libtrap-devel/search/all_12.html new file mode 100644 index 00000000..fd265245 --- /dev/null +++ b/doc/libtrap-devel/search/all_12.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_12.js b/doc/libtrap-devel/search/all_12.js new file mode 100644 index 00000000..fe6192bd --- /dev/null +++ b/doc/libtrap-devel/search/all_12.js @@ -0,0 +1,239 @@ +var searchData= +[ + ['types_20of_20ifc',['Types of IFC',['../group__ifctypes.html',1,'']]], + ['tcpip_5faddr',['tcpip_addr',['../uniontcpip__socket__addr.html#a62e73f6a1f3324336efa8813fb1f05ed',1,'tcpip_socket_addr']]], + ['tcp_2fip_20and_20unix_20socket_20communication_20interface_20module',['TCP/IP and UNIX socket communication interface module',['../group__tcpip__ifc.html',1,'']]], + ['tcpip_5fifc_5fparams_5fdelimiter',['TCPIP_IFC_PARAMS_DELIMITER',['../ifc__tcpip_8h.html#accae29cc0e813979cb529363038e3015',1,'ifc_tcpip.h']]], + ['tcpip_5fifc_5fsockettype',['tcpip_ifc_sockettype',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6',1,'ifc_tcpip.h']]], + ['tcpip_20input_20ifc',['TCPIP input IFC',['../group__tcpip__receiver.html',1,'']]], + ['tcpip_5freceiver_5fcreate_5fdump',['tcpip_receiver_create_dump',['../group__tcpip__receiver.html#ga6fa6335d8d722e969e66e4601893b053',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5fdestroy',['tcpip_receiver_destroy',['../group__tcpip__receiver.html#gac72d44fcf38e4740167ec967d083ee1c',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5fprivate_5fs',['tcpip_receiver_private_s',['../structtcpip__receiver__private__s.html',1,'']]], + ['tcpip_5freceiver_5fprivate_5ft',['tcpip_receiver_private_t',['../group__tcpip__receiver.html#ga8c4c1adea41d582cd619ce9ee9b27aa3',1,'ifc_tcpip_internal.h']]], + ['tcpip_5freceiver_5frecv',['tcpip_receiver_recv',['../group__tcpip__receiver.html#gad93a311e4d889c963082988a3489f0c0',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5fterminate',['tcpip_receiver_terminate',['../group__tcpip__receiver.html#ga3b90935d63bbc0262f3d45312a6962d4',1,'ifc_tcpip.c']]], + ['tcpip_5frecv_5fifc_5fget_5fid',['tcpip_recv_ifc_get_id',['../group__tcpip__receiver.html#gac897200a57fdb142b2a471cfd242107b',1,'ifc_tcpip.c']]], + ['tcpip_5frecv_5fifc_5fis_5fconn',['tcpip_recv_ifc_is_conn',['../group__tcpip__receiver.html#gabda68c8dca42004f03d7fa11e8078be2',1,'ifc_tcpip.c']]], + ['tcpip_5fsend_5fifc_5fget_5fid',['tcpip_send_ifc_get_id',['../group__tcpip__sender.html#ga90dbe211caa71064dd3c44b9eac5932a',1,'ifc_tcpip.c']]], + ['tcpip_20output_20ifc',['TCPIP output IFC',['../group__tcpip__sender.html',1,'']]], + ['tcpip_5fsender_5fcreate_5fdump',['tcpip_sender_create_dump',['../group__tcpip__sender.html#ga7cb4c51ce43d85a04c6406a17fc1fe0b',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fdestroy',['tcpip_sender_destroy',['../group__tcpip__sender.html#ga5ad10441ac50af06112eee9db2047919',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fflush',['tcpip_sender_flush',['../group__tcpip__sender.html#ga84f6fd9cc7f2ecb7f175f2149b6381a5',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fget_5fclient_5fcount',['tcpip_sender_get_client_count',['../group__tcpip__sender.html#ga3d1beceb2af358ffb6116184e9f61026',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fget_5fclient_5fstats_5fjson',['tcpip_sender_get_client_stats_json',['../group__tcpip__sender.html#ga610a2d03c2351110e984fc74c26356bf',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fprivate_5fs',['tcpip_sender_private_s',['../structtcpip__sender__private__s.html',1,'']]], + ['tcpip_5fsender_5fprivate_5ft',['tcpip_sender_private_t',['../group__tcpip__sender.html#ga45657b399741b8bd08cbfcef2ad490f1',1,'ifc_tcpip_internal.h']]], + ['tcpip_5fsender_5fsend',['tcpip_sender_send',['../group__tcpip__sender.html#ga4c778885040ccd9dafe56b1f9ecd355f',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fterminate',['tcpip_sender_terminate',['../group__tcpip__sender.html#ga0b43746d012021fe6af3b6fde17d12c3',1,'ifc_tcpip.c']]], + ['tcpip_5fserver_5fdisconnect_5fall_5fclients',['tcpip_server_disconnect_all_clients',['../group__tcpip__sender.html#gab09f65cfd346e2d795e09e7b3533e95a',1,'ifc_tcpip.c']]], + ['tcpip_5fsocket_5faddr',['tcpip_socket_addr',['../uniontcpip__socket__addr.html',1,'']]], + ['tcpip_5fsockettype_5fstr',['TCPIP_SOCKETTYPE_STR',['../ifc__tcpip_8h.html#a643bf83d44a7112dffafa71688057d4c',1,'ifc_tcpip.h']]], + ['term_5fpipe',['term_pipe',['../structtcpip__sender__private__s.html#a2d291d39d4fa615d69eebeb4bffe1f4e',1,'tcpip_sender_private_s::term_pipe()'],['../structtls__sender__private__s.html#a249d112b71d13702659fd0d3f8385cad',1,'tls_sender_private_s::term_pipe()']]], + ['terminate',['terminate',['../structtrap__input__ifc__s.html#a4eba7ef455b394109a14d7e133a9fcd0',1,'trap_input_ifc_s::terminate()'],['../structtrap__output__ifc__s.html#ac7b9f92faabc9454e426e344d0fa42e1',1,'trap_output_ifc_s::terminate()']]], + ['terminated',['terminated',['../structtrap__ctx__priv__s.html#a1766aa58f50d6d56d3ec7b7d03830e82',1,'trap_ctx_priv_s']]], + ['thr',['thr',['../structreader__threads__s.html#a91f529465e26ed75d5bc193e6713d7a7',1,'reader_threads_s']]], + ['time_5fformat_5fstring',['TIME_FORMAT_STRING',['../ifc__file_8h.html#a768ea84a7b5818ac12d03ad83f7d6193',1,'ifc_file.h']]], + ['time_5fformat_5fstring_5flen',['TIME_FORMAT_STRING_LEN',['../ifc__file_8h.html#ad526578db98c7054e96c3344a18697d0',1,'ifc_file.h']]], + ['time_5fparam',['TIME_PARAM',['../ifc__file_8h.html#a30ac80fc92df5812ff3f626b00b63b2d',1,'ifc_file.h']]], + ['time_5fparam_5flen',['TIME_PARAM_LEN',['../ifc__file_8h.html#a9e2217118253dafa9f8b31342b0fcfb1',1,'ifc_file.h']]], + ['timeout',['timeout',['../structtrap__output__ifc__s.html#a12225c3a52f5fa28db243073ae58c2d3',1,'trap_output_ifc_s']]], + ['timeout_5ffixed',['timeout_fixed',['../structtrap__output__ifc__s.html#ae5f88f58a178f17e95596e4118fe69a8',1,'trap_output_ifc_s']]], + ['timeouts',['timeouts',['../structclient__s.html#accac71a3ff6b597e6138752c50306ae2',1,'client_s::timeouts()'],['../structtlsclient__s.html#a5ea334db46f220252917167566ca113e',1,'tlsclient_s::timeouts()']]], + ['timer_5flast',['timer_last',['../structclient__s.html#a280d8c33cf50280aa0053cf955278dc4',1,'client_s::timer_last()'],['../structtlsclient__s.html#abdc38614e0122200e245508bf0ca0714',1,'tlsclient_s::timer_last()']]], + ['timer_5ftotal',['timer_total',['../structclient__s.html#a0c58ec753aa9ec16990fb9500d1e940a',1,'client_s::timer_total()'],['../structtlsclient__s.html#ad0d2358902686e45c81f982712d6e69c',1,'tlsclient_s::timer_total()']]], + ['tls_5faddr',['tls_addr',['../uniontls__socket__addr.html#ab079470415e72216a900bbb4bac043ee',1,'tls_socket_addr']]], + ['tls_5fconfigure_5fctx',['tls_configure_ctx',['../group__tls__ifc.html#ga5ca1db90a22c8ddedc5e88c4992d53c0',1,'ifc_tls.c']]], + ['tls_20communication_20interface_20module',['TLS communication interface module',['../group__tls__ifc.html',1,'']]], + ['tls_5fparams_5fdelimiter',['TLS_PARAMS_DELIMITER',['../ifc__tls_8h.html#aa83e6c8b7d7a04ea8428ce4178e1f54c',1,'ifc_tls.h']]], + ['tls_20input_20ifc',['TLS Input IFC',['../group__tls__receiver.html',1,'']]], + ['tls_5freceiver_5fcreate_5fdump',['tls_receiver_create_dump',['../group__tls__receiver.html#ga1ce46e0e5685ba0484f6c20d6634f0be',1,'ifc_tls.c']]], + ['tls_5freceiver_5fdestroy',['tls_receiver_destroy',['../group__tls__receiver.html#gaa1c6a709f10285070373a2153e5c99bd',1,'ifc_tls.c']]], + ['tls_5freceiver_5fprivate_5fs',['tls_receiver_private_s',['../structtls__receiver__private__s.html',1,'']]], + ['tls_5freceiver_5fprivate_5ft',['tls_receiver_private_t',['../group__tls__receiver.html#ga8e72f8a86412ea09d3497eb42438bbab',1,'ifc_tls_internal.h']]], + ['tls_5freceiver_5frecv',['tls_receiver_recv',['../group__tls__receiver.html#gaa57cf3a16267d7213589886a11a8e2b1',1,'ifc_tls.c']]], + ['tls_5freceiver_5fterminate',['tls_receiver_terminate',['../group__tls__receiver.html#ga21cd7b2e5b2a0b0839a8d796b618fadf',1,'ifc_tls.c']]], + ['tls_5frecv_5fifc_5fget_5fid',['tls_recv_ifc_get_id',['../group__tls__receiver.html#gad96732e9b2d458007350ae013f39e08b',1,'ifc_tls.c']]], + ['tls_5frecv_5fifc_5fis_5fconn',['tls_recv_ifc_is_conn',['../group__tls__receiver.html#ga27a72e24932cd5c81e5eac4356b6a1b8',1,'ifc_tls.c']]], + ['tls_5fsend_5fifc_5fget_5fid',['tls_send_ifc_get_id',['../group__tls__sender.html#gaa359345fa6728d47aa48b8d8510cbfa1',1,'ifc_tls.c']]], + ['tls_20output_20ifc',['TLS Output IFC',['../group__tls__sender.html',1,'']]], + ['tls_5fsender_5fcreate_5fdump',['tls_sender_create_dump',['../group__tls__sender.html#ga6a5c96daa3b31f978960c4a6e7254dc0',1,'ifc_tls.c']]], + ['tls_5fsender_5fdestroy',['tls_sender_destroy',['../group__tls__sender.html#gab89480d7e111593867b3d31b8fd7af97',1,'ifc_tls.c']]], + ['tls_5fsender_5fflush',['tls_sender_flush',['../group__tls__sender.html#ga7275190583a84764542fa8814ff0b4de',1,'ifc_tls.c']]], + ['tls_5fsender_5fget_5fclient_5fcount',['tls_sender_get_client_count',['../group__tls__sender.html#ga917b981d1bafb671093a40c0216e07fa',1,'ifc_tls.c']]], + ['tls_5fsender_5fget_5fclient_5fstats_5fjson',['tls_sender_get_client_stats_json',['../group__tls__sender.html#ga523e71d675979d48e01a634ef54d652d',1,'ifc_tls.c']]], + ['tls_5fsender_5fprivate_5fs',['tls_sender_private_s',['../structtls__sender__private__s.html',1,'']]], + ['tls_5fsender_5fprivate_5ft',['tls_sender_private_t',['../group__tls__sender.html#ga07cc54970619735031e328a849dbbc83',1,'ifc_tls_internal.h']]], + ['tls_5fsender_5fsend',['tls_sender_send',['../group__tls__sender.html#ga67c0673f9a702036f37933840891192a',1,'ifc_tls.c']]], + ['tls_5fsender_5fterminate',['tls_sender_terminate',['../group__tls__sender.html#gad3e0654a4636e0d138b15529aff51131',1,'ifc_tls.c']]], + ['tls_5fserver_5fconfigure_5fctx',['tls_server_configure_ctx',['../group__tls__ifc.html#gac210df49fc535a17e99fd54220a26bb7',1,'ifc_tls.c']]], + ['tls_5fserver_5fdisconnect_5fall_5fclients',['tls_server_disconnect_all_clients',['../group__tls__sender.html#ga3f5aa45f5c8641f9fd83159208d62647',1,'ifc_tls.c']]], + ['tls_5fsocket_5faddr',['tls_socket_addr',['../uniontls__socket__addr.html',1,'']]], + ['tlsclient_5fcreate_5fcontext',['tlsclient_create_context',['../group__tls__ifc.html#ga935780a2ed8282257f7592df061ec763',1,'ifc_tls.c']]], + ['tlsclient_5fs',['tlsclient_s',['../structtlsclient__s.html',1,'']]], + ['tlsclient_5ft',['tlsclient_t',['../group__tls__sender.html#gab81355a0ad8e318125a88642ecd3544a',1,'ifc_tls_internal.h']]], + ['tlsserver_5fcreate_5fcontext',['tlsserver_create_context',['../group__tls__ifc.html#ga0013ab56b5b70304b618c0d9ba36b828',1,'ifc_tls.c']]], + ['tm',['tm',['../structautoflush__timeouts.html#ad0ba56ad8d8f9eaee10b847f0159265f',1,'autoflush_timeouts']]], + ['tm_5fbackup',['tm_backup',['../structautoflush__timeouts.html#a6271cc0799ca1890bb9d0b9514560dd7',1,'autoflush_timeouts']]], + ['todo_20list',['Todo List',['../todo.html',1,'']]], + ['trap_2ec',['trap.c',['../trap_8c.html',1,'']]], + ['trap_2eh',['trap.h',['../trap_8h.html',1,'']]], + ['trap_5fbuffer_5fheader_5fs',['trap_buffer_header_s',['../structtrap__buffer__header__s.html',1,'']]], + ['trap_5fbuffer_5fheader_5ft',['trap_buffer_header_t',['../trap__internal_8h.html#a40b126ea10058bade088e6246959fd97',1,'trap_internal.h']]], + ['trap_5fcheck_5fbuffer_5fcontent',['trap_check_buffer_content',['../group__buffering.html#gab4ba2c95a8817983f23a58aae093f48f',1,'trap_check_buffer_content(void *buffer, uint32_t buffer_size): trap.c'],['../group__commonapi.html#gab4ba2c95a8817983f23a58aae093f48f',1,'trap_check_buffer_content(void *buffer, uint32_t buffer_size): trap.c']]], + ['trap_5fcheck_5fglobal_5fvars',['trap_check_global_vars',['../trap_8c.html#a1fa1a6cb72b2c1d4ee2230d02879b595',1,'trap.c']]], + ['trap_5fconvert_5fmodule_5finfo_5fto_5fjson',['trap_convert_module_info_to_json',['../trap_8c.html#aa7d12305ed7cd625f63bf7280cdd179c',1,'trap.c']]], + ['trap_5fcreate_5fctx_5ft',['trap_create_ctx_t',['../group__contextapi.html#gac49fa7525b8de6bbc6d37fc52f11e1be',1,'trap_create_ctx_t(): trap.c'],['../group__contextapi.html#gac49fa7525b8de6bbc6d37fc52f11e1be',1,'trap_create_ctx_t(): trap.c']]], + ['trap_5fcreate_5fmodule_5finfo',['trap_create_module_info',['../trap_8c.html#a0a1fe50eb250f63d0150294af2721916',1,'trap.c']]], + ['trap_5fctx_5fcmp_5fdata_5ffmt',['trap_ctx_cmp_data_fmt',['../group__trap__mess__fmt.html#ga1a036c53c7629eb220fa582a7a4ae56c',1,'trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt): trap.c'],['../group__commonapi.html#ga1a036c53c7629eb220fa582a7a4ae56c',1,'trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt): trap.c']]], + ['trap_5fctx_5fcreate_5fifc_5fdump',['trap_ctx_create_ifc_dump',['../group__supervisor.html#ga19b26aef67596239ccc72a6f0f1d05fd',1,'trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path): trap.c'],['../group__contextapi.html#ga19b26aef67596239ccc72a6f0f1d05fd',1,'trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path): trap.c']]], + ['trap_5fctx_5ffinalize',['trap_ctx_finalize',['../group__contextapi.html#ga5b84d682c3c68fe814896f7f002b319b',1,'trap.c']]], + ['trap_5fctx_5fget_5fclient_5fcount',['trap_ctx_get_client_count',['../group__supervisor.html#gacf18085a199ed89010eaf8afb375f2db',1,'trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx): trap.c'],['../group__contextapi.html#gacf18085a199ed89010eaf8afb375f2db',1,'trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx): trap.c']]], + ['trap_5fctx_5fget_5fdata_5ffmt',['trap_ctx_get_data_fmt',['../group__trap__mess__fmt.html#gacba5dba90afc66aa5fa36b505c49226f',1,'trap.c']]], + ['trap_5fctx_5fget_5fin_5fifc_5fstate',['trap_ctx_get_in_ifc_state',['../group__trap__mess__fmt.html#ga0f4ff32ca8352ec4ebbbaf4c40d2e8b7',1,'trap.c']]], + ['trap_5fctx_5fget_5flast_5ferror',['trap_ctx_get_last_error',['../group__contextapi.html#ga2902ffa62edfbfae946d232ff446b1f4',1,'trap.c']]], + ['trap_5fctx_5fget_5flast_5ferror_5fmsg',['trap_ctx_get_last_error_msg',['../group__contextapi.html#ga7c98c3764b024c49bb50ac850fa65f79',1,'trap.c']]], + ['trap_5fctx_5fget_5fverbose_5flevel',['trap_ctx_get_verbose_level',['../group__contextapi.html#gae0d72b263e714adcf85b5b15dad98dad',1,'trap.h']]], + ['trap_5fctx_5fifcctl',['trap_ctx_ifcctl',['../group__contextapi.html#ga5ef43a88e58beb25cfbceed7643e5fba',1,'trap.c']]], + ['trap_5fctx_5finit',['trap_ctx_init',['../group__contextapi.html#gad63272a184d3a4f5a386bf10629f4266',1,'trap.c']]], + ['trap_5fctx_5finit2',['trap_ctx_init2',['../group__contextapi.html#ga5a66c582ecfb422c02716d64020ca4f3',1,'trap.c']]], + ['trap_5fctx_5finit3',['trap_ctx_init3',['../group__contextapi.html#ga9a78b1581ccf324cb9dd1f4222b5d083',1,'trap.c']]], + ['trap_5fctx_5fpriv_5fs',['trap_ctx_priv_s',['../structtrap__ctx__priv__s.html',1,'']]], + ['trap_5fctx_5fpriv_5ft',['trap_ctx_priv_t',['../group__debug.html#ga7c1820c9482b11ef772ed7ef95d4f7f0',1,'trap_internal.h']]], + ['trap_5fctx_5frecv',['trap_ctx_recv',['../group__contextapi.html#ga000e7c5b259aad735f066f2e5e8529bb',1,'trap.c']]], + ['trap_5fctx_5fsend',['trap_ctx_send',['../group__contextapi.html#ga9201daf1d4b3123b1caeab26e50c3a61',1,'trap.c']]], + ['trap_5fctx_5fsend_5fflush',['trap_ctx_send_flush',['../group__contextapi.html#ga94141c10e9f43926c03fe1404650b768',1,'trap.c']]], + ['trap_5fctx_5fset_5fdata_5ffmt',['trap_ctx_set_data_fmt',['../group__trap__mess__fmt.html#gae876dcd1ae5562bc85c7a10d93909e76',1,'trap.c']]], + ['trap_5fctx_5fset_5frequired_5ffmt',['trap_ctx_set_required_fmt',['../group__trap__mess__fmt.html#ga016bd84888f31fe8caf652553fb053aa',1,'trap.c']]], + ['trap_5fctx_5fset_5fverbose_5flevel',['trap_ctx_set_verbose_level',['../group__contextapi.html#ga91d29b40d546e03bd132854c7ae2bf9c',1,'trap.h']]], + ['trap_5fctx_5ft',['trap_ctx_t',['../trap_8h.html#a008a51aeb2d1f379beb493108407ce97',1,'trap.h']]], + ['trap_5fctx_5fterminate',['trap_ctx_terminate',['../group__contextapi.html#ga8fb998ec081c6f0ad96a669d95efcfe7',1,'trap.c']]], + ['trap_5fctx_5fvifcctl',['trap_ctx_vifcctl',['../group__contextapi.html#ga5d734e6839140420db59190197d7cac8',1,'trap.c']]], + ['trap_5fctx_5fvset_5fdata_5ffmt',['trap_ctx_vset_data_fmt',['../group__trap__mess__fmt.html#gae2a28b33476acd05869aebfd99b140fd',1,'trap.c']]], + ['trap_5fctx_5fvset_5frequired_5ffmt',['trap_ctx_vset_required_fmt',['../group__trap__mess__fmt.html#gafa497348ff404d5a26d349b63a8888d5',1,'trap.c']]], + ['trap_5fdata_5fformat_5ft',['trap_data_format_t',['../group__trap__mess__fmt.html#gafbdd4209c0e285278d2134a0500164ad',1,'trap.h']]], + ['trap_5fdebug',['trap_debug',['../group__debug.html#ga3b3befcce5bb831d533b29013308578e',1,'trap_debug(): trap_internal.c'],['../group__debug.html#ga3b3befcce5bb831d533b29013308578e',1,'trap_debug(): trap_internal.c']]], + ['trap_5fdefault_5ffinalization',['TRAP_DEFAULT_FINALIZATION',['../group__modulemacros.html#gaef424ddcb73a7b41ee068ac848c78a0c',1,'trap.h']]], + ['trap_5fdefault_5fget_5fdata_5ferror_5fhandling',['TRAP_DEFAULT_GET_DATA_ERROR_HANDLING',['../group__modulemacros.html#gaab8ea8009824ab14c1726b53a41d6218',1,'trap.h']]], + ['trap_5fdefault_5finitialization',['TRAP_DEFAULT_INITIALIZATION',['../group__modulemacros.html#ga80b87dc3b3964a1ac0ef4a74e8ec5166',1,'trap.h']]], + ['trap_5fdefault_5frecv_5ferror_5fhandling',['TRAP_DEFAULT_RECV_ERROR_HANDLING',['../group__modulemacros.html#ga4c19d4d81540f75735f4e8500ef3c99d',1,'trap.h']]], + ['trap_5fdefault_5fsend_5fdata_5ferror_5fhandling',['TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING',['../group__modulemacros.html#ga91dbb76490c38e828bdf660ac3c9ca41',1,'trap.h']]], + ['trap_5fdefault_5fsend_5ferror_5fhandling',['TRAP_DEFAULT_SEND_ERROR_HANDLING',['../group__modulemacros.html#ga7dd83735a6770e54573bf0e5e3ad474c',1,'trap.h']]], + ['trap_5fdefault_5fsignal_5fhandler',['TRAP_DEFAULT_SIGNAL_HANDLER',['../group__modulemacros.html#ga6d563233a9fb8ed10a181d1e4c87c271',1,'trap.h']]], + ['trap_5fdefault_5fsocket_5fpath_5fformat',['trap_default_socket_path_format',['../group__commonapi.html#gaf7b7bed58a3f3c7900264fd442613526',1,'trap.h']]], + ['trap_5fe_5fbad_5fcert',['TRAP_E_BAD_CERT',['../group__errorcodes.html#gafa94e2a269d90c1356914317b858974e',1,'trap.h']]], + ['trap_5fe_5fbad_5ffparams',['TRAP_E_BAD_FPARAMS',['../group__errorcodes.html#ga37d23208a014682eedb38ee051a95839',1,'trap.h']]], + ['trap_5fe_5fbad_5fifc_5findex',['TRAP_E_BAD_IFC_INDEX',['../group__errorcodes.html#ga70ce5da2e8e3e757782469917d2edb5c',1,'trap.h']]], + ['trap_5fe_5fbadparams',['TRAP_E_BADPARAMS',['../group__errorcodes.html#ga8481def38edb03ade169c7f2b9b38080',1,'trap.h']]], + ['trap_5fe_5ffields_5fmismatch',['TRAP_E_FIELDS_MISMATCH',['../group__errorcodes.html#ga1b18b576a339cd04c39f4a25cefb88a6',1,'trap.h']]], + ['trap_5fe_5ffields_5fsubset',['TRAP_E_FIELDS_SUBSET',['../group__errorcodes.html#ga5e856388d29981f44820a877010f02cb',1,'trap.h']]], + ['trap_5fe_5fformat_5fchanged',['TRAP_E_FORMAT_CHANGED',['../group__errorcodes.html#gafddd362476ea8d5ecb1f8097c985f3f6',1,'trap.h']]], + ['trap_5fe_5fformat_5fmismatch',['TRAP_E_FORMAT_MISMATCH',['../group__errorcodes.html#ga289de5fd2150cb4c6d768a8a64deca61',1,'trap.h']]], + ['trap_5fe_5fhelp',['TRAP_E_HELP',['../group__errorcodes.html#ga72b3751575ccae7cccb3c3610bd93974',1,'trap.h']]], + ['trap_5fe_5finitialized',['TRAP_E_INITIALIZED',['../group__errorcodes.html#ga375c24128023c61e9e8fc4a395dd56ac',1,'trap.h']]], + ['trap_5fe_5fio_5ferror',['TRAP_E_IO_ERROR',['../group__errorcodes.html#gaa814c8dadce409fc1fa10c5f70df3a0f',1,'trap.h']]], + ['trap_5fe_5fmemory',['TRAP_E_MEMORY',['../group__errorcodes.html#ga79663abf02abe99caaed1d00477948fd',1,'trap.h']]], + ['trap_5fe_5fnegotiation_5ffailed',['TRAP_E_NEGOTIATION_FAILED',['../group__errorcodes.html#gaf23088e9550dde38a9169d734c530866',1,'trap.h']]], + ['trap_5fe_5fnot_5finitialized',['TRAP_E_NOT_INITIALIZED',['../group__errorcodes.html#gaa49e5036605bb9cab9948bc086a26fa3',1,'trap.h']]], + ['trap_5fe_5fnot_5fselected',['TRAP_E_NOT_SELECTED',['../group__errorcodes.html#gae0d81b475cb6808af4a63fe27e34ebec',1,'trap.h']]], + ['trap_5fe_5fok',['TRAP_E_OK',['../group__errorcodes.html#ga6aabff248f6e15e2e53b06cfd1e8349a',1,'trap.h']]], + ['trap_5fe_5fterminated',['TRAP_E_TERMINATED',['../group__errorcodes.html#gaa00d25205d918e414549f8b110e46c18',1,'trap.h']]], + ['trap_5fe_5ftimeout',['TRAP_E_TIMEOUT',['../group__errorcodes.html#gaac3c26d22e1f37413af205a7a70a058c',1,'trap.h']]], + ['trap_5ferr_5fmsg',['trap_err_msg',['../group__debug.html#ga9735d32bc4c81447d8acada6f9a53d3e',1,'trap_err_msg(): trap_internal.c'],['../group__debug.html#ga9735d32bc4c81447d8acada6f9a53d3e',1,'trap_err_msg(): trap_internal.c']]], + ['trap_5ferror',['trap_error',['../trap__error_8h.html#a41ae164bf79849bf28e8043fc242577a',1,'trap_error.h']]], + ['trap_5ferror_2ec',['trap_error.c',['../trap__error_8c.html',1,'']]], + ['trap_5ferror_2eh',['trap_error.h',['../trap__error_8h.html',1,'']]], + ['trap_5ferrorf',['trap_errorf',['../trap__error_8h.html#afbe885c6cdd55431071f2164f1bc6208',1,'trap_error.h']]], + ['trap_5ferrorp',['trap_errorp',['../trap__error_8h.html#af4cc92d8e7364457eb530294a4ca5a27',1,'trap_error.h']]], + ['trap_5ffinalize',['trap_finalize',['../group__simpleapi.html#ga2694fb89b2da11d529ef69c21f2197ef',1,'trap_finalize(): trap.c'],['../group__simpleapi.html#ga2694fb89b2da11d529ef69c21f2197ef',1,'trap_finalize(): trap.c']]], + ['trap_5ffmt_5fjson',['TRAP_FMT_JSON',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164adab683cfedbefc09299295768bfc566aed',1,'trap.h']]], + ['trap_5ffmt_5fraw',['TRAP_FMT_RAW',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada62494ba4588111acd4873a21f6a73262',1,'trap.h']]], + ['trap_5ffmt_5funirec',['TRAP_FMT_UNIREC',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada6ac00a120fdc99b1ccef72e4c31310f2',1,'trap.h']]], + ['trap_5ffmt_5funknown',['TRAP_FMT_UNKNOWN',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada3cb9037147bcf0255468111565ecaca0',1,'trap.h']]], + ['trap_5ffree_5fctx_5ft',['trap_free_ctx_t',['../group__contextapi.html#ga68be429edf74da1b74bede6ff2c785d3',1,'trap.c']]], + ['trap_5ffree_5fglobal_5fvars',['trap_free_global_vars',['../trap_8c.html#a40c47f921815265e8958850041f1e6ae',1,'trap.c']]], + ['trap_5ffree_5fifc_5fspec',['trap_free_ifc_spec',['../group__simpleapi.html#ga957443419c0e9961b8efba34f8e79009',1,'trap_free_ifc_spec(trap_ifc_spec_t ifc_spec): trap.c'],['../group__simpleapi.html#ga957443419c0e9961b8efba34f8e79009',1,'trap_free_ifc_spec(trap_ifc_spec_t ifc_spec): trap.c']]], + ['trap_5fget_5fdata_5ffmt',['trap_get_data_fmt',['../group__trap__mess__fmt.html#gaafb028aba366c69626fb86f85700128b',1,'trap.c']]], + ['trap_5fget_5fglobal_5fctx',['trap_get_global_ctx',['../group__trap__mess__fmt.html#gaf23b66446f6a9549460c6f9315fa612b',1,'trap_get_global_ctx(): trap.c'],['../group__commonapi.html#gaf23b66446f6a9549460c6f9315fa612b',1,'trap_get_global_ctx(): trap.c']]], + ['trap_5fget_5fin_5fifc_5fstate',['trap_get_in_ifc_state',['../group__trap__mess__fmt.html#ga0e46ea6655ac72ab1508a092cec5b05e',1,'trap_get_in_ifc_state(uint32_t ifc_idx): trap.c'],['../group__commonapi.html#ga0e46ea6655ac72ab1508a092cec5b05e',1,'trap_get_in_ifc_state(uint32_t ifc_idx): trap.c']]], + ['trap_5fget_5finternal_5fbuffer',['trap_get_internal_buffer',['../trap_8c.html#a8969280e1c6d6b509b837b310631e8db',1,'trap.c']]], + ['trap_5fget_5fparam_5fby_5fdelimiter',['trap_get_param_by_delimiter',['../group__commonapi.html#ga4b31b73a73b203d80cfcb424ccd9edf5',1,'trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter): trap.c'],['../group__commonapi.html#ga4b31b73a73b203d80cfcb424ccd9edf5',1,'trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter): trap.c']]], + ['trap_5fget_5ftype_5fand_5fname_5ffrom_5fstring',['trap_get_type_and_name_from_string',['../group__trap__mess__fmt.html#ga8cb714bba0bf01ccf7584332936e2113',1,'trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type): trap.c'],['../group__commonapi.html#ga8cb714bba0bf01ccf7584332936e2113',1,'trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type): trap.c']]], + ['trap_5fget_5fverbose_5flevel',['trap_get_verbose_level',['../group__simpleapi.html#gaf7d9a764eeb924fe2dedaed0b79b2cec',1,'trap_get_verbose_level(): trap.c'],['../group__simpleapi.html#gaf7d9a764eeb924fe2dedaed0b79b2cec',1,'trap_get_verbose_level(): trap.c']]], + ['trap_5fgit_5fversion',['trap_git_version',['../group__commonapi.html#gaf27b94a242d49569cd6f943023176083',1,'trap.h']]], + ['trap_5fglob_5fctx',['trap_glob_ctx',['../group__debug.html#ga4fcc14efc331481c2957dab472950df5',1,'trap_glob_ctx(): trap.c'],['../group__debug.html#ga4fcc14efc331481c2957dab472950df5',1,'trap_glob_ctx(): trap.c']]], + ['trap_5fhalfwait',['TRAP_HALFWAIT',['../group__trap__timeout.html#gaca9cc2b565d7f211242da01fd963cc41',1,'trap.h']]], + ['trap_5fhelp_5fifcspec',['trap_help_ifcspec',['../help__trapifcspec_8c.html#ad42ed2f9863287a22ef816d79e4cc4ab',1,'help_trapifcspec.c']]], + ['trap_5fhelp_5fspec',['trap_help_spec',['../trap_8c.html#ad538ab23674c9067a0dfd2570a521f7b',1,'trap.c']]], + ['trap_20communication_20module_20interface',['TRAP communication module interface',['../group__trap__ifc.html',1,'']]], + ['trap_5fifc_2eh',['trap_ifc.h',['../trap__ifc_8h.html',1,'']]], + ['trap_5fifc_5fdefault_5fmax_5fclients',['TRAP_IFC_DEFAULT_MAX_CLIENTS',['../group__trap__ifc.html#gaeacfd016f643e97abb67df075de9be83',1,'trap_ifc.h']]], + ['trap_5fifc_5fdelimiter',['TRAP_IFC_DELIMITER',['../group__trapifcspec.html#gaf8273a2dc10334433a3b44975b7f92cd',1,'trap.h']]], + ['trap_5fifc_5fmessageq_5fsize',['TRAP_IFC_MESSAGEQ_SIZE',['../group__commonapi.html#ga28c29cb10db13086eece2f6497363df3',1,'trap.h']]], + ['trap_5fifc_5fparam_5fdelimiter',['TRAP_IFC_PARAM_DELIMITER',['../group__trapifcspec.html#gaae7f619c830ebcece693cc93a949c431',1,'trap.h']]], + ['trap_5fifc_5fspec_5fs',['trap_ifc_spec_s',['../structtrap__ifc__spec__s.html',1,'']]], + ['trap_5fifc_5fspec_5ft',['trap_ifc_spec_t',['../group__commonapi.html#ga6a9b60e8305f9c9af1c42b0b1dbac21b',1,'trap.h']]], + ['trap_5fifc_5ftcpip',['TRAP_IFC_TCPIP',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6ae6959499c01e61e64ed29e9ddd966b9d',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5fservice',['TRAP_IFC_TCPIP_SERVICE',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a000d79136dba6246c00948d7f4a7c973',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5funix',['TRAP_IFC_TCPIP_UNIX',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a76ba7a0bc22671335c11ac423e5f9222',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftimeout',['TRAP_IFC_TIMEOUT',['../group__debug.html#ga6a5c62569916c947de8a396111c352d3',1,'trap_internal.h']]], + ['trap_5fifc_5ftype',['trap_ifc_type',['../group__ifctypes.html#gac188fb5e77d8af514d8091c21a9570c8',1,'trap.h']]], + ['trap_5fifc_5ftype_5fblackhole',['TRAP_IFC_TYPE_BLACKHOLE',['../group__ifctypes.html#ga5a22170d15ca946f6ff6549f7fd12a3b',1,'trap.h']]], + ['trap_5fifc_5ftype_5ffile',['TRAP_IFC_TYPE_FILE',['../group__ifctypes.html#ga6d3823643b818be561a49bde77bd34fd',1,'trap.h']]], + ['trap_5fifc_5ftype_5fgenerator',['TRAP_IFC_TYPE_GENERATOR',['../group__ifctypes.html#gaea41bbf6790057fe3c897a27c62dd0cc',1,'trap.h']]], + ['trap_5fifc_5ftype_5fservice',['TRAP_IFC_TYPE_SERVICE',['../group__ifctypes.html#gaf96730d78d9d48881642f5b5683fb513',1,'trap.h']]], + ['trap_5fifc_5ftype_5fsupported',['trap_ifc_type_supported',['../group__ifctypes.html#ga6419b14997f2d75db88aae23213be54e',1,'trap_ifc_type_supported(): trap.c'],['../group__ifctypes.html#ga6419b14997f2d75db88aae23213be54e',1,'trap_ifc_type_supported(): trap.c']]], + ['trap_5fifc_5ftype_5ftcpip',['TRAP_IFC_TYPE_TCPIP',['../group__ifctypes.html#gaac77f233f3bbd4a99f05bc2816377562',1,'trap.h']]], + ['trap_5fifc_5ftype_5ftls',['TRAP_IFC_TYPE_TLS',['../group__ifctypes.html#ga54311acf0e90b37e0c13fb201370882e',1,'trap.h']]], + ['trap_5fifc_5ftype_5funix',['TRAP_IFC_TYPE_UNIX',['../group__ifctypes.html#ga91f122067a6b83738d2b3bc976e7bf0d',1,'trap.h']]], + ['trap_5fifcctl',['trap_ifcctl',['../group__simpleapi.html#ga63de9d9334839f0fe2871ab5a987be32',1,'trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...): trap.c'],['../group__simpleapi.html#ga63de9d9334839f0fe2871ab5a987be32',1,'trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...): trap.c']]], + ['trap_5fifcctl_5frequest',['trap_ifcctl_request',['../group__commonapi.html#gac99821743a91f2288f5ea8d3ae6b424c',1,'trap.h']]], + ['trap_5fin_5fifc_5fcounters',['TRAP_IN_IFC_COUNTERS',['../trap__internal_8h.html#a82b80275c4cd93352d15631373b11d47',1,'trap_internal.h']]], + ['trap_5fin_5fifc_5fstate_5ft',['trap_in_ifc_state_t',['../group__trap__mess__fmt.html#gad79809a2452f1e8a4db4e635fb0bd89e',1,'trap.h']]], + ['trap_5finit',['trap_init',['../group__simpleapi.html#ga7d7849e0fda93ec1502cb55c1b10cc34',1,'trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec): trap.c'],['../group__simpleapi.html#ga7d7849e0fda93ec1502cb55c1b10cc34',1,'trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec): trap.c']]], + ['trap_5finput_5fifc_5fs',['trap_input_ifc_s',['../structtrap__input__ifc__s.html',1,'']]], + ['trap_5finput_5fifc_5ft',['trap_input_ifc_t',['../group__trap__ifc.html#ga7fed1038d017739605bf620f60d86f3d',1,'trap_ifc.h']]], + ['trap_5finternal_2ec',['trap_internal.c',['../trap__internal_8c.html',1,'']]], + ['trap_5finternal_2eh',['trap_internal.h',['../trap__internal_8h.html',1,'']]], + ['trap_5fjson_5fprint_5fstring',['trap_json_print_string',['../trap_8c.html#a87804f44234503c9e31d37702a7706e2',1,'trap.c']]], + ['trap_5flast_5ferror',['trap_last_error',['../structtrap__ctx__priv__s.html#a3df9ece66f6d6a59a99a720f12132539',1,'trap_ctx_priv_s::trap_last_error()'],['../group__simpleapi.html#ga605937391a4c6fbe1510bf4381a8a2b4',1,'trap_last_error(): trap.c'],['../group__simpleapi.html#ga605937391a4c6fbe1510bf4381a8a2b4',1,'trap_last_error(): trap.c']]], + ['trap_5flast_5ferror_5fmsg',['trap_last_error_msg',['../structtrap__ctx__priv__s.html#a9f89537f85add16fd2359ae690999247',1,'trap_ctx_priv_s::trap_last_error_msg()'],['../group__simpleapi.html#ga440c46189a0111c0946583c56e1ff7a9',1,'trap_last_error_msg(): trap.c'],['../group__simpleapi.html#ga440c46189a0111c0946583c56e1ff7a9',1,'trap_last_error_msg(): trap.c']]], + ['trap_5fno_5fauto_5fflush',['TRAP_NO_AUTO_FLUSH',['../group__trap__timeout.html#gaf0f4e37c635e9cfbd6bba0e0c5d6dfb4',1,'trap.h']]], + ['trap_5fno_5fifc_5fsleep',['TRAP_NO_IFC_SLEEP',['../group__debug.html#ga29c56608245e46ad6b69813394d25f86',1,'trap_internal.h']]], + ['trap_5fno_5fwait',['TRAP_NO_WAIT',['../group__trap__timeout.html#gafe708bb8b54eb0ae9ce0c4c5c856422c',1,'trap.h']]], + ['trap_5fout_5fifc_5fcounters',['TRAP_OUT_IFC_COUNTERS',['../trap__internal_8h.html#a6ada33c3047cb067cdb75017f652db28',1,'trap_internal.h']]], + ['trap_5foutput_5fifc_5fs',['trap_output_ifc_s',['../structtrap__output__ifc__s.html',1,'']]], + ['trap_5foutput_5fifc_5ft',['trap_output_ifc_t',['../group__trap__ifc.html#ga67931b1db8d9f47c96534b924252b370',1,'trap_ifc.h']]], + ['trap_5fparse_5fparams',['trap_parse_params',['../group__commonapi.html#gaefbccf1d04407e6d79ab4b8a8307cdf9',1,'trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec): trap.c'],['../group__commonapi.html#gaefbccf1d04407e6d79ab4b8a8307cdf9',1,'trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec): trap.c']]], + ['trap_5fprint_5fhelp',['trap_print_help',['../group__simpleapi.html#gaaec5413b3ef25596138f12ae65e58097',1,'trap_print_help(const trap_module_info_t *module_info): trap.c'],['../group__simpleapi.html#gaaec5413b3ef25596138f12ae65e58097',1,'trap_print_help(const trap_module_info_t *module_info): trap.c']]], + ['trap_5fprint_5fifc_5fspec_5fhelp',['trap_print_ifc_spec_help',['../group__simpleapi.html#ga594bc6f6e105611a06b5e1235796e758',1,'trap_print_ifc_spec_help(): trap.c'],['../group__simpleapi.html#ga594bc6f6e105611a06b5e1235796e758',1,'trap_print_ifc_spec_help(): trap.c']]], + ['trap_5fread_5ffrom_5fbuffer',['trap_read_from_buffer',['../group__buffering.html#ga1b570e9a0c3871ef23cc9fc649a110a1',1,'trap.c']]], + ['trap_5frecv',['trap_recv',['../group__simpleapi.html#gac8149d036a3b839adaeb876ccc9fcda5',1,'trap_recv(uint32_t ifcidx, const void **data, uint16_t *size): trap.c'],['../group__simpleapi.html#gac8149d036a3b839adaeb876ccc9fcda5',1,'trap_recv(uint32_t ifcidx, const void **data, uint16_t *size): trap.c']]], + ['trap_5fregister_5fdefault_5fsignal_5fhandler',['TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER',['../group__modulemacros.html#gac8220e39691301a291b09aa9fd7616c0',1,'trap.h']]], + ['trap_5fsend',['trap_send',['../group__simpleapi.html#ga165b017fa4b66422275c4e502ac95d2a',1,'trap_send(uint32_t ifcidx, const void *data, uint16_t size): trap.c'],['../group__simpleapi.html#ga165b017fa4b66422275c4e502ac95d2a',1,'trap_send(uint32_t ifcidx, const void *data, uint16_t size): trap.c']]], + ['trap_5fsend_5fdata',['trap_send_data',['../group__simpleapi.html#gab889fdf90a8a4103bfa072c64d2aed1e',1,'trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout): trap.c'],['../group__simpleapi.html#gab889fdf90a8a4103bfa072c64d2aed1e',1,'trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout): trap.c']]], + ['trap_5fsend_5fflush',['trap_send_flush',['../group__simpleapi.html#ga52ebce274203e2f54abc1ef487090618',1,'trap_send_flush(uint32_t ifc): trap.c'],['../group__simpleapi.html#ga52ebce274203e2f54abc1ef487090618',1,'trap_send_flush(uint32_t ifc): trap.c']]], + ['trap_5fset_5fabs_5ftimespec',['trap_set_abs_timespec',['../group__trap__ifc.html#gaa5100d1b2d961dbaf9ffa58aaebd6050',1,'trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk): trap.c'],['../group__trap__ifc.html#gaa5100d1b2d961dbaf9ffa58aaebd6050',1,'trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk): trap.c']]], + ['trap_5fset_5fdata_5ffmt',['trap_set_data_fmt',['../group__trap__mess__fmt.html#gaafa4932ad483eceed010a6b84972df02',1,'trap.c']]], + ['trap_5fset_5fhelp_5fsection',['trap_set_help_section',['../group__simpleapi.html#ga780616f8da6339da2c3f11441a6e0f91',1,'trap_set_help_section(int level): trap.c'],['../group__simpleapi.html#ga780616f8da6339da2c3f11441a6e0f91',1,'trap_set_help_section(int level): trap.c']]], + ['trap_5fset_5frequired_5ffmt',['trap_set_required_fmt',['../group__trap__mess__fmt.html#ga36d50e3cf2e6fdb959e7e5af660947f1',1,'trap.c']]], + ['trap_5fset_5ftimeouts',['trap_set_timeouts',['../group__trap__ifc.html#ga60d0627e30a6d9a3a8d3caf70f7137e4',1,'trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk): trap.c'],['../group__trap__ifc.html#ga60d0627e30a6d9a3a8d3caf70f7137e4',1,'trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk): trap.c']]], + ['trap_5fset_5fverbose_5flevel',['trap_set_verbose_level',['../group__simpleapi.html#ga896b102140653a204da81782981e04f6',1,'trap_set_verbose_level(int level): trap.c'],['../group__simpleapi.html#ga896b102140653a204da81782981e04f6',1,'trap_set_verbose_level(int level): trap.c']]], + ['trap_5fterminate',['trap_terminate',['../group__simpleapi.html#ga4fc7c94bc72b9400ea765187882d532e',1,'trap_terminate(): trap.c'],['../group__simpleapi.html#ga4fc7c94bc72b9400ea765187882d532e',1,'trap_terminate(): trap.c']]], + ['trap_20timeout',['TRAP Timeout',['../group__trap__timeout.html',1,'']]], + ['trap_5ftimeout_5fstr',['TRAP_TIMEOUT_STR',['../group__trap__timeout.html#ga5a6b1a7cda4408951076eaff4d4cf196',1,'trap.h']]], + ['trap_5fupdate_5fmodule_5fparam',['trap_update_module_param',['../trap_8c.html#a63b7ddacd43d8be38ac3d3c18b374aa1',1,'trap.c']]], + ['trap_5fverbose',['trap_verbose',['../group__debug.html#gaf2a32a74fdc82cfc2f13a9a8e4d32da1',1,'trap_verbose(): trap_internal.c'],['../group__debug.html#gaf2a32a74fdc82cfc2f13a9a8e4d32da1',1,'trap_verbose(): trap_internal.c']]], + ['trap_5fverbose_5flevel',['trap_verbose_level',['../group__debug.html#ga026a516df99452f5adc8c51e6703f5b5',1,'trap_internal.h']]], + ['trap_5fverbose_5flevel_5ft',['trap_verbose_level_t',['../group__debug.html#ga9545680da8da49e3a0a59af63ff204ef',1,'trap_internal.h']]], + ['trap_5fverbose_5fmsg',['trap_verbose_msg',['../group__debug.html#gadc507c418b7b19701be88c6b8438c7f9',1,'trap_verbose_msg(int level, char *string): trap_internal.c'],['../group__debug.html#gadc507c418b7b19701be88c6b8438c7f9',1,'trap_verbose_msg(int level, char *string): trap_internal.c']]], + ['trap_5fversion',['trap_version',['../group__commonapi.html#gabc3ef5d4460eee3691cc57d54ad3ee04',1,'trap.h']]], + ['trap_5fwait',['TRAP_WAIT',['../group__trap__timeout.html#ga156f1352bbbff4850a36dbb81b0a7d5b',1,'trap.h']]], + ['trapctl_5fautoflush_5ftimeout',['TRAPCTL_AUTOFLUSH_TIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca69ebb9c0a47e7aa0c21440a6373e083a',1,'trap.h']]], + ['trapctl_5fbufferswitch',['TRAPCTL_BUFFERSWITCH',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca0698228277af04dfe4c5565de8263538',1,'trap.h']]], + ['trapctl_5fsettimeout',['TRAPCTL_SETTIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca7c42332f519ee4671d7f674198d6a023',1,'trap.h']]], + ['trapifc_5fin_5fconstruct',['trapifc_in_construct',['../group__contextapi.html#ga8e3bd04c657631263c17fa9aa05d39e7',1,'trap.c']]], + ['trapifc_5finput',['TRAPIFC_INPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a95482ca4ea5f849965438493b6c5640c',1,'trap.h']]], + ['trapifc_5fout_5fconstruct',['trapifc_out_construct',['../group__contextapi.html#ga30009499f64ee53baecf6b01263d9875',1,'trap.c']]], + ['trapifc_5foutput',['TRAPIFC_OUTPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a3465118a68f82fd201ec4ce516f687aa',1,'trap.h']]], + ['types',['types',['../structtrap__ifc__spec__s.html#a6af4e85e62b9408f48e264516c5a4eae',1,'trap_ifc_spec_s']]] +]; diff --git a/doc/libtrap-devel/search/all_13.html b/doc/libtrap-devel/search/all_13.html new file mode 100644 index 00000000..04f66e2f --- /dev/null +++ b/doc/libtrap-devel/search/all_13.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_13.js b/doc/libtrap-devel/search/all_13.js new file mode 100644 index 00000000..7ae92669 --- /dev/null +++ b/doc/libtrap-devel/search/all_13.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['unix_5faddr',['unix_addr',['../uniontcpip__socket__addr.html#af3851c41de7540cb7c6cbef21b04a850',1,'tcpip_socket_addr::unix_addr()'],['../uniontls__socket__addr.html#aa3a8625b304cdbce27b115c951abbae3',1,'tls_socket_addr::unix_addr()']]], + ['unix_5fpath_5ffilename_5fformat',['UNIX_PATH_FILENAME_FORMAT',['../ifc__tcpip_8h.html#a9a43a10e1db0d4d4f9254776ca795d51',1,'ifc_tcpip.h']]], + ['usec_5fin_5fsec',['USEC_IN_SEC',['../group__tcpip__ifc.html#ga72467fb3c401ef8777d20cf99416e39e',1,'USEC_IN_SEC(): ifc_tcpip.c'],['../group__tls__ifc.html#ga72467fb3c401ef8777d20cf99416e39e',1,'USEC_IN_SEC(): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/all_14.html b/doc/libtrap-devel/search/all_14.html new file mode 100644 index 00000000..285f34bd --- /dev/null +++ b/doc/libtrap-devel/search/all_14.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_14.js b/doc/libtrap-devel/search/all_14.js new file mode 100644 index 00000000..d6958e63 --- /dev/null +++ b/doc/libtrap-devel/search/all_14.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['verbose',['VERBOSE',['../group__debug.html#gaf41c235c816be278fc13d4e09742c2fe',1,'trap_internal.h']]], + ['verify_5fcertificate',['verify_certificate',['../group__tls__ifc.html#ga1b1be6968656713b283b9918b310a0dc',1,'ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/all_15.html b/doc/libtrap-devel/search/all_15.html new file mode 100644 index 00000000..0ed74e01 --- /dev/null +++ b/doc/libtrap-devel/search/all_15.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_15.js b/doc/libtrap-devel/search/all_15.js new file mode 100644 index 00000000..7fe3940a --- /dev/null +++ b/doc/libtrap-devel/search/all_15.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['wait_5ffor_5fconnection',['wait_for_connection',['../group__tcpip__receiver.html#gaad3458f11c60698cc6a994bb9f812e2c',1,'wait_for_connection(int sock, struct timeval *tv): ifc_tcpip.c'],['../group__tls__receiver.html#gaad3458f11c60698cc6a994bb9f812e2c',1,'wait_for_connection(int sock, struct timeval *tv): ifc_tls.c']]], + ['wr_5findex',['wr_index',['../structfile__buffer__s.html#ab829db2e26b5af715fb2346977d8fd7b',1,'file_buffer_s::wr_index()'],['../structbuffer__s.html#a0fa940aa266e3ea33e46a13c1a570a3f',1,'buffer_s::wr_index()']]] +]; diff --git a/doc/libtrap-devel/search/all_16.html b/doc/libtrap-devel/search/all_16.html new file mode 100644 index 00000000..696f0252 --- /dev/null +++ b/doc/libtrap-devel/search/all_16.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_16.js b/doc/libtrap-devel/search/all_16.js new file mode 100644 index 00000000..e90ffc26 --- /dev/null +++ b/doc/libtrap-devel/search/all_16.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['x',['X',['../ifc__tcpip_8c.html#a53042471e9975ea6e004fafe0266f1c9',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a618c2e7d70c13a7d7f980ce67333f0ee',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tcpip.c'],['../ifc__tls_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tls.c'],['../trap_8c.html#a93ee0641006e250f610013636769b06d',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c']]] +]; diff --git a/doc/libtrap-devel/search/all_2.html b/doc/libtrap-devel/search/all_2.html new file mode 100644 index 00000000..2f17735e --- /dev/null +++ b/doc/libtrap-devel/search/all_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_2.js b/doc/libtrap-devel/search/all_2.js new file mode 100644 index 00000000..89ab7b1a --- /dev/null +++ b/doc/libtrap-devel/search/all_2.js @@ -0,0 +1,23 @@ +var searchData= +[ + ['blackhole_5fdestroy',['blackhole_destroy',['../ifc__dummy_8c.html#ac56203fa44517d4715c2a3217106ced2',1,'ifc_dummy.c']]], + ['blackhole_5fflush',['blackhole_flush',['../ifc__dummy_8c.html#a10b1f70e84c818d39d44894d923b938e',1,'ifc_dummy.c']]], + ['blackhole_5fget_5fclient_5fcount',['blackhole_get_client_count',['../ifc__dummy_8c.html#a3a87d918cf7dc8762ca7b7c175e66afd',1,'ifc_dummy.c']]], + ['blackhole_5fget_5fclient_5fstats_5fjson',['blackhole_get_client_stats_json',['../ifc__dummy_8c.html#abfd570c7ba9523508aa88b80326048e7',1,'ifc_dummy.c']]], + ['blackhole_5fifc_5fget_5fid',['blackhole_ifc_get_id',['../ifc__dummy_8c.html#ad8ce96b416b251a97c0018dfe2d755be',1,'ifc_dummy.c']]], + ['blackhole_5fsend',['blackhole_send',['../ifc__dummy_8c.html#a9a7c40601ef4e8017c3d2a36b758b716',1,'ifc_dummy.c']]], + ['blackhole_5fterminate',['blackhole_terminate',['../ifc__dummy_8c.html#ab392f3cf1b0144994ee015604f4dc216',1,'ifc_dummy.c']]], + ['buffer',['buffer',['../structfile__private__s.html#a8ff9df8afeac5f74c30f019ae696b256',1,'file_private_s::buffer()'],['../structtrap__input__ifc__s.html#a87780edf8780e7716d55f54071a5fa76',1,'trap_input_ifc_s::buffer()']]], + ['buffer_5fcount',['buffer_count',['../structtcpip__sender__private__s.html#a29dd6625940588237aebf9f69ed1adc8',1,'tcpip_sender_private_s::buffer_count()'],['../structtls__sender__private__s.html#a5e1631f2bf5115bee0078dce29560b49',1,'tls_sender_private_s::buffer_count()']]], + ['buffer_5fcount_5fparam_5flength',['BUFFER_COUNT_PARAM_LENGTH',['../ifc__socket__common_8h.html#ae22b2c9c46dc10414c8d881852a0fc1b',1,'ifc_socket_common.h']]], + ['buffer_5fpointer',['buffer_pointer',['../structtrap__input__ifc__s.html#a1161fe2715f7d7764780113652abf065',1,'trap_input_ifc_s']]], + ['buffer_5fs',['buffer_s',['../structbuffer__s.html',1,'']]], + ['buffer_5fsize',['buffer_size',['../structfile__private__s.html#a13716e3cdd9c15f593fcf2958829613c',1,'file_private_s::buffer_size()'],['../structtcpip__sender__private__s.html#a4df87fb84906232ded39166388dc682c',1,'tcpip_sender_private_s::buffer_size()'],['../structtls__sender__private__s.html#ab5718a15499529368bd5b35ced602367',1,'tls_sender_private_s::buffer_size()']]], + ['buffer_5fsize_5fparam_5flength',['BUFFER_SIZE_PARAM_LENGTH',['../ifc__socket__common_8h.html#a3604cb3c53c3d7a47be21b88c67f7d4e',1,'ifc_socket_common.h']]], + ['buffer_5ft',['buffer_t',['../ifc__socket__common_8h.html#a9aa12143b2c71bd60b9418ee7f4d3bb6',1,'ifc_socket_common.h']]], + ['buffer_5funread_5fbytes',['buffer_unread_bytes',['../structtrap__input__ifc__s.html#a073bfa12bdb89c7093a03a1beb8ecfc2',1,'trap_input_ifc_s']]], + ['buffering_20sublayer',['Buffering sublayer',['../group__buffering.html',1,'']]], + ['buffers',['buffers',['../structtcpip__sender__private__s.html#a4e8c10eab95a85dc2432062f23106d2e',1,'tcpip_sender_private_s::buffers()'],['../structtls__sender__private__s.html#acde38ffd6ba0f6e3c369f672a21e25e8',1,'tls_sender_private_s::buffers()']]], + ['bufferswitch',['bufferswitch',['../structtrap__output__ifc__s.html#a7ce082171e11f211070d8835a9b62db1',1,'trap_output_ifc_s']]], + ['bufferswitch_5ffixed',['bufferswitch_fixed',['../structtrap__output__ifc__s.html#a65eadcfdc7a5021dbbc985161fe9369b',1,'trap_output_ifc_s']]] +]; diff --git a/doc/libtrap-devel/search/all_3.html b/doc/libtrap-devel/search/all_3.html new file mode 100644 index 00000000..a3e6f7db --- /dev/null +++ b/doc/libtrap-devel/search/all_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_3.js b/doc/libtrap-devel/search/all_3.js new file mode 100644 index 00000000..b20eb204 --- /dev/null +++ b/doc/libtrap-devel/search/all_3.js @@ -0,0 +1,50 @@ +var searchData= +[ + ['cafile',['cafile',['../structtls__sender__private__s.html#a0c9cd9cec3ca174563f41532172e90f4',1,'tls_sender_private_s::cafile()'],['../structtls__receiver__private__s.html#a39c7d6c5ea6416a2b5d072bcfb7c0f2e',1,'tls_receiver_private_s::cafile()']]], + ['certfile',['certfile',['../structtls__sender__private__s.html#a33339810bcd649fb009e7167c1346d58',1,'tls_sender_private_s::certfile()'],['../structtls__receiver__private__s.html#ab46c84a4ec6e7053a2bf54589b9eae39',1,'tls_receiver_private_s::certfile()']]], + ['check_5findex',['check_index',['../ifc__socket__common_8h.html#ae012366578b1a5928acb569f5792a8e4',1,'ifc_socket_common.h']]], + ['check_5fportrange',['check_portrange',['../group__tcpip__ifc.html#ga0925b2a05afa60bb981a19d2e76cc2d2',1,'ifc_tcpip.c']]], + ['cl_5ferror',['CL_ERROR',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5a7d2d5c2be626b647030d2a96dca9c25c',1,'trap_internal.h']]], + ['cl_5fverbose_5fadvanced',['CL_VERBOSE_ADVANCED',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5a70e0896f569c67e5ffd85846345fa494',1,'trap_internal.h']]], + ['cl_5fverbose_5fbasic',['CL_VERBOSE_BASIC',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5ac7c6ab33e3db6df58d41132611a86332',1,'trap_internal.h']]], + ['cl_5fverbose_5flibrary',['CL_VERBOSE_LIBRARY',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5ac93a326ee9cdda52bc41f878b73f2aaf',1,'trap_internal.h']]], + ['cl_5fverbose_5foff',['CL_VERBOSE_OFF',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5aa9ab9cf91ada6d27372253af6807226a',1,'trap_internal.h']]], + ['cl_5fwarning',['CL_WARNING',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5aae8f3e688028c2bf0324ef1b0abb5469',1,'trap_internal.h']]], + ['client_5fs',['client_s',['../structclient__s.html',1,'']]], + ['client_5fsocket_5fconnect',['client_socket_connect',['../group__tcpip__receiver.html#gab162898982b46b7d50290308ef3eb769',1,'client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv): ifc_tcpip.c'],['../group__tls__receiver.html#ga7108575bc12d369768a50cf8e6198e68',1,'client_socket_connect(tls_receiver_private_t *c, struct timeval *tv): ifc_tls.c']]], + ['client_5fsocket_5fdisconnect',['client_socket_disconnect',['../group__tcpip__receiver.html#ga7d3a1df60320e3e2c58be93bdec7e452',1,'client_socket_disconnect(void *priv): ifc_tcpip.c'],['../group__tls__receiver.html#ga7d3a1df60320e3e2c58be93bdec7e452',1,'client_socket_disconnect(void *priv): ifc_tls.c']]], + ['client_5fstate',['client_state',['../structtrap__input__ifc__s.html#a2376f3c21323e16da224419553f5b0b1',1,'trap_input_ifc_s']]], + ['client_5ft',['client_t',['../group__tcpip__sender.html#ga8db229da62af6e778b15d0dfeab62c2d',1,'ifc_tcpip_internal.h']]], + ['clients',['clients',['../structtcpip__sender__private__s.html#a412b6897ac143d737be4975c10a867d7',1,'tcpip_sender_private_s::clients()'],['../structtls__sender__private__s.html#a823f0044374b027154d88eea92347eb3',1,'tls_sender_private_s::clients()']]], + ['clients_5farr_5fsize',['clients_arr_size',['../structtcpip__sender__private__s.html#a02a377a621708255d892ada0c673cc3d',1,'tcpip_sender_private_s::clients_arr_size()'],['../structtls__sender__private__s.html#a00bed81250e7d1d9535282689cda77ec',1,'tls_sender_private_s::clients_arr_size()']]], + ['clients_5fbit_5farr',['clients_bit_arr',['../structbuffer__s.html#a0e0434b25109353c3306cbc5636c06e0',1,'buffer_s::clients_bit_arr()'],['../structtcpip__sender__private__s.html#a5abdcd36392cb8f8d064c0f0923bf80a',1,'tcpip_sender_private_s::clients_bit_arr()'],['../structtls__sender__private__s.html#a02d907d63b75a2b192089a8b317fa392',1,'tls_sender_private_s::clients_bit_arr()']]], + ['clients_5fpfds',['clients_pfds',['../structtcpip__sender__private__s.html#a8f36f7fc99dbeff1c3b12efb94dead82',1,'tcpip_sender_private_s']]], + ['com',['com',['../structmsg__header__s.html#ad82826f258d15be6d9f75ffdb4807218',1,'msg_header_s']]], + ['common_20libtrap_20api',['Common libtrap API',['../group__commonapi.html',1,'']]], + ['cond_5ffull_5fbuffer',['cond_full_buffer',['../structtcpip__sender__private__s.html#a3d50d013267786b222ddaedef253200f',1,'tcpip_sender_private_s::cond_full_buffer()'],['../structtls__sender__private__s.html#aa090c48986159a77c6cba2f47f242cc4',1,'tls_sender_private_s::cond_full_buffer()']]], + ['cond_5fno_5fdata',['cond_no_data',['../structtcpip__sender__private__s.html#ac6f604e6c4f8ecf8e440277b6e05efe8',1,'tcpip_sender_private_s::cond_no_data()'],['../structtls__sender__private__s.html#a4330546abe8d147885440cb91b89d9d5',1,'tls_sender_private_s::cond_no_data()']]], + ['connected',['connected',['../structtcpip__receiver__private__s.html#a981dafd77ae2442f3d21a4fd2e9758b9',1,'tcpip_receiver_private_s::connected()'],['../structtls__receiver__private__s.html#a54f6857f38498677fdfe125dfa0a3734',1,'tls_receiver_private_s::connected()']]], + ['connected_5fclients',['connected_clients',['../structtcpip__sender__private__s.html#a4810967e529ac208af0b5f7cb0677348',1,'tcpip_sender_private_s::connected_clients()'],['../structtls__sender__private__s.html#a9b3305cd83e88e536c09444a29161f84',1,'tls_sender_private_s::connected_clients()']]], + ['context_20api',['Context API',['../group__contextapi.html',1,'']]], + ['counter_5fautoflush',['counter_autoflush',['../group__ctxifccounters.html#gae918d788c4f2e3b77fc3e3c9d7eef7a3',1,'trap_ctx_priv_s']]], + ['counter_5fdropped_5fmessage',['counter_dropped_message',['../group__ctxifccounters.html#gab13490f32b1a27c2df99426d665ef9b7',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fbuffer',['counter_recv_buffer',['../group__ctxifccounters.html#gabf8d83b97e6807743758827a9627a7b9',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fdelay_5flast',['counter_recv_delay_last',['../group__ctxifccounters.html#ga5e34bd70f9d3373186a8bf6d5870733f',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fdelay_5ftotal',['counter_recv_delay_total',['../group__ctxifccounters.html#ga94165668161797455663b67406badc8c',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fmessage',['counter_recv_message',['../group__ctxifccounters.html#ga595bb998ac7a9257d8eb1bcb2b253311',1,'trap_ctx_priv_s']]], + ['counter_5fsend_5fbuffer',['counter_send_buffer',['../group__ctxifccounters.html#ga2567b4aa09c5832bd1bc7820bd6f60e7',1,'trap_ctx_priv_s']]], + ['counter_5fsend_5fmessage',['counter_send_message',['../group__ctxifccounters.html#ga6b244b237ff990977c8d2ecf7bd3c714',1,'trap_ctx_priv_s']]], + ['create_5fblackhole_5fifc',['create_blackhole_ifc',['../ifc__dummy_8c.html#ab7edb3a6122008f3ea180f8adad08117',1,'create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc): ifc_dummy.c'],['../ifc__dummy_8h.html#ab7edb3a6122008f3ea180f8adad08117',1,'create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc): ifc_dummy.c']]], + ['create_5fdump',['create_dump',['../structtrap__input__ifc__s.html#adf4d5b5be596232cb87f46aeb07df730',1,'trap_input_ifc_s::create_dump()'],['../structtrap__output__ifc__s.html#af2e7f89eb3c80aedc8fd08ac6d68f5bf',1,'trap_output_ifc_s::create_dump()'],['../ifc__dummy_8c.html#a064d9b95d6510856a0eba2cadd7d4f66',1,'create_dump(): ifc_dummy.c']]], + ['create_5ffile_5frecv_5fifc',['create_file_recv_ifc',['../group__file__receiver.html#gadc3824536a691ef65c730c0047ae1f6c',1,'create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_file.c'],['../group__file__receiver.html#gadc3824536a691ef65c730c0047ae1f6c',1,'create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_file.c']]], + ['create_5ffile_5fsend_5fifc',['create_file_send_ifc',['../group__file__sender.html#ga5c7c2366ebad27e5ff4e66322ed7ec73',1,'create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_file.c'],['../group__file__sender.html#ga5c7c2366ebad27e5ff4e66322ed7ec73',1,'create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_file.c']]], + ['create_5fgenerator_5fifc',['create_generator_ifc',['../ifc__dummy_8c.html#a6e7d094e5d1db868b323b52fa76b9636',1,'create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc): ifc_dummy.c'],['../ifc__dummy_8h.html#a6e7d094e5d1db868b323b52fa76b9636',1,'create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc): ifc_dummy.c']]], + ['create_5fnext_5ffilename',['create_next_filename',['../group__file__ifc.html#gaeb8c7500558d6d4827acfab569d2b0af',1,'ifc_file.c']]], + ['create_5ftcpip_5freceiver_5fifc',['create_tcpip_receiver_ifc',['../group__tcpip__receiver.html#gae9c7c5600b33d5225fe4a8d04a1b3af2',1,'create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c'],['../group__tcpip__receiver.html#gae9c7c5600b33d5225fe4a8d04a1b3af2',1,'create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t itx, enum tcpip_ifc_sockettype type): ifc_tcpip.c']]], + ['create_5ftcpip_5fsender_5fifc',['create_tcpip_sender_ifc',['../group__tcpip__sender.html#ga19dfb1ff5fc8916e8c4bd1e0800bf9df',1,'create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c'],['../group__tcpip__sender.html#ga19dfb1ff5fc8916e8c4bd1e0800bf9df',1,'create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c']]], + ['create_5ftime',['create_time',['../structfile__private__s.html#a3a3694d34807552bdc40f4e1dfe9ba57',1,'file_private_s']]], + ['create_5ftls_5freceiver_5fifc',['create_tls_receiver_ifc',['../group__tls__receiver.html#ga825fd4776caae6897e8c8e941fe4de33',1,'create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_tls.c'],['../group__tls__receiver.html#ga825fd4776caae6897e8c8e941fe4de33',1,'create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_tls.c']]], + ['create_5ftls_5fsender_5fifc',['create_tls_sender_ifc',['../group__tls__sender.html#ga70f857962c64531165db580c0820f9d7',1,'create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_tls.c'],['../group__tls__sender.html#ga70f857962c64531165db580c0820f9d7',1,'create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_tls.c']]], + ['crit_5f1vs2send',['CRIT_1VS2SEND',['../group__tcpip__ifc.html#gaa1aebd3c98a8a810d1ff3f933d415805',1,'CRIT_1VS2SEND(): ifc_tcpip.c'],['../group__tls__ifc.html#gaa1aebd3c98a8a810d1ff3f933d415805',1,'CRIT_1VS2SEND(): ifc_tls.c']]], + ['ctx',['ctx',['../structgenerator__private__s.html#a1a6188d5c588d98d1f5eb02e51cf58c2',1,'generator_private_s::ctx()'],['../structfile__private__s.html#ae5af1c6b080272c106d3e397a3190bb5',1,'file_private_s::ctx()'],['../structtcpip__sender__private__s.html#aa77c2248885aef1d8c3eb76dae5ffc9d',1,'tcpip_sender_private_s::ctx()'],['../structtcpip__receiver__private__s.html#ad37a1a719a07f93ac8110463c8d89894',1,'tcpip_receiver_private_s::ctx()'],['../structtls__sender__private__s.html#a0a536abae4016eeb276e63830a4a3117',1,'tls_sender_private_s::ctx()'],['../structtls__receiver__private__s.html#a2b90d739337a901fe0aa0956468037ee',1,'tls_receiver_private_s::ctx()']]] +]; diff --git a/doc/libtrap-devel/search/all_4.html b/doc/libtrap-devel/search/all_4.html new file mode 100644 index 00000000..6452295d --- /dev/null +++ b/doc/libtrap-devel/search/all_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_4.js b/doc/libtrap-devel/search/all_4.js new file mode 100644 index 00000000..bf9f8d99 --- /dev/null +++ b/doc/libtrap-devel/search/all_4.js @@ -0,0 +1,33 @@ +var searchData= +[ + ['data',['data',['../structfile__buffer__s.html#a919ba393df19d1834772b610ca3f25fe',1,'file_buffer_s::data()'],['../structbuffer__s.html#ac522c6bea3709dcbfb638b5c49e70a6f',1,'buffer_s::data()'],['../structtrap__buffer__header__s.html#aae10443c28056e457903d575569b0d28',1,'trap_buffer_header_s::data()'],['../trap__internal_8h.html#ac3c027f9a365f5741871df5ace13943f',1,'data(): trap_internal.h']]], + ['data_5ffmt_5fspec',['data_fmt_spec',['../structtrap__input__ifc__s.html#a79c2aec80238bff3237d36d51f8a2243',1,'trap_input_ifc_s::data_fmt_spec()'],['../structtrap__output__ifc__s.html#a093102d7e5d3d6d4bd826e4a24263d11',1,'trap_output_ifc_s::data_fmt_spec()']]], + ['data_5ffmt_5fspec_5fsize',['data_fmt_spec_size',['../structhello__msg__header__s.html#ae37e4704fcec4bf662271a2d1a8b5620',1,'hello_msg_header_s']]], + ['data_5flength',['data_length',['../structtrap__buffer__header__s.html#aed3f6bcfd1e281004b06a20ba2fda99d',1,'trap_buffer_header_s::data_length()'],['../trap__internal_8h.html#af0cc3d1d5957cce931bb8e02130c6550',1,'data_length(): trap_internal.h']]], + ['data_5fpointer',['data_pointer',['../structtcpip__receiver__private__s.html#ae8cec0ad2ee75a4155cb96923e735e4d',1,'tcpip_receiver_private_s::data_pointer()'],['../structtls__receiver__private__s.html#aa1f10de57ccc5896e79d29c1c8d7865b',1,'tls_receiver_private_s::data_pointer()']]], + ['data_5fsize',['data_size',['../structgenerator__private__s.html#ac4d0225c08ddc2576ac4f615b6fd0d08',1,'generator_private_s::data_size()'],['../structmsg__header__s.html#a73a8038fa9802846f520cd6595acd659',1,'msg_header_s::data_size()']]], + ['data_5fto_5fsend',['data_to_send',['../structgenerator__private__s.html#a5267d7eae706c2f8f0bfbe0d24e6842a',1,'generator_private_s']]], + ['data_5ftype',['data_type',['../structtrap__input__ifc__s.html#af0736e926bbf4a185c5e31581c35be87',1,'trap_input_ifc_s::data_type()'],['../structtrap__output__ifc__s.html#af9c88c83b303ca2a3c1a2276215798d1',1,'trap_output_ifc_s::data_type()'],['../structhello__msg__header__s.html#af5c9eb543221381b46a917b4e4a77d0d',1,'hello_msg_header_s::data_type()']]], + ['data_5fwait_5fsize',['data_wait_size',['../structtcpip__receiver__private__s.html#aaf78da3865264b84f90d2aa6a799edd6',1,'tcpip_receiver_private_s::data_wait_size()'],['../structtls__receiver__private__s.html#a67fa5b6ad8f2119bb56d37f6a3ac9c3e',1,'tls_receiver_private_s::data_wait_size()']]], + ['datatimeout',['datatimeout',['../structtrap__input__ifc__s.html#a4c37dc3eb2f6cfb02bd3828fa3ea8fb4',1,'trap_input_ifc_s::datatimeout()'],['../structtrap__output__ifc__s.html#abb71b89e140f0ee7a6d9af206b6cfb67',1,'trap_output_ifc_s::datatimeout()']]], + ['datatimeout_5ffixed',['datatimeout_fixed',['../structtrap__input__ifc__s.html#a9050603d789b2ce45a6107f8b0f082f8',1,'trap_input_ifc_s::datatimeout_fixed()'],['../structtrap__output__ifc__s.html#a3f6cd83e1b2ec500efa23323f3dce5e1',1,'trap_output_ifc_s::datatimeout_fixed()']]], + ['debug_5fbuf',['DEBUG_BUF',['../group__debug.html#gaca33582f6f59846d3883aaa5cafbc255',1,'trap_internal.h']]], + ['debug_5fifc',['DEBUG_IFC',['../group__debug.html#ga0fcd05fb668244871f6aa40e3ede934c',1,'trap_internal.h']]], + ['default_5fbuffer_5fcount',['DEFAULT_BUFFER_COUNT',['../ifc__socket__common_8h.html#abb7814611632e59302550e4bbdfc2005',1,'ifc_socket_common.h']]], + ['default_5fbuffer_5fsize',['DEFAULT_BUFFER_SIZE',['../ifc__socket__common_8h.html#a6e576a3c6530636d68b7a220480bcd32',1,'ifc_socket_common.h']]], + ['default_5ferr_5fmsg',['default_err_msg',['../trap__error_8c.html#a1eb88024c15fe7f4533fe79a397bfbc4',1,'default_err_msg(): trap_error.c'],['../trap__error_8h.html#a1eb88024c15fe7f4533fe79a397bfbc4',1,'default_err_msg(): trap_error.c']]], + ['default_5fmax_5fclients',['DEFAULT_MAX_CLIENTS',['../ifc__socket__common_8h.html#abb5b90442e7148e1b85e6879c2e0efc9',1,'ifc_socket_common.h']]], + ['default_5fmax_5fdata_5flength',['DEFAULT_MAX_DATA_LENGTH',['../ifc__socket__common_8h.html#afcd38906d9a32f5e20c50141c8f0bf14',1,'ifc_socket_common.h']]], + ['default_5fmax_5fterminal_5fwidth',['DEFAULT_MAX_TERMINAL_WIDTH',['../trap__internal_8h.html#ad3274a76aef689d61eef22cfce054a32',1,'trap_internal.h']]], + ['default_5fsocket_5fformat',['DEFAULT_SOCKET_FORMAT',['../ifc__tcpip_8h.html#a3f82a78a0f6bc22720d5d62919a3a756',1,'ifc_tcpip.h']]], + ['del_5findex',['del_index',['../ifc__socket__common_8h.html#a7eb87b37dc056b1535404fdc12a42bd3',1,'ifc_socket_common.h']]], + ['deprecated_20list',['Deprecated List',['../deprecated.html',1,'']]], + ['dest_5faddr',['dest_addr',['../structtcpip__receiver__private__s.html#a111fa5f95510969bfd4e925edf7237d4',1,'tcpip_receiver_private_s::dest_addr()'],['../structtls__receiver__private__s.html#a8f3cfa12b5fa34c4de91aac7f1c51c7c',1,'tls_receiver_private_s::dest_addr()']]], + ['dest_5fport',['dest_port',['../structtcpip__receiver__private__s.html#a7ea56509c6a257092d8368a4ad590742',1,'tcpip_receiver_private_s::dest_port()'],['../structtls__receiver__private__s.html#ac28adda0e00270bfb2d9807bf7dc9aeb',1,'tls_receiver_private_s::dest_port()']]], + ['destroy',['destroy',['../structtrap__input__ifc__s.html#aae8d7a18be825294c20f629153462116',1,'trap_input_ifc_s::destroy()'],['../structtrap__output__ifc__s.html#a979738421c4f54f28541d215e5a8d799',1,'trap_output_ifc_s::destroy()']]], + ['development_20of_20libtrap_20interface',['Development of libtrap interface',['../devel-ifc.html',1,'']]], + ['develop_2dinterface_2etxt',['develop-interface.txt',['../develop-interface_8txt.html',1,'']]], + ['disconn_5fclients',['disconn_clients',['../structtrap__output__ifc__s.html#a8a0e19f2cf99eafe6de0b4b116946c34',1,'trap_output_ifc_s']]], + ['disconnect_5fclient',['disconnect_client',['../group__tcpip__sender.html#gad8033ef37f49bbe4b01b29a511f107a7',1,'disconnect_client(tcpip_sender_private_t *priv, int cl_id): ifc_tcpip.c'],['../group__tls__sender.html#ga10574da0c956724741173a3fe5c8eea3',1,'disconnect_client(tls_sender_private_t *priv, int cl_id): ifc_tls.c']]], + ['development_20documentation',['Development documentation',['../index.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/all_5.html b/doc/libtrap-devel/search/all_5.html new file mode 100644 index 00000000..e59e1d53 --- /dev/null +++ b/doc/libtrap-devel/search/all_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_5.js b/doc/libtrap-devel/search/all_5.js new file mode 100644 index 00000000..91d06f78 --- /dev/null +++ b/doc/libtrap-devel/search/all_5.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['encode_5fcnts_5fto_5fjson',['encode_cnts_to_json',['../group__supervisor.html#gac987671508929a3664e703d9884fc58b',1,'trap.c']]], + ['environ',['environ',['../trap_8c.html#aa006daaf11f1e2e45a6ababaf463212b',1,'trap.c']]], + ['error_5fmsg_5fbuffer',['error_msg_buffer',['../structtrap__ctx__priv__s.html#aeef7583ee81ee1466988bfb119cfe2f6',1,'trap_ctx_priv_s::error_msg_buffer()'],['../trap_8c.html#a49a03fbb455c0e359822206aca324a11',1,'error_msg_buffer(): trap.c']]], + ['error_5fmtx',['error_mtx',['../structtrap__ctx__priv__s.html#a1ac9f3b84a8531e68be50a39c21e0126',1,'trap_ctx_priv_s']]], + ['error_20codes',['Error codes',['../group__errorcodes.html',1,'']]], + ['ext_5fbuffer',['ext_buffer',['../structtcpip__receiver__private__s.html#a8ad662859f70d5f9273786d5463f75a4',1,'tcpip_receiver_private_s::ext_buffer()'],['../structtls__receiver__private__s.html#a4bd1b8948058470972de12b89ef84c9f',1,'tls_receiver_private_s::ext_buffer()']]], + ['ext_5fbuffer_5fsize',['ext_buffer_size',['../structtcpip__receiver__private__s.html#a17e57dc2d73bc867e81b4dd04f5207fa',1,'tcpip_receiver_private_s::ext_buffer_size()'],['../structtls__receiver__private__s.html#a98725a8d0044d2f1e13a4df3a9c1cd3f',1,'tls_receiver_private_s::ext_buffer_size()']]] +]; diff --git a/doc/libtrap-devel/search/all_6.html b/doc/libtrap-devel/search/all_6.html new file mode 100644 index 00000000..f75a754e --- /dev/null +++ b/doc/libtrap-devel/search/all_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_6.js b/doc/libtrap-devel/search/all_6.js new file mode 100644 index 00000000..51561e7d --- /dev/null +++ b/doc/libtrap-devel/search/all_6.js @@ -0,0 +1,39 @@ +var searchData= +[ + ['fd',['fd',['../structfile__private__s.html#a0f49fbacaadcec3fc9c914c663f3bd77',1,'file_private_s']]], + ['file_5fbuffer_5fs',['file_buffer_s',['../structfile__buffer__s.html',1,'']]], + ['file_5fbuffer_5ft',['file_buffer_t',['../ifc__file_8h.html#a6771f3504e314bf07a67292019daf0fc',1,'ifc_file.h']]], + ['file_5fchange_5fsize',['file_change_size',['../structfile__private__s.html#a25e4771159d10884bf7b2e1f5cfa253d',1,'file_private_s']]], + ['file_5fchange_5ftime',['file_change_time',['../structfile__private__s.html#ad6f5db2aa05e5f2b18538927013eeee1',1,'file_private_s']]], + ['file_5fcnt',['file_cnt',['../structfile__private__s.html#a0d4ae5dcc1efdc5f9f8c6f6c4bc184e1',1,'file_private_s']]], + ['file_5fcreate_5fdump',['file_create_dump',['../group__file__ifc.html#ga87730dbc566bc75c062ef8320e95ce08',1,'ifc_file.c']]], + ['file_5fdestroy',['file_destroy',['../group__file__ifc.html#gaab5dc7028507246eaa18eb0ce1bbfa60',1,'ifc_file.c']]], + ['file_5fflush',['file_flush',['../group__file__sender.html#ga159700c278c2b3bfdc40b0dbca3880d6',1,'ifc_file.c']]], + ['file_5fget_5fclient_5fcount',['file_get_client_count',['../group__file__sender.html#gad8d2e1557a04cd5c6a2fd5c722ecaacd',1,'ifc_file.c']]], + ['file_5fget_5fclient_5fstats_5fjson',['file_get_client_stats_json',['../group__file__sender.html#ga372655b12fa8a43fcba5e0240306885b',1,'ifc_file.c']]], + ['file_20interface_20module',['file interface module',['../group__file__ifc.html',1,'']]], + ['file_5findex',['file_index',['../structfile__private__s.html#a9eacdca484084ad746ef7a3680406459',1,'file_private_s']]], + ['file_5fprivate_5fs',['file_private_s',['../structfile__private__s.html',1,'']]], + ['file_5fprivate_5ft',['file_private_t',['../ifc__file_8h.html#a309be75527e82357484eaba1295e654e',1,'ifc_file.h']]], + ['file_5freceiver',['File_receiver',['../group__file__receiver.html',1,'']]], + ['file_5frecv',['file_recv',['../group__file__receiver.html#ga04d056bce3131b5857c1b337a9c4341d',1,'ifc_file.c']]], + ['file_5frecv_5fifc_5fget_5fid',['file_recv_ifc_get_id',['../group__file__receiver.html#ga56fb5e7e44c4cc38d2fdc1c5a1ccd91a',1,'ifc_file.c']]], + ['file_5frecv_5fifc_5fis_5fconn',['file_recv_ifc_is_conn',['../group__file__receiver.html#ga495ae064256c7d03083b842c9dc5f0cf',1,'ifc_file.c']]], + ['file_5fsend',['file_send',['../group__file__sender.html#ga919f85f1befced920f91f1c8e7cd4e69',1,'ifc_file.c']]], + ['file_5fsend_5fifc_5fget_5fid',['file_send_ifc_get_id',['../group__file__sender.html#ga8884e86269fc6b140df7f8a2b1927ed2',1,'ifc_file.c']]], + ['file_5fsender',['File_sender',['../group__file__sender.html',1,'']]], + ['file_5fsize_5fsuffix_5flen',['FILE_SIZE_SUFFIX_LEN',['../ifc__file_8h.html#a571617d34d96af5b74c232074e5d26c4',1,'ifc_file.h']]], + ['file_5fterminate',['file_terminate',['../group__file__ifc.html#ga46fc8df7837e8ea42e85133a9fcd3e49',1,'ifc_file.c']]], + ['file_5fwrite_5fbuffer',['file_write_buffer',['../group__file__sender.html#gaca49ec64aaa518a6e2e9c5396ccd3dc9',1,'ifc_file.c']]], + ['filename',['filename',['../structfile__private__s.html#acf8b68231ba794c9b46a6ff5975054de',1,'file_private_s']]], + ['filename_5ftemplate_5flen',['FILENAME_TEMPLATE_LEN',['../ifc__file_8h.html#a9068e2ed91bc9b753cfa65d6fb849290',1,'ifc_file.h']]], + ['filename_5ftmplt',['filename_tmplt',['../structfile__private__s.html#ad5a67bd241648aef4aaafb4797219657',1,'file_private_s']]], + ['files',['files',['../structfile__private__s.html#aea5dc7260d32d183302f3ba816031265',1,'file_private_s']]], + ['finish_5fbuffer',['finish_buffer',['../group__file__sender.html#ga584d20386ac54de01865ab04c1ec99df',1,'finish_buffer(file_buffer_t *buffer): ifc_file.c'],['../group__tcpip__sender.html#gab869dcac96b4cbda388a9d40a35c5eb7',1,'finish_buffer(tcpip_sender_private_t *priv, buffer_t *buffer): ifc_tcpip.c'],['../group__tls__sender.html#ga329b6a3a0d0527736d44acfafd2be576',1,'finish_buffer(tls_sender_private_t *priv, buffer_t *buffer): ifc_tls.c']]], + ['finished',['finished',['../structfile__buffer__s.html#a9ed90d5c89d45557b13432c3686fe728',1,'file_buffer_s']]], + ['flush',['flush',['../structtrap__output__ifc__s.html#a7f3576961e82e438956cf0c52ce99dac',1,'trap_output_ifc_s']]], + ['fmt_5fchanged',['FMT_CHANGED',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea4f7787cd8d6cd8173c1a7a9449b39a5d',1,'trap.h']]], + ['fmt_5fmismatch',['FMT_MISMATCH',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea29dfd7b9fb30ace5fcdc6a719d320de2',1,'trap.h']]], + ['fmt_5fok',['FMT_OK',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea28ac36336d4d5862d01074677e45ce13',1,'trap.h']]], + ['fmt_5fwaiting',['FMT_WAITING',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea83c14af470a24348e2e667016c6c5d41',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/all_7.html b/doc/libtrap-devel/search/all_7.html new file mode 100644 index 00000000..88acd946 --- /dev/null +++ b/doc/libtrap-devel/search/all_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_7.js b/doc/libtrap-devel/search/all_7.js new file mode 100644 index 00000000..2ec4db2c --- /dev/null +++ b/doc/libtrap-devel/search/all_7.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['generator_5fdestroy',['generator_destroy',['../ifc__dummy_8c.html#a5f5b4ed13c71d88e3227816269408d7d',1,'ifc_dummy.c']]], + ['generator_5fifc_5fget_5fid',['generator_ifc_get_id',['../ifc__dummy_8c.html#a1b40bee42c536c742a9533b56740e78e',1,'ifc_dummy.c']]], + ['generator_5fifc_5fis_5fconn',['generator_ifc_is_conn',['../ifc__dummy_8c.html#afd5cb06e77b00bc241680b7590698571',1,'ifc_dummy.c']]], + ['generator_5fprivate_5fs',['generator_private_s',['../structgenerator__private__s.html',1,'']]], + ['generator_5fprivate_5ft',['generator_private_t',['../ifc__dummy_8c.html#a605f9f7108e53a58658ef2baee532ccd',1,'ifc_dummy.c']]], + ['generator_5frecv',['generator_recv',['../ifc__dummy_8c.html#a203edf773b635e53b635b60139495bdb',1,'ifc_dummy.c']]], + ['generator_5fterminate',['generator_terminate',['../ifc__dummy_8c.html#a6987f7fe70dc8e21205dac583bb2457c',1,'ifc_dummy.c']]], + ['get_5fclient_5fcount',['get_client_count',['../structtrap__output__ifc__s.html#aa135ef165a2e73933ab8eec7536fc82c',1,'trap_output_ifc_s']]], + ['get_5fclient_5fstats_5fjson',['get_client_stats_json',['../structtrap__output__ifc__s.html#a866ae11670b262a4f195a27ca7e7b597',1,'trap_output_ifc_s']]], + ['get_5fcur_5ftimestamp',['get_cur_timestamp',['../group__tcpip__receiver.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): ifc_tcpip.c'],['../group__tls__sender.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): ifc_tls.c'],['../group__contextapi.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): trap.c']]], + ['get_5fdata_5ftimeout',['get_data_timeout',['../structtrap__ctx__priv__s.html#a61f86431123ad98238d934e907b608a5',1,'trap_ctx_priv_s']]], + ['get_5fid',['get_id',['../structtrap__input__ifc__s.html#a5edf9feb69e975253a087433793a26e2',1,'trap_input_ifc_s::get_id()'],['../structtrap__output__ifc__s.html#a28066d0bcee909ef82a308acd89c903c',1,'trap_output_ifc_s::get_id()']]], + ['get_5fin_5faddr',['get_in_addr',['../group__tcpip__ifc.html#ga67d03b167f8adca86cde7eeed5850982',1,'get_in_addr(struct sockaddr *sa): ifc_tcpip.c'],['../group__tls__ifc.html#ga67d03b167f8adca86cde7eeed5850982',1,'get_in_addr(struct sockaddr *sa): ifc_tls.c']]], + ['get_5flevel',['get_level',['../trap__internal_8c.html#abc051816fb35ec8ec9cba4d99460acc4',1,'trap_internal.c']]], + ['get_5fmodule_5fname',['get_module_name',['../trap_8c.html#ac7b9ed8ab44057b9ad6a53f98b81d4a4',1,'trap.c']]], + ['get_5fparam_5fby_5fdelimiter',['get_param_by_delimiter',['../trap_8c.html#a2186e85312c99ab71fb9466c9fda0e5a',1,'trap.c']]], + ['get_5fterminal_5fwidth',['get_terminal_width',['../trap_8c.html#a4d05e2325a8020e342295597aef447a4',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/all_8.html b/doc/libtrap-devel/search/all_8.html new file mode 100644 index 00000000..b74d5fd8 --- /dev/null +++ b/doc/libtrap-devel/search/all_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_8.js b/doc/libtrap-devel/search/all_8.js new file mode 100644 index 00000000..51a655a1 --- /dev/null +++ b/doc/libtrap-devel/search/all_8.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['handle_5finifc_5fsetters',['handle_inifc_setters',['../group__contextapi.html#ga9fdbcb1c73cc4df9cef9b1e782cfb6af',1,'trap.c']]], + ['handle_5foutifc_5fsetters',['handle_outifc_setters',['../group__contextapi.html#ga7ea44d513b6c0e105a38d93a4360880a',1,'trap.c']]], + ['header',['header',['../structfile__buffer__s.html#a6d82f8e1c69ec54aa27491f1b7e1c3b6',1,'file_buffer_s::header()'],['../structbuffer__s.html#aa2ad479ae2dabc1066c956ad3cc6f6c6',1,'buffer_s::header()']]], + ['hello_5fmsg_5fheader_5fs',['hello_msg_header_s',['../structhello__msg__header__s.html',1,'']]], + ['hello_5fmsg_5fheader_5ft',['hello_msg_header_t',['../group__debug.html#ga0bb675fdd36b974d3cdf9b7405863eb1',1,'trap_internal.h']]], + ['help_5ftrapifcspec_2ec',['help_trapifcspec.c',['../help__trapifcspec_8c.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/all_9.html b/doc/libtrap-devel/search/all_9.html new file mode 100644 index 00000000..95e88dd2 --- /dev/null +++ b/doc/libtrap-devel/search/all_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_9.js b/doc/libtrap-devel/search/all_9.js new file mode 100644 index 00000000..23262b0a --- /dev/null +++ b/doc/libtrap-devel/search/all_9.js @@ -0,0 +1,45 @@ +var searchData= +[ + ['ifc_20counters',['IFC counters',['../group__ctxifccounters.html',1,'']]], + ['id',['id',['../structclient__s.html#a4294300096ccb1946f3444e61631a14a',1,'client_s::id()'],['../structtlsclient__s.html#a53113575cc2a2cd0692753e88672ae73',1,'tlsclient_s::id()']]], + ['idx',['idx',['../structautoflush__timeouts.html#abdd42145684f843c79e427f8d4bfb703',1,'autoflush_timeouts']]], + ['ifc_5fautoflush_5ft',['ifc_autoflush_t',['../trap__internal_8h.html#a86ac574ead4f87e3db30492d68f4b55e',1,'trap_internal.h']]], + ['ifc_5fautoflush_5ftimeout',['ifc_autoflush_timeout',['../structtrap__ctx__priv__s.html#a69d5cc5cb537abe973335b0ddc7c0815',1,'trap_ctx_priv_s']]], + ['ifc_5fchange',['ifc_change',['../structtrap__ctx__priv__s.html#a63bd99bb735df5ac63113537fb03f765',1,'trap_ctx_priv_s']]], + ['ifc_5fcreate_5fdump_5ffunc_5ft',['ifc_create_dump_func_t',['../group__trap__ifc__api.html#gad789bf24bbd5e30da20fc11dc732c544',1,'trap_ifc.h']]], + ['ifc_5fdestroy_5ffunc_5ft',['ifc_destroy_func_t',['../group__trap__ifc__api.html#gaef77298c8ccd823ddadf00368698c35f',1,'trap_ifc.h']]], + ['ifc_5fdisconn_5fclients_5ffunc_5ft',['ifc_disconn_clients_func_t',['../group__trap__ifc__api.html#gaf5f4628c38e49b659827242e0c9dbac1',1,'trap_ifc.h']]], + ['ifc_5fdummy_2ec',['ifc_dummy.c',['../ifc__dummy_8c.html',1,'']]], + ['ifc_5fdummy_2eh',['ifc_dummy.h',['../ifc__dummy_8h.html',1,'']]], + ['ifc_5ffile_2ec',['ifc_file.c',['../ifc__file_8c.html',1,'']]], + ['ifc_5ffile_2eh',['ifc_file.h',['../ifc__file_8h.html',1,'']]], + ['ifc_5fflush_5ffunc_5ft',['ifc_flush_func_t',['../group__trap__ifc__api.html#ga7c977395d33e33ab6fde6c50b8f25f7d',1,'trap_ifc.h']]], + ['ifc_5fget_5fclient_5fcount_5ffunc_5ft',['ifc_get_client_count_func_t',['../group__trap__ifc__api.html#gaa49b0bc8ebc826ed9112a1cb228eeef1',1,'trap_ifc.h']]], + ['ifc_5fget_5fclient_5fstats_5fjson_5ffunc_5ft',['ifc_get_client_stats_json_func_t',['../group__trap__ifc__api.html#gaa32b9a8860575cb4e268d06d0937de22',1,'trap_ifc.h']]], + ['ifc_5fget_5fid_5ffunc_5ft',['ifc_get_id_func_t',['../group__trap__ifc__api.html#gacb6c2dfcdb3afeeb6a61aa249ba2fcf6',1,'trap_ifc.h']]], + ['ifc_5fidx',['ifc_idx',['../structfile__private__s.html#a8fde42ac826019a1de2caa53208d2773',1,'file_private_s::ifc_idx()'],['../structtcpip__sender__private__s.html#a80c87058c06716405b0fb99e8089afd1',1,'tcpip_sender_private_s::ifc_idx()'],['../structtcpip__receiver__private__s.html#aa6557670605b124f2a41f9474d94b5f7',1,'tcpip_receiver_private_s::ifc_idx()'],['../structtls__sender__private__s.html#a46059128ac5b82f796aa795dea690522',1,'tls_sender_private_s::ifc_idx()'],['../structtls__receiver__private__s.html#a5c428f93f37710a4981478dea2cad534',1,'tls_receiver_private_s::ifc_idx()']]], + ['ifc_5fis_5fconn_5ffunc_5ft',['ifc_is_conn_func_t',['../group__trap__ifc__api.html#ga3d55759655bbae5059f00e151eafb5ff',1,'trap_ifc.h']]], + ['ifc_5fmtx',['ifc_mtx',['../structtrap__input__ifc__s.html#a4058587a4584a7fc650bbfb4a6a73bee',1,'trap_input_ifc_s::ifc_mtx()'],['../structtrap__output__ifc__s.html#a1ccb40690e646da10a123308491d7899',1,'trap_output_ifc_s::ifc_mtx()']]], + ['ifc_5frecv_5ffunc_5ft',['ifc_recv_func_t',['../group__trap__ifc__api.html#ga4df8e9b4c9b942e791128088c490bd58',1,'trap_ifc.h']]], + ['ifc_5fsend_5ffunc_5ft',['ifc_send_func_t',['../group__trap__ifc__api.html#gabfcce0a5be5c71565e19f8605c607283',1,'trap_ifc.h']]], + ['ifc_5fsocket_5fcommon_2eh',['ifc_socket_common.h',['../ifc__socket__common_8h.html',1,'']]], + ['ifc_5ftcpip_2ec',['ifc_tcpip.c',['../ifc__tcpip_8c.html',1,'']]], + ['ifc_5ftcpip_2eh',['ifc_tcpip.h',['../ifc__tcpip_8h.html',1,'']]], + ['ifc_5ftcpip_5finternal_2eh',['ifc_tcpip_internal.h',['../ifc__tcpip__internal_8h.html',1,'']]], + ['ifc_5fterminate_5ffunc_5ft',['ifc_terminate_func_t',['../group__trap__ifc__api.html#ga135751b3a4b270e8681881877095ec21',1,'trap_ifc.h']]], + ['ifc_5ftls_2ec',['ifc_tls.c',['../ifc__tls_8c.html',1,'']]], + ['ifc_5ftls_2eh',['ifc_tls.h',['../ifc__tls_8h.html',1,'']]], + ['ifc_5ftls_5finternal_2eh',['ifc_tls_internal.h',['../ifc__tls__internal_8h.html',1,'']]], + ['ifc_5ftype',['ifc_type',['../structtrap__input__ifc__s.html#ae3e4a235d9034c9f998676c286f745b3',1,'trap_input_ifc_s::ifc_type()'],['../structtrap__output__ifc__s.html#ad11a1060b35406f5e0453c7ab3078b83',1,'trap_output_ifc_s::ifc_type()']]], + ['ifcdir2str',['ifcdir2str',['../trap_8c.html#a4aa0658cd79f30e7969f0d6821634b95',1,'trap.c']]], + ['in_5fifc_5flist',['in_ifc_list',['../structtrap__ctx__priv__s.html#a0c1dbb818a0ca11597f28c494a30cd5f',1,'trap_ctx_priv_s']]], + ['index_2ddevel_2etxt',['index-devel.txt',['../index-devel_8txt.html',1,'']]], + ['initialized',['initialized',['../structtcpip__sender__private__s.html#a0229b95daa25e85efe6f04b55bc3a150',1,'tcpip_sender_private_s::initialized()'],['../structtls__sender__private__s.html#a67d8252f20ffd1d3eaf2fbec4af892fc',1,'tls_sender_private_s::initialized()'],['../structtrap__ctx__priv__s.html#a91a63a3c23a2bd6e97ea4b1bbe69219b',1,'trap_ctx_priv_s::initialized()']]], + ['inline',['INLINE',['../group__debug.html#ga2eb6f9e0395b47b8d5e3eeae4fe0c116',1,'trap_internal.h']]], + ['input_5fifc_5fnegotiation',['input_ifc_negotiation',['../trap_8c.html#a2c722200cdfbd15e5ab203e88e44bc33',1,'input_ifc_negotiation(void *ifc_priv_data, char ifc_type): trap.c'],['../trap_8h.html#a2c722200cdfbd15e5ab203e88e44bc33',1,'input_ifc_negotiation(void *ifc_priv_data, char ifc_type): trap.c']]], + ['insert_5finto_5fbuffer',['insert_into_buffer',['../group__file__sender.html#ga3570e854829adb6314a2589e10393f9f',1,'insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size): ifc_file.c'],['../ifc__socket__common_8h.html#af5a1afc2e76d7beb1bbe068f30581925',1,'insert_into_buffer(buffer_t *buffer, const void *data, uint16_t size): ifc_socket_common.h']]], + ['int_5fmess_5fheader',['int_mess_header',['../structtcpip__receiver__private__s.html#a962be8fe5802e31ee65f689c5e2a8975',1,'tcpip_receiver_private_s::int_mess_header()'],['../structtls__receiver__private__s.html#acd1281b3fe949fef8382b490589c3d6d',1,'tls_receiver_private_s::int_mess_header()']]], + ['is_5fconn',['is_conn',['../structtrap__input__ifc__s.html#aa6657d505447e117948bc0fca7f8ba79',1,'trap_input_ifc_s']]], + ['is_5fterminated',['is_terminated',['../structgenerator__private__s.html#a892f8f16a299820033abbb9ef5c915de',1,'generator_private_s::is_terminated()'],['../structfile__private__s.html#aff4a8fb12ae452ebcc50581860764b32',1,'file_private_s::is_terminated()'],['../structtcpip__sender__private__s.html#a20a41fc7667d03bdc8134a5c5bee2229',1,'tcpip_sender_private_s::is_terminated()'],['../structtcpip__receiver__private__s.html#a7997188b334e7c35b9ea25bf81cc5eaa',1,'tcpip_receiver_private_s::is_terminated()'],['../structtls__sender__private__s.html#a851c24506384508921b7410c0686dee0',1,'tls_sender_private_s::is_terminated()'],['../structtls__receiver__private__s.html#ab20da0d5adeaff59a7a98702e4af8e3b',1,'tls_receiver_private_s::is_terminated()']]], + ['ifc_20api',['IFC API',['../group__trap__ifc__api.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/all_a.html b/doc/libtrap-devel/search/all_a.html new file mode 100644 index 00000000..3148a8e5 --- /dev/null +++ b/doc/libtrap-devel/search/all_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_a.js b/doc/libtrap-devel/search/all_a.js new file mode 100644 index 00000000..920634f0 --- /dev/null +++ b/doc/libtrap-devel/search/all_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['keyfile',['keyfile',['../structtls__sender__private__s.html#a1b1f1272d5e989a6b95b5a26741699f3',1,'tls_sender_private_s::keyfile()'],['../structtls__receiver__private__s.html#a79b489b10fa36669da8c40cafc7f781d',1,'tls_receiver_private_s::keyfile()']]] +]; diff --git a/doc/libtrap-devel/search/all_b.html b/doc/libtrap-devel/search/all_b.html new file mode 100644 index 00000000..f2a3c8d0 --- /dev/null +++ b/doc/libtrap-devel/search/all_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_b.js b/doc/libtrap-devel/search/all_b.js new file mode 100644 index 00000000..59f792b4 --- /dev/null +++ b/doc/libtrap-devel/search/all_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['line',['LINE',['../group__debug.html#gaa529f66e1dbb67cfe79dd28f51baed5a',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/all_c.html b/doc/libtrap-devel/search/all_c.html new file mode 100644 index 00000000..63768107 --- /dev/null +++ b/doc/libtrap-devel/search/all_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_c.js b/doc/libtrap-devel/search/all_c.js new file mode 100644 index 00000000..fb4ed44d --- /dev/null +++ b/doc/libtrap-devel/search/all_c.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['macros_20for_20verbose_20and_20debug_20listings',['Macros for verbose and debug listings',['../group__debug.html',1,'']]], + ['mask',['mask',['../ifc__socket__common_8h.html#a07f30ec0a21b8214e936114f6438fd6e',1,'ifc_socket_common.h']]], + ['max',['MAX',['../group__tcpip__ifc.html#gafa99ec4acc4ecb2dc3c2d05da15d0e3f',1,'MAX(): ifc_tcpip.c'],['../group__tls__ifc.html#gafa99ec4acc4ecb2dc3c2d05da15d0e3f',1,'MAX(): ifc_tls.c']]], + ['max_5fclients_5fparam_5flength',['MAX_CLIENTS_PARAM_LENGTH',['../ifc__socket__common_8h.html#a77f9ace440910c6f2b3269f4c7369f94',1,'ifc_socket_common.h']]], + ['max_5ferror_5fmsg_5fbuff_5fsize',['MAX_ERROR_MSG_BUFF_SIZE',['../trap__internal_8h.html#a7b6916131b97898f1808dc119f4fc94a',1,'trap_internal.h']]], + ['max_5frecovery_5ftry',['MAX_RECOVERY_TRY',['../group__tcpip__ifc.html#gabd9ed2a4e39c7dde3a7c579902c47e2b',1,'MAX_RECOVERY_TRY(): ifc_tcpip.c'],['../group__tls__ifc.html#gabd9ed2a4e39c7dde3a7c579902c47e2b',1,'MAX_RECOVERY_TRY(): ifc_tls.c']]], + ['min',['MIN',['../group__tcpip__ifc.html#ga3acffbd305ee72dcd4593c0d8af64a4f',1,'MIN(): ifc_tcpip.c'],['../group__tls__ifc.html#ga3acffbd305ee72dcd4593c0d8af64a4f',1,'MIN(): ifc_tls.c']]], + ['mode',['mode',['../structfile__private__s.html#ab92bb308a82414c03133b8aba613eea3',1,'file_private_s']]], + ['msg',['MSG',['../group__debug.html#ga97e1f6e119fbc0338e706020000d6ff6',1,'trap_internal.h']]], + ['msg_5fheader_5fs',['msg_header_s',['../structmsg__header__s.html',1,'']]], + ['msg_5fheader_5ft',['msg_header_t',['../group__supervisor.html#gaa438010db529a6f3b186ba789b877804',1,'trap.c']]], + ['msg_5fnonl',['MSG_NONL',['../group__debug.html#gaee080b4bbbc24ce18321314b33ac6c35',1,'trap_internal.h']]], + ['mtx_5fno_5fdata',['mtx_no_data',['../structtcpip__sender__private__s.html#a5c0a335e7cde72ecd34a5e8ba15b47a3',1,'tcpip_sender_private_s::mtx_no_data()'],['../structtls__sender__private__s.html#a817dd02237d0bf183682acfa96f25c96',1,'tls_sender_private_s::mtx_no_data()']]], + ['message_20format',['Message format',['../group__trap__mess__fmt.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/all_d.html b/doc/libtrap-devel/search/all_d.html new file mode 100644 index 00000000..cc52c79f --- /dev/null +++ b/doc/libtrap-devel/search/all_d.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_d.js b/doc/libtrap-devel/search/all_d.js new file mode 100644 index 00000000..884674ea --- /dev/null +++ b/doc/libtrap-devel/search/all_d.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['nemea_20module_20macros',['Nemea module macros',['../group__modulemacros.html',1,'']]], + ['neg_5finitialized',['neg_initialized',['../structfile__private__s.html#a6a49aa9f86e4da7c239d89f3a180ef8b',1,'file_private_s']]], + ['neg_5fres_5fcont',['NEG_RES_CONT',['../group__negotiationretvals.html#gace5d606263806672a058c84561dc47bd',1,'trap_internal.h']]], + ['neg_5fres_5ffailed',['NEG_RES_FAILED',['../group__negotiationretvals.html#gaf66581d55a468424f235f4de6af21246',1,'trap_internal.h']]], + ['neg_5fres_5ffmt_5fchanged',['NEG_RES_FMT_CHANGED',['../group__negotiationretvals.html#ga6d38fcc8f3d17a528f63974bdb7a7710',1,'trap_internal.h']]], + ['neg_5fres_5ffmt_5fmismatch',['NEG_RES_FMT_MISMATCH',['../group__negotiationretvals.html#gaf6f7169cf725db37670c874b4a9c5d07',1,'trap_internal.h']]], + ['neg_5fres_5ffmt_5funknown',['NEG_RES_FMT_UNKNOWN',['../group__negotiationretvals.html#ga026208bea8d654c030ca91c035652369',1,'trap_internal.h']]], + ['neg_5fres_5fok',['NEG_RES_OK',['../group__negotiationretvals.html#gabb46d2d0913a851abfda8bbc93ccc1f2',1,'trap_internal.h']]], + ['neg_5fres_5freceiver_5ffmt_5fsubset',['NEG_RES_RECEIVER_FMT_SUBSET',['../group__negotiationretvals.html#gaed46583d69af77acdc271a9774a11676',1,'trap_internal.h']]], + ['neg_5fres_5fsender_5ffmt_5fsubset',['NEG_RES_SENDER_FMT_SUBSET',['../group__negotiationretvals.html#gac42409677946fb411027b1185bc36181',1,'trap_internal.h']]], + ['negotiation_20return_20values',['Negotiation return values',['../group__negotiationretvals.html',1,'']]], + ['no_5fclients_5fsleep',['NO_CLIENTS_SLEEP',['../ifc__socket__common_8h.html#a631c86aff75159dd3ed01e0af87014f2',1,'ifc_socket_common.h']]], + ['num_5fifc_5fin',['num_ifc_in',['../structtrap__ctx__priv__s.html#a2e4d1aa8eb64743dda03cee9430197d1',1,'trap_ctx_priv_s']]], + ['num_5fifc_5fout',['num_ifc_out',['../structtrap__ctx__priv__s.html#a1f71f0c46759591ff11107870d66111b',1,'trap_ctx_priv_s']]] +]; diff --git a/doc/libtrap-devel/search/all_e.html b/doc/libtrap-devel/search/all_e.html new file mode 100644 index 00000000..85b39bd4 --- /dev/null +++ b/doc/libtrap-devel/search/all_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_e.js b/doc/libtrap-devel/search/all_e.js new file mode 100644 index 00000000..0e3e5137 --- /dev/null +++ b/doc/libtrap-devel/search/all_e.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['out_5fifc_5flist',['out_ifc_list',['../structtrap__ctx__priv__s.html#a7dc607a5c8f21a2ecc8501c3356ed14a',1,'trap_ctx_priv_s']]], + ['output_5fifc_5fnegotiation',['output_ifc_negotiation',['../trap_8c.html#a392fc5b75861ca76dd868dc05af20cdc',1,'output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx): trap.c'],['../trap_8h.html#a392fc5b75861ca76dd868dc05af20cdc',1,'output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx): trap.c']]] +]; diff --git a/doc/libtrap-devel/search/all_f.html b/doc/libtrap-devel/search/all_f.html new file mode 100644 index 00000000..89fa15a6 --- /dev/null +++ b/doc/libtrap-devel/search/all_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/all_f.js b/doc/libtrap-devel/search/all_f.js new file mode 100644 index 00000000..03b4486f --- /dev/null +++ b/doc/libtrap-devel/search/all_f.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['params',['params',['../structtrap__ifc__spec__s.html#a67f46fe3c5ea43d1c8894ce9b8f551ab',1,'trap_ifc_spec_s']]], + ['pending_5fbytes',['pending_bytes',['../structclient__s.html#a70807d3454b3edc69da68944c5361f82',1,'client_s::pending_bytes()'],['../structtlsclient__s.html#af78d35cba81bd53d5acf1ad6c5a25396',1,'tlsclient_s::pending_bytes()']]], + ['pfds_5findex',['pfds_index',['../structclient__s.html#a87c4e6f9fd9d595ae725de498a70d3fc',1,'client_s']]], + ['print_5faligned',['print_aligned',['../trap_8c.html#a682459a46e96db216ba53576cec54040',1,'trap.c']]], + ['print_5faligned_5fmultiline',['print_aligned_multiline',['../trap_8c.html#a64b9357a0c937d4f20e3b7f259174f75',1,'trap.c']]], + ['priv',['priv',['../structtrap__input__ifc__s.html#a6fe747dbf5b4371b1d03072a4314d7b7',1,'trap_input_ifc_s::priv()'],['../structtrap__output__ifc__s.html#a144ca021f2c9ff608d539c49679fe0c5',1,'trap_output_ifc_s::priv()']]] +]; diff --git a/doc/libtrap-devel/search/classes_0.html b/doc/libtrap-devel/search/classes_0.html new file mode 100644 index 00000000..e935fdf7 --- /dev/null +++ b/doc/libtrap-devel/search/classes_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_0.js b/doc/libtrap-devel/search/classes_0.js new file mode 100644 index 00000000..f52cb74e --- /dev/null +++ b/doc/libtrap-devel/search/classes_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['autoflush_5ftimeouts',['autoflush_timeouts',['../structautoflush__timeouts.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_1.html b/doc/libtrap-devel/search/classes_1.html new file mode 100644 index 00000000..3df6e80a --- /dev/null +++ b/doc/libtrap-devel/search/classes_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_1.js b/doc/libtrap-devel/search/classes_1.js new file mode 100644 index 00000000..10911ecb --- /dev/null +++ b/doc/libtrap-devel/search/classes_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['buffer_5fs',['buffer_s',['../structbuffer__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_2.html b/doc/libtrap-devel/search/classes_2.html new file mode 100644 index 00000000..028694ff --- /dev/null +++ b/doc/libtrap-devel/search/classes_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_2.js b/doc/libtrap-devel/search/classes_2.js new file mode 100644 index 00000000..302aa385 --- /dev/null +++ b/doc/libtrap-devel/search/classes_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['client_5fs',['client_s',['../structclient__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_3.html b/doc/libtrap-devel/search/classes_3.html new file mode 100644 index 00000000..2b1abe38 --- /dev/null +++ b/doc/libtrap-devel/search/classes_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_3.js b/doc/libtrap-devel/search/classes_3.js new file mode 100644 index 00000000..11ff9382 --- /dev/null +++ b/doc/libtrap-devel/search/classes_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['file_5fbuffer_5fs',['file_buffer_s',['../structfile__buffer__s.html',1,'']]], + ['file_5fprivate_5fs',['file_private_s',['../structfile__private__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_4.html b/doc/libtrap-devel/search/classes_4.html new file mode 100644 index 00000000..87352149 --- /dev/null +++ b/doc/libtrap-devel/search/classes_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_4.js b/doc/libtrap-devel/search/classes_4.js new file mode 100644 index 00000000..f95a2ee9 --- /dev/null +++ b/doc/libtrap-devel/search/classes_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['generator_5fprivate_5fs',['generator_private_s',['../structgenerator__private__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_5.html b/doc/libtrap-devel/search/classes_5.html new file mode 100644 index 00000000..ba8b1c69 --- /dev/null +++ b/doc/libtrap-devel/search/classes_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_5.js b/doc/libtrap-devel/search/classes_5.js new file mode 100644 index 00000000..e06c9a24 --- /dev/null +++ b/doc/libtrap-devel/search/classes_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hello_5fmsg_5fheader_5fs',['hello_msg_header_s',['../structhello__msg__header__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_6.html b/doc/libtrap-devel/search/classes_6.html new file mode 100644 index 00000000..f5850938 --- /dev/null +++ b/doc/libtrap-devel/search/classes_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_6.js b/doc/libtrap-devel/search/classes_6.js new file mode 100644 index 00000000..0efcea41 --- /dev/null +++ b/doc/libtrap-devel/search/classes_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['msg_5fheader_5fs',['msg_header_s',['../structmsg__header__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_7.html b/doc/libtrap-devel/search/classes_7.html new file mode 100644 index 00000000..6418529c --- /dev/null +++ b/doc/libtrap-devel/search/classes_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_7.js b/doc/libtrap-devel/search/classes_7.js new file mode 100644 index 00000000..11a222b4 --- /dev/null +++ b/doc/libtrap-devel/search/classes_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['reader_5fthreads_5fs',['reader_threads_s',['../structreader__threads__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/classes_8.html b/doc/libtrap-devel/search/classes_8.html new file mode 100644 index 00000000..87af6f60 --- /dev/null +++ b/doc/libtrap-devel/search/classes_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/classes_8.js b/doc/libtrap-devel/search/classes_8.js new file mode 100644 index 00000000..b92128ac --- /dev/null +++ b/doc/libtrap-devel/search/classes_8.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['tcpip_5freceiver_5fprivate_5fs',['tcpip_receiver_private_s',['../structtcpip__receiver__private__s.html',1,'']]], + ['tcpip_5fsender_5fprivate_5fs',['tcpip_sender_private_s',['../structtcpip__sender__private__s.html',1,'']]], + ['tcpip_5fsocket_5faddr',['tcpip_socket_addr',['../uniontcpip__socket__addr.html',1,'']]], + ['tls_5freceiver_5fprivate_5fs',['tls_receiver_private_s',['../structtls__receiver__private__s.html',1,'']]], + ['tls_5fsender_5fprivate_5fs',['tls_sender_private_s',['../structtls__sender__private__s.html',1,'']]], + ['tls_5fsocket_5faddr',['tls_socket_addr',['../uniontls__socket__addr.html',1,'']]], + ['tlsclient_5fs',['tlsclient_s',['../structtlsclient__s.html',1,'']]], + ['trap_5fbuffer_5fheader_5fs',['trap_buffer_header_s',['../structtrap__buffer__header__s.html',1,'']]], + ['trap_5fctx_5fpriv_5fs',['trap_ctx_priv_s',['../structtrap__ctx__priv__s.html',1,'']]], + ['trap_5fifc_5fspec_5fs',['trap_ifc_spec_s',['../structtrap__ifc__spec__s.html',1,'']]], + ['trap_5finput_5fifc_5fs',['trap_input_ifc_s',['../structtrap__input__ifc__s.html',1,'']]], + ['trap_5foutput_5fifc_5fs',['trap_output_ifc_s',['../structtrap__output__ifc__s.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/close.png b/doc/libtrap-devel/search/close.png new file mode 100644 index 00000000..9342d3df Binary files /dev/null and b/doc/libtrap-devel/search/close.png differ diff --git a/doc/libtrap-devel/search/defines_0.html b/doc/libtrap-devel/search/defines_0.html new file mode 100644 index 00000000..3bffafa9 --- /dev/null +++ b/doc/libtrap-devel/search/defines_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_0.js b/doc/libtrap-devel/search/defines_0.js new file mode 100644 index 00000000..760b31fb --- /dev/null +++ b/doc/libtrap-devel/search/defines_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_5fgnu_5fsource',['_GNU_SOURCE',['../ifc__file_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_file.c'],['../ifc__tcpip_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_tcpip.c'],['../ifc__tls_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): ifc_tls.c'],['../trap_8c.html#a369266c24eacffb87046522897a570d5',1,'_GNU_SOURCE(): trap.c']]] +]; diff --git a/doc/libtrap-devel/search/defines_1.html b/doc/libtrap-devel/search/defines_1.html new file mode 100644 index 00000000..ca5bb94e --- /dev/null +++ b/doc/libtrap-devel/search/defines_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_1.js b/doc/libtrap-devel/search/defines_1.js new file mode 100644 index 00000000..14782157 --- /dev/null +++ b/doc/libtrap-devel/search/defines_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['buffer_5fcount_5fparam_5flength',['BUFFER_COUNT_PARAM_LENGTH',['../ifc__socket__common_8h.html#ae22b2c9c46dc10414c8d881852a0fc1b',1,'ifc_socket_common.h']]], + ['buffer_5fsize_5fparam_5flength',['BUFFER_SIZE_PARAM_LENGTH',['../ifc__socket__common_8h.html#a3604cb3c53c3d7a47be21b88c67f7d4e',1,'ifc_socket_common.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_2.html b/doc/libtrap-devel/search/defines_2.html new file mode 100644 index 00000000..7cc1a74c --- /dev/null +++ b/doc/libtrap-devel/search/defines_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_2.js b/doc/libtrap-devel/search/defines_2.js new file mode 100644 index 00000000..fa9b136b --- /dev/null +++ b/doc/libtrap-devel/search/defines_2.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['default_5fbuffer_5fcount',['DEFAULT_BUFFER_COUNT',['../ifc__socket__common_8h.html#abb7814611632e59302550e4bbdfc2005',1,'ifc_socket_common.h']]], + ['default_5fbuffer_5fsize',['DEFAULT_BUFFER_SIZE',['../ifc__socket__common_8h.html#a6e576a3c6530636d68b7a220480bcd32',1,'ifc_socket_common.h']]], + ['default_5fmax_5fclients',['DEFAULT_MAX_CLIENTS',['../ifc__socket__common_8h.html#abb5b90442e7148e1b85e6879c2e0efc9',1,'ifc_socket_common.h']]], + ['default_5fmax_5fdata_5flength',['DEFAULT_MAX_DATA_LENGTH',['../ifc__socket__common_8h.html#afcd38906d9a32f5e20c50141c8f0bf14',1,'ifc_socket_common.h']]], + ['default_5fmax_5fterminal_5fwidth',['DEFAULT_MAX_TERMINAL_WIDTH',['../trap__internal_8h.html#ad3274a76aef689d61eef22cfce054a32',1,'trap_internal.h']]], + ['default_5fsocket_5fformat',['DEFAULT_SOCKET_FORMAT',['../ifc__tcpip_8h.html#a3f82a78a0f6bc22720d5d62919a3a756',1,'ifc_tcpip.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_3.html b/doc/libtrap-devel/search/defines_3.html new file mode 100644 index 00000000..3d0ac123 --- /dev/null +++ b/doc/libtrap-devel/search/defines_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_3.js b/doc/libtrap-devel/search/defines_3.js new file mode 100644 index 00000000..53cb999b --- /dev/null +++ b/doc/libtrap-devel/search/defines_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['file_5fsize_5fsuffix_5flen',['FILE_SIZE_SUFFIX_LEN',['../ifc__file_8h.html#a571617d34d96af5b74c232074e5d26c4',1,'ifc_file.h']]], + ['filename_5ftemplate_5flen',['FILENAME_TEMPLATE_LEN',['../ifc__file_8h.html#a9068e2ed91bc9b753cfa65d6fb849290',1,'ifc_file.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_4.html b/doc/libtrap-devel/search/defines_4.html new file mode 100644 index 00000000..201f927f --- /dev/null +++ b/doc/libtrap-devel/search/defines_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_4.js b/doc/libtrap-devel/search/defines_4.js new file mode 100644 index 00000000..7e7615a4 --- /dev/null +++ b/doc/libtrap-devel/search/defines_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['ifcdir2str',['ifcdir2str',['../trap_8c.html#a4aa0658cd79f30e7969f0d6821634b95',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/defines_5.html b/doc/libtrap-devel/search/defines_5.html new file mode 100644 index 00000000..92d51a58 --- /dev/null +++ b/doc/libtrap-devel/search/defines_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_5.js b/doc/libtrap-devel/search/defines_5.js new file mode 100644 index 00000000..cb7106ba --- /dev/null +++ b/doc/libtrap-devel/search/defines_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['max_5fclients_5fparam_5flength',['MAX_CLIENTS_PARAM_LENGTH',['../ifc__socket__common_8h.html#a77f9ace440910c6f2b3269f4c7369f94',1,'ifc_socket_common.h']]], + ['max_5ferror_5fmsg_5fbuff_5fsize',['MAX_ERROR_MSG_BUFF_SIZE',['../trap__internal_8h.html#a7b6916131b97898f1808dc119f4fc94a',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_6.html b/doc/libtrap-devel/search/defines_6.html new file mode 100644 index 00000000..fa5d74ce --- /dev/null +++ b/doc/libtrap-devel/search/defines_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_6.js b/doc/libtrap-devel/search/defines_6.js new file mode 100644 index 00000000..a3f418ce --- /dev/null +++ b/doc/libtrap-devel/search/defines_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['no_5fclients_5fsleep',['NO_CLIENTS_SLEEP',['../ifc__socket__common_8h.html#a631c86aff75159dd3ed01e0af87014f2',1,'ifc_socket_common.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_7.html b/doc/libtrap-devel/search/defines_7.html new file mode 100644 index 00000000..99054085 --- /dev/null +++ b/doc/libtrap-devel/search/defines_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_7.js b/doc/libtrap-devel/search/defines_7.js new file mode 100644 index 00000000..c08c5b40 --- /dev/null +++ b/doc/libtrap-devel/search/defines_7.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['send_5fdata',['SEND_DATA',['../trap_8c.html#a7a5458fe1bcdcc9871a50d236a808bc3',1,'trap.c']]], + ['service_5fget_5fcom',['SERVICE_GET_COM',['../trap__internal_8h.html#a86478bb24d5a308d79f0425b0eedf54b',1,'trap_internal.h']]], + ['service_5fok_5freply',['SERVICE_OK_REPLY',['../trap__internal_8h.html#a1bccd80a7d96b96e9c01bdf6c18f039e',1,'trap_internal.h']]], + ['service_5fset_5fcom',['SERVICE_SET_COM',['../trap__internal_8h.html#a0f4ca0b39a8bbce034c63b8cbb227ba1',1,'trap_internal.h']]], + ['size_5fparam',['SIZE_PARAM',['../ifc__file_8h.html#ae6d0889243aace97bb08b801aabbac78',1,'ifc_file.h']]], + ['size_5fparam_5flen',['SIZE_PARAM_LEN',['../ifc__file_8h.html#a27a9fc95c885214eb8e9f3954deb9fab',1,'ifc_file.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_8.html b/doc/libtrap-devel/search/defines_8.html new file mode 100644 index 00000000..9098e183 --- /dev/null +++ b/doc/libtrap-devel/search/defines_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_8.js b/doc/libtrap-devel/search/defines_8.js new file mode 100644 index 00000000..b37bfbd1 --- /dev/null +++ b/doc/libtrap-devel/search/defines_8.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['tcpip_5fifc_5fparams_5fdelimiter',['TCPIP_IFC_PARAMS_DELIMITER',['../ifc__tcpip_8h.html#accae29cc0e813979cb529363038e3015',1,'ifc_tcpip.h']]], + ['tcpip_5fsockettype_5fstr',['TCPIP_SOCKETTYPE_STR',['../ifc__tcpip_8h.html#a643bf83d44a7112dffafa71688057d4c',1,'ifc_tcpip.h']]], + ['time_5fformat_5fstring',['TIME_FORMAT_STRING',['../ifc__file_8h.html#a768ea84a7b5818ac12d03ad83f7d6193',1,'ifc_file.h']]], + ['time_5fformat_5fstring_5flen',['TIME_FORMAT_STRING_LEN',['../ifc__file_8h.html#ad526578db98c7054e96c3344a18697d0',1,'ifc_file.h']]], + ['time_5fparam',['TIME_PARAM',['../ifc__file_8h.html#a30ac80fc92df5812ff3f626b00b63b2d',1,'ifc_file.h']]], + ['time_5fparam_5flen',['TIME_PARAM_LEN',['../ifc__file_8h.html#a9e2217118253dafa9f8b31342b0fcfb1',1,'ifc_file.h']]], + ['tls_5fparams_5fdelimiter',['TLS_PARAMS_DELIMITER',['../ifc__tls_8h.html#aa83e6c8b7d7a04ea8428ce4178e1f54c',1,'ifc_tls.h']]], + ['trap_5fctx_5ft',['trap_ctx_t',['../trap_8h.html#a008a51aeb2d1f379beb493108407ce97',1,'trap.h']]], + ['trap_5fin_5fifc_5fcounters',['TRAP_IN_IFC_COUNTERS',['../trap__internal_8h.html#a82b80275c4cd93352d15631373b11d47',1,'trap_internal.h']]], + ['trap_5fout_5fifc_5fcounters',['TRAP_OUT_IFC_COUNTERS',['../trap__internal_8h.html#a6ada33c3047cb067cdb75017f652db28',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_9.html b/doc/libtrap-devel/search/defines_9.html new file mode 100644 index 00000000..bdebe602 --- /dev/null +++ b/doc/libtrap-devel/search/defines_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_9.js b/doc/libtrap-devel/search/defines_9.js new file mode 100644 index 00000000..95131b17 --- /dev/null +++ b/doc/libtrap-devel/search/defines_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['unix_5fpath_5ffilename_5fformat',['UNIX_PATH_FILENAME_FORMAT',['../ifc__tcpip_8h.html#a9a43a10e1db0d4d4f9254776ca795d51',1,'ifc_tcpip.h']]] +]; diff --git a/doc/libtrap-devel/search/defines_a.html b/doc/libtrap-devel/search/defines_a.html new file mode 100644 index 00000000..d6b491aa --- /dev/null +++ b/doc/libtrap-devel/search/defines_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/defines_a.js b/doc/libtrap-devel/search/defines_a.js new file mode 100644 index 00000000..e90ffc26 --- /dev/null +++ b/doc/libtrap-devel/search/defines_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['x',['X',['../ifc__tcpip_8c.html#a53042471e9975ea6e004fafe0266f1c9',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a618c2e7d70c13a7d7f980ce67333f0ee',1,'X(): ifc_tcpip.c'],['../ifc__tcpip_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tcpip.c'],['../ifc__tls_8c.html#a7782d5beaec931dd3bcfa060c6bf9bbd',1,'X(): ifc_tls.c'],['../trap_8c.html#a93ee0641006e250f610013636769b06d',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c'],['../trap_8c.html#a045b94c0576825bf7f83aa58a69d7b45',1,'X(): trap.c']]] +]; diff --git a/doc/libtrap-devel/search/enums_0.html b/doc/libtrap-devel/search/enums_0.html new file mode 100644 index 00000000..9efcd1b7 --- /dev/null +++ b/doc/libtrap-devel/search/enums_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enums_0.js b/doc/libtrap-devel/search/enums_0.js new file mode 100644 index 00000000..c69d1de1 --- /dev/null +++ b/doc/libtrap-devel/search/enums_0.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['tcpip_5fifc_5fsockettype',['tcpip_ifc_sockettype',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6',1,'ifc_tcpip.h']]], + ['trap_5fdata_5fformat_5ft',['trap_data_format_t',['../group__trap__mess__fmt.html#gafbdd4209c0e285278d2134a0500164ad',1,'trap.h']]], + ['trap_5fifc_5ftype',['trap_ifc_type',['../group__ifctypes.html#gac188fb5e77d8af514d8091c21a9570c8',1,'trap.h']]], + ['trap_5fifcctl_5frequest',['trap_ifcctl_request',['../group__commonapi.html#gac99821743a91f2288f5ea8d3ae6b424c',1,'trap.h']]], + ['trap_5fin_5fifc_5fstate_5ft',['trap_in_ifc_state_t',['../group__trap__mess__fmt.html#gad79809a2452f1e8a4db4e635fb0bd89e',1,'trap.h']]], + ['trap_5fverbose_5flevel',['trap_verbose_level',['../group__debug.html#ga026a516df99452f5adc8c51e6703f5b5',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/enums_1.html b/doc/libtrap-devel/search/enums_1.html new file mode 100644 index 00000000..0edd7796 --- /dev/null +++ b/doc/libtrap-devel/search/enums_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enums_1.js b/doc/libtrap-devel/search/enums_1.js new file mode 100644 index 00000000..8f2b0f35 --- /dev/null +++ b/doc/libtrap-devel/search/enums_1.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['tcpip_5fifc_5fsockettype',['tcpip_ifc_sockettype',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6',1,'ifc_tcpip.h']]], + ['tcpip_5fsender_5fresult',['tcpip_sender_result',['../group__tcpip__sender.html#gac9d2a14d5f36c214bfd88d8bcc67c259',1,'ifc_tcpip.c']]], + ['tls_5fsender_5fresult',['tls_sender_result',['../group__tls__sender.html#gab4c9969dd6b6362d01804745fdbbcf55',1,'ifc_tls.c']]], + ['tlsclient_5fsend_5fstate',['tlsclient_send_state',['../group__tls__sender.html#ga31e27a4e78b29949b7edc71d7d73293b',1,'ifc_tls_internal.h']]], + ['trap_5fdata_5fformat_5ft',['trap_data_format_t',['../group__trap__mess__fmt.html#gafbdd4209c0e285278d2134a0500164ad',1,'trap.h']]], + ['trap_5fifc_5ftype',['trap_ifc_type',['../group__ifctypes.html#gac188fb5e77d8af514d8091c21a9570c8',1,'trap.h']]], + ['trap_5fifcctl_5frequest',['trap_ifcctl_request',['../group__commonapi.html#gac99821743a91f2288f5ea8d3ae6b424c',1,'trap.h']]], + ['trap_5fin_5fifc_5fstate_5ft',['trap_in_ifc_state_t',['../group__trap__mess__fmt.html#gad79809a2452f1e8a4db4e635fb0bd89e',1,'trap.h']]], + ['trap_5fverbose_5flevel',['trap_verbose_level',['../group__debug.html#ga026a516df99452f5adc8c51e6703f5b5',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_0.html b/doc/libtrap-devel/search/enumvalues_0.html new file mode 100644 index 00000000..03fdfad9 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_0.js b/doc/libtrap-devel/search/enumvalues_0.js new file mode 100644 index 00000000..e5e5b76e --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_0.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['cl_5ferror',['CL_ERROR',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5a7d2d5c2be626b647030d2a96dca9c25c',1,'trap_internal.h']]], + ['cl_5fverbose_5fadvanced',['CL_VERBOSE_ADVANCED',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5a70e0896f569c67e5ffd85846345fa494',1,'trap_internal.h']]], + ['cl_5fverbose_5fbasic',['CL_VERBOSE_BASIC',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5ac7c6ab33e3db6df58d41132611a86332',1,'trap_internal.h']]], + ['cl_5fverbose_5flibrary',['CL_VERBOSE_LIBRARY',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5ac93a326ee9cdda52bc41f878b73f2aaf',1,'trap_internal.h']]], + ['cl_5fverbose_5foff',['CL_VERBOSE_OFF',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5aa9ab9cf91ada6d27372253af6807226a',1,'trap_internal.h']]], + ['cl_5fwarning',['CL_WARNING',['../group__debug.html#gga026a516df99452f5adc8c51e6703f5b5aae8f3e688028c2bf0324ef1b0abb5469',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_1.html b/doc/libtrap-devel/search/enumvalues_1.html new file mode 100644 index 00000000..abeea564 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_1.js b/doc/libtrap-devel/search/enumvalues_1.js new file mode 100644 index 00000000..68b2dd1e --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_1.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['fmt_5fchanged',['FMT_CHANGED',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea4f7787cd8d6cd8173c1a7a9449b39a5d',1,'trap.h']]], + ['fmt_5fmismatch',['FMT_MISMATCH',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea29dfd7b9fb30ace5fcdc6a719d320de2',1,'trap.h']]], + ['fmt_5fok',['FMT_OK',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea28ac36336d4d5862d01074677e45ce13',1,'trap.h']]], + ['fmt_5fwaiting',['FMT_WAITING',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea83c14af470a24348e2e667016c6c5d41',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_2.html b/doc/libtrap-devel/search/enumvalues_2.html new file mode 100644 index 00000000..90289986 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_2.js b/doc/libtrap-devel/search/enumvalues_2.js new file mode 100644 index 00000000..78e3ab1b --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_2.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['trap_5ffmt_5fjson',['TRAP_FMT_JSON',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164adab683cfedbefc09299295768bfc566aed',1,'trap.h']]], + ['trap_5ffmt_5fraw',['TRAP_FMT_RAW',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada62494ba4588111acd4873a21f6a73262',1,'trap.h']]], + ['trap_5ffmt_5funirec',['TRAP_FMT_UNIREC',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada6ac00a120fdc99b1ccef72e4c31310f2',1,'trap.h']]], + ['trap_5ffmt_5funknown',['TRAP_FMT_UNKNOWN',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada3cb9037147bcf0255468111565ecaca0',1,'trap.h']]], + ['trap_5fifc_5ftcpip',['TRAP_IFC_TCPIP',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6ae6959499c01e61e64ed29e9ddd966b9d',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5fservice',['TRAP_IFC_TCPIP_SERVICE',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a000d79136dba6246c00948d7f4a7c973',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5funix',['TRAP_IFC_TCPIP_UNIX',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a76ba7a0bc22671335c11ac423e5f9222',1,'ifc_tcpip.h']]], + ['trapctl_5fautoflush_5ftimeout',['TRAPCTL_AUTOFLUSH_TIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca69ebb9c0a47e7aa0c21440a6373e083a',1,'trap.h']]], + ['trapctl_5fbufferswitch',['TRAPCTL_BUFFERSWITCH',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca0698228277af04dfe4c5565de8263538',1,'trap.h']]], + ['trapctl_5fsettimeout',['TRAPCTL_SETTIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca7c42332f519ee4671d7f674198d6a023',1,'trap.h']]], + ['trapifc_5finput',['TRAPIFC_INPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a95482ca4ea5f849965438493b6c5640c',1,'trap.h']]], + ['trapifc_5foutput',['TRAPIFC_OUTPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a3465118a68f82fd201ec4ce516f687aa',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_3.html b/doc/libtrap-devel/search/enumvalues_3.html new file mode 100644 index 00000000..b152efcb --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_3.js b/doc/libtrap-devel/search/enumvalues_3.js new file mode 100644 index 00000000..68b2dd1e --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_3.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['fmt_5fchanged',['FMT_CHANGED',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea4f7787cd8d6cd8173c1a7a9449b39a5d',1,'trap.h']]], + ['fmt_5fmismatch',['FMT_MISMATCH',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea29dfd7b9fb30ace5fcdc6a719d320de2',1,'trap.h']]], + ['fmt_5fok',['FMT_OK',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea28ac36336d4d5862d01074677e45ce13',1,'trap.h']]], + ['fmt_5fwaiting',['FMT_WAITING',['../group__trap__mess__fmt.html#ggad79809a2452f1e8a4db4e635fb0bd89ea83c14af470a24348e2e667016c6c5d41',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_4.html b/doc/libtrap-devel/search/enumvalues_4.html new file mode 100644 index 00000000..3f50abb8 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_4.js b/doc/libtrap-devel/search/enumvalues_4.js new file mode 100644 index 00000000..b8ed1f44 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['somebody_5ftimedout',['SOMEBODY_TIMEDOUT',['../group__tcpip__sender.html#ggac9d2a14d5f36c214bfd88d8bcc67c259a25e04f87fe3a613f0f16d41e7d402e8f',1,'SOMEBODY_TIMEDOUT(): ifc_tcpip.c'],['../group__tls__sender.html#ggab4c9969dd6b6362d01804745fdbbcf55a25e04f87fe3a613f0f16d41e7d402e8f',1,'SOMEBODY_TIMEDOUT(): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/enumvalues_5.html b/doc/libtrap-devel/search/enumvalues_5.html new file mode 100644 index 00000000..b6f20f29 --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/enumvalues_5.js b/doc/libtrap-devel/search/enumvalues_5.js new file mode 100644 index 00000000..eac9059a --- /dev/null +++ b/doc/libtrap-devel/search/enumvalues_5.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['tlsbackup_5fbuffer',['TLSBACKUP_BUFFER',['../group__tls__sender.html#gga31e27a4e78b29949b7edc71d7d73293ba44cce9416d55afdc613a507346c9609c',1,'ifc_tls_internal.h']]], + ['tlscurrent_5fcomplete',['TLSCURRENT_COMPLETE',['../group__tls__sender.html#gga31e27a4e78b29949b7edc71d7d73293ba1adf98c4061d98e9152a2e9fc41b5be8',1,'ifc_tls_internal.h']]], + ['tlscurrent_5fhead',['TLSCURRENT_HEAD',['../group__tls__sender.html#gga31e27a4e78b29949b7edc71d7d73293ba695cc100ed93ce8f84f3d4107a8f3f94',1,'ifc_tls_internal.h']]], + ['tlscurrent_5fidle',['TLSCURRENT_IDLE',['../group__tls__sender.html#gga31e27a4e78b29949b7edc71d7d73293baf74634242735711b55d346fb794d30ee',1,'ifc_tls_internal.h']]], + ['tlscurrent_5fpayload',['TLSCURRENT_PAYLOAD',['../group__tls__sender.html#gga31e27a4e78b29949b7edc71d7d73293bafee620b20fc21b99fc1553a73b18532e',1,'ifc_tls_internal.h']]], + ['trap_5ffmt_5fjson',['TRAP_FMT_JSON',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164adab683cfedbefc09299295768bfc566aed',1,'trap.h']]], + ['trap_5ffmt_5fraw',['TRAP_FMT_RAW',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada62494ba4588111acd4873a21f6a73262',1,'trap.h']]], + ['trap_5ffmt_5funirec',['TRAP_FMT_UNIREC',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada6ac00a120fdc99b1ccef72e4c31310f2',1,'trap.h']]], + ['trap_5ffmt_5funknown',['TRAP_FMT_UNKNOWN',['../group__trap__mess__fmt.html#ggafbdd4209c0e285278d2134a0500164ada3cb9037147bcf0255468111565ecaca0',1,'trap.h']]], + ['trap_5fifc_5ftcpip',['TRAP_IFC_TCPIP',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6ae6959499c01e61e64ed29e9ddd966b9d',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5fservice',['TRAP_IFC_TCPIP_SERVICE',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a000d79136dba6246c00948d7f4a7c973',1,'ifc_tcpip.h']]], + ['trap_5fifc_5ftcpip_5funix',['TRAP_IFC_TCPIP_UNIX',['../ifc__tcpip_8h.html#a5893d62a74cf9d99455f8226678f68e6a76ba7a0bc22671335c11ac423e5f9222',1,'ifc_tcpip.h']]], + ['trapctl_5fautoflush_5ftimeout',['TRAPCTL_AUTOFLUSH_TIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca69ebb9c0a47e7aa0c21440a6373e083a',1,'trap.h']]], + ['trapctl_5fbufferswitch',['TRAPCTL_BUFFERSWITCH',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca0698228277af04dfe4c5565de8263538',1,'trap.h']]], + ['trapctl_5fsettimeout',['TRAPCTL_SETTIMEOUT',['../group__commonapi.html#ggac99821743a91f2288f5ea8d3ae6b424ca7c42332f519ee4671d7f674198d6a023',1,'trap.h']]], + ['trapifc_5finput',['TRAPIFC_INPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a95482ca4ea5f849965438493b6c5640c',1,'trap.h']]], + ['trapifc_5foutput',['TRAPIFC_OUTPUT',['../group__ifctypes.html#ggac188fb5e77d8af514d8091c21a9570c8a3465118a68f82fd201ec4ce516f687aa',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/files_0.html b/doc/libtrap-devel/search/files_0.html new file mode 100644 index 00000000..49606c82 --- /dev/null +++ b/doc/libtrap-devel/search/files_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/files_0.js b/doc/libtrap-devel/search/files_0.js new file mode 100644 index 00000000..949302d9 --- /dev/null +++ b/doc/libtrap-devel/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['develop_2dinterface_2etxt',['develop-interface.txt',['../develop-interface_8txt.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/files_1.html b/doc/libtrap-devel/search/files_1.html new file mode 100644 index 00000000..c8871748 --- /dev/null +++ b/doc/libtrap-devel/search/files_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/files_1.js b/doc/libtrap-devel/search/files_1.js new file mode 100644 index 00000000..c733b87d --- /dev/null +++ b/doc/libtrap-devel/search/files_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['help_5ftrapifcspec_2ec',['help_trapifcspec.c',['../help__trapifcspec_8c.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/files_2.html b/doc/libtrap-devel/search/files_2.html new file mode 100644 index 00000000..99bdf21c --- /dev/null +++ b/doc/libtrap-devel/search/files_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/files_2.js b/doc/libtrap-devel/search/files_2.js new file mode 100644 index 00000000..ffcf1235 --- /dev/null +++ b/doc/libtrap-devel/search/files_2.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['ifc_5fdummy_2ec',['ifc_dummy.c',['../ifc__dummy_8c.html',1,'']]], + ['ifc_5fdummy_2eh',['ifc_dummy.h',['../ifc__dummy_8h.html',1,'']]], + ['ifc_5ffile_2ec',['ifc_file.c',['../ifc__file_8c.html',1,'']]], + ['ifc_5ffile_2eh',['ifc_file.h',['../ifc__file_8h.html',1,'']]], + ['ifc_5fsocket_5fcommon_2eh',['ifc_socket_common.h',['../ifc__socket__common_8h.html',1,'']]], + ['ifc_5ftcpip_2ec',['ifc_tcpip.c',['../ifc__tcpip_8c.html',1,'']]], + ['ifc_5ftcpip_2eh',['ifc_tcpip.h',['../ifc__tcpip_8h.html',1,'']]], + ['ifc_5ftcpip_5finternal_2eh',['ifc_tcpip_internal.h',['../ifc__tcpip__internal_8h.html',1,'']]], + ['ifc_5ftls_2ec',['ifc_tls.c',['../ifc__tls_8c.html',1,'']]], + ['ifc_5ftls_2eh',['ifc_tls.h',['../ifc__tls_8h.html',1,'']]], + ['ifc_5ftls_5finternal_2eh',['ifc_tls_internal.h',['../ifc__tls__internal_8h.html',1,'']]], + ['index_2ddevel_2etxt',['index-devel.txt',['../index-devel_8txt.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/files_3.html b/doc/libtrap-devel/search/files_3.html new file mode 100644 index 00000000..f8e543a8 --- /dev/null +++ b/doc/libtrap-devel/search/files_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/files_3.js b/doc/libtrap-devel/search/files_3.js new file mode 100644 index 00000000..81e6000b --- /dev/null +++ b/doc/libtrap-devel/search/files_3.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['trap_2ec',['trap.c',['../trap_8c.html',1,'']]], + ['trap_2eh',['trap.h',['../trap_8h.html',1,'']]], + ['trap_5ferror_2ec',['trap_error.c',['../trap__error_8c.html',1,'']]], + ['trap_5ferror_2eh',['trap_error.h',['../trap__error_8h.html',1,'']]], + ['trap_5fifc_2eh',['trap_ifc.h',['../trap__ifc_8h.html',1,'']]], + ['trap_5finternal_2ec',['trap_internal.c',['../trap__internal_8c.html',1,'']]], + ['trap_5finternal_2eh',['trap_internal.h',['../trap__internal_8h.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/functions_0.html b/doc/libtrap-devel/search/functions_0.html new file mode 100644 index 00000000..0539c8ce --- /dev/null +++ b/doc/libtrap-devel/search/functions_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_0.js b/doc/libtrap-devel/search/functions_0.js new file mode 100644 index 00000000..e5f1ceac --- /dev/null +++ b/doc/libtrap-devel/search/functions_0.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['_5f_5fattribute_5f_5f',['__attribute__',['../group__tcpip__ifc.html#ga286096a9223f09488d24f90c788dcf01',1,'__attribute__((used)): ifc_tcpip.c'],['../trap_8c.html#a6e607992566a02a054cbc51e6a910cd4',1,'__attribute__((used)): trap.c'],['../trap__internal_8h.html#a9a45c722e7e08a072917e8022ded49f7',1,'__attribute__((__packed__)): trap_internal.h']]], + ['_5f_5fsync_5fadd_5fand_5ffetch_5f8',['__sync_add_and_fetch_8',['../trap__internal_8c.html#a280c90d38779a6dfe9a811fe90ddb719',1,'__sync_add_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#a280c90d38779a6dfe9a811fe90ddb719',1,'__sync_add_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5fand_5fand_5ffetch_5f8',['__sync_and_and_fetch_8',['../trap__internal_8c.html#aac8dc6fad1de2284c38354df2fdc959b',1,'__sync_and_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#aac8dc6fad1de2284c38354df2fdc959b',1,'__sync_and_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5fbool_5fcompare_5fand_5fswap_5f8',['__sync_bool_compare_and_swap_8',['../trap__internal_8c.html#a5dcfe918d45603882c13f14c50a07712',1,'__sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval): trap_internal.c'],['../trap__internal_8h.html#a5dcfe918d45603882c13f14c50a07712',1,'__sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval): trap_internal.c']]], + ['_5f_5fsync_5ffetch_5fand_5fadd_5f8',['__sync_fetch_and_add_8',['../trap__internal_8c.html#af7ea138068d5672a867450bf28258d7d',1,'__sync_fetch_and_add_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#af7ea138068d5672a867450bf28258d7d',1,'__sync_fetch_and_add_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5f_5fsync_5for_5fand_5ffetch_5f8',['__sync_or_and_fetch_8',['../trap__internal_8c.html#a5c425573071638073feaa8810b8697f6',1,'__sync_or_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c'],['../trap__internal_8h.html#a5c425573071638073feaa8810b8697f6',1,'__sync_or_and_fetch_8(uint64_t *ptr, uint64_t value): trap_internal.c']]], + ['_5fmkdir',['_mkdir',['../group__file__ifc.html#ga4e35bdd146626b0b3a93d5689762fbea',1,'ifc_file.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_1.html b/doc/libtrap-devel/search/functions_1.html new file mode 100644 index 00000000..4878b3d1 --- /dev/null +++ b/doc/libtrap-devel/search/functions_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_1.js b/doc/libtrap-devel/search/functions_1.js new file mode 100644 index 00000000..30c1835f --- /dev/null +++ b/doc/libtrap-devel/search/functions_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['accept_5fclients_5fthread',['accept_clients_thread',['../group__tcpip__sender.html#gad3a65816f2a41268758c569a7a368ff1',1,'accept_clients_thread(void *arg): ifc_tcpip.c'],['../group__tls__sender.html#gad3a65816f2a41268758c569a7a368ff1',1,'accept_clients_thread(void *arg): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_10.html b/doc/libtrap-devel/search/functions_10.html new file mode 100644 index 00000000..6f6fbae2 --- /dev/null +++ b/doc/libtrap-devel/search/functions_10.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_10.js b/doc/libtrap-devel/search/functions_10.js new file mode 100644 index 00000000..9a3644c5 --- /dev/null +++ b/doc/libtrap-devel/search/functions_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['wait_5ffor_5fconnection',['wait_for_connection',['../group__tcpip__receiver.html#gaad3458f11c60698cc6a994bb9f812e2c',1,'wait_for_connection(int sock, struct timeval *tv): ifc_tcpip.c'],['../group__tls__receiver.html#gaad3458f11c60698cc6a994bb9f812e2c',1,'wait_for_connection(int sock, struct timeval *tv): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_2.html b/doc/libtrap-devel/search/functions_2.html new file mode 100644 index 00000000..67d2a392 --- /dev/null +++ b/doc/libtrap-devel/search/functions_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_2.js b/doc/libtrap-devel/search/functions_2.js new file mode 100644 index 00000000..f1b3f944 --- /dev/null +++ b/doc/libtrap-devel/search/functions_2.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['blackhole_5fdestroy',['blackhole_destroy',['../ifc__dummy_8c.html#ac56203fa44517d4715c2a3217106ced2',1,'ifc_dummy.c']]], + ['blackhole_5fflush',['blackhole_flush',['../ifc__dummy_8c.html#a10b1f70e84c818d39d44894d923b938e',1,'ifc_dummy.c']]], + ['blackhole_5fget_5fclient_5fcount',['blackhole_get_client_count',['../ifc__dummy_8c.html#a3a87d918cf7dc8762ca7b7c175e66afd',1,'ifc_dummy.c']]], + ['blackhole_5fget_5fclient_5fstats_5fjson',['blackhole_get_client_stats_json',['../ifc__dummy_8c.html#abfd570c7ba9523508aa88b80326048e7',1,'ifc_dummy.c']]], + ['blackhole_5fifc_5fget_5fid',['blackhole_ifc_get_id',['../ifc__dummy_8c.html#ad8ce96b416b251a97c0018dfe2d755be',1,'ifc_dummy.c']]], + ['blackhole_5fsend',['blackhole_send',['../ifc__dummy_8c.html#a9a7c40601ef4e8017c3d2a36b758b716',1,'ifc_dummy.c']]], + ['blackhole_5fterminate',['blackhole_terminate',['../ifc__dummy_8c.html#ab392f3cf1b0144994ee015604f4dc216',1,'ifc_dummy.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_3.html b/doc/libtrap-devel/search/functions_3.html new file mode 100644 index 00000000..1f0eedb3 --- /dev/null +++ b/doc/libtrap-devel/search/functions_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_3.js b/doc/libtrap-devel/search/functions_3.js new file mode 100644 index 00000000..4e2fcb45 --- /dev/null +++ b/doc/libtrap-devel/search/functions_3.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['check_5findex',['check_index',['../ifc__socket__common_8h.html#ae012366578b1a5928acb569f5792a8e4',1,'ifc_socket_common.h']]], + ['check_5fportrange',['check_portrange',['../group__tcpip__ifc.html#ga0925b2a05afa60bb981a19d2e76cc2d2',1,'ifc_tcpip.c']]], + ['client_5fsocket_5fconnect',['client_socket_connect',['../group__tcpip__receiver.html#gab162898982b46b7d50290308ef3eb769',1,'client_socket_connect(void *priv, const char *dest_addr, const char *dest_port, int *socket_descriptor, struct timeval *tv): ifc_tcpip.c'],['../group__tls__receiver.html#ga7108575bc12d369768a50cf8e6198e68',1,'client_socket_connect(tls_receiver_private_t *c, struct timeval *tv): ifc_tls.c']]], + ['client_5fsocket_5fdisconnect',['client_socket_disconnect',['../group__tcpip__receiver.html#ga7d3a1df60320e3e2c58be93bdec7e452',1,'client_socket_disconnect(void *priv): ifc_tcpip.c'],['../group__tls__receiver.html#ga7d3a1df60320e3e2c58be93bdec7e452',1,'client_socket_disconnect(void *priv): ifc_tls.c']]], + ['create_5fblackhole_5fifc',['create_blackhole_ifc',['../ifc__dummy_8c.html#ab7edb3a6122008f3ea180f8adad08117',1,'create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc): ifc_dummy.c'],['../ifc__dummy_8h.html#ab7edb3a6122008f3ea180f8adad08117',1,'create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc): ifc_dummy.c']]], + ['create_5fdump',['create_dump',['../ifc__dummy_8c.html#a064d9b95d6510856a0eba2cadd7d4f66',1,'ifc_dummy.c']]], + ['create_5ffile_5frecv_5fifc',['create_file_recv_ifc',['../group__file__receiver.html#gadc3824536a691ef65c730c0047ae1f6c',1,'create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_file.c'],['../group__file__receiver.html#gadc3824536a691ef65c730c0047ae1f6c',1,'create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_file.c']]], + ['create_5ffile_5fsend_5fifc',['create_file_send_ifc',['../group__file__sender.html#ga5c7c2366ebad27e5ff4e66322ed7ec73',1,'create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_file.c'],['../group__file__sender.html#ga5c7c2366ebad27e5ff4e66322ed7ec73',1,'create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_file.c']]], + ['create_5fgenerator_5fifc',['create_generator_ifc',['../ifc__dummy_8c.html#a6e7d094e5d1db868b323b52fa76b9636',1,'create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc): ifc_dummy.c'],['../ifc__dummy_8h.html#a6e7d094e5d1db868b323b52fa76b9636',1,'create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc): ifc_dummy.c']]], + ['create_5fnext_5ffilename',['create_next_filename',['../group__file__ifc.html#gaeb8c7500558d6d4827acfab569d2b0af',1,'ifc_file.c']]], + ['create_5ftcpip_5freceiver_5fifc',['create_tcpip_receiver_ifc',['../group__tcpip__receiver.html#gae9c7c5600b33d5225fe4a8d04a1b3af2',1,'create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c'],['../group__tcpip__receiver.html#gae9c7c5600b33d5225fe4a8d04a1b3af2',1,'create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t itx, enum tcpip_ifc_sockettype type): ifc_tcpip.c']]], + ['create_5ftcpip_5fsender_5fifc',['create_tcpip_sender_ifc',['../group__tcpip__sender.html#ga19dfb1ff5fc8916e8c4bd1e0800bf9df',1,'create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c'],['../group__tcpip__sender.html#ga19dfb1ff5fc8916e8c4bd1e0800bf9df',1,'create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type): ifc_tcpip.c']]], + ['create_5ftls_5freceiver_5fifc',['create_tls_receiver_ifc',['../group__tls__receiver.html#ga825fd4776caae6897e8c8e941fe4de33',1,'create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_tls.c'],['../group__tls__receiver.html#ga825fd4776caae6897e8c8e941fe4de33',1,'create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx): ifc_tls.c']]], + ['create_5ftls_5fsender_5fifc',['create_tls_sender_ifc',['../group__tls__sender.html#ga70f857962c64531165db580c0820f9d7',1,'create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_tls.c'],['../group__tls__sender.html#ga70f857962c64531165db580c0820f9d7',1,'create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_4.html b/doc/libtrap-devel/search/functions_4.html new file mode 100644 index 00000000..c5bf87a4 --- /dev/null +++ b/doc/libtrap-devel/search/functions_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_4.js b/doc/libtrap-devel/search/functions_4.js new file mode 100644 index 00000000..98577216 --- /dev/null +++ b/doc/libtrap-devel/search/functions_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['del_5findex',['del_index',['../ifc__socket__common_8h.html#a7eb87b37dc056b1535404fdc12a42bd3',1,'ifc_socket_common.h']]], + ['disconnect_5fclient',['disconnect_client',['../group__tcpip__sender.html#gad8033ef37f49bbe4b01b29a511f107a7',1,'disconnect_client(tcpip_sender_private_t *priv, int cl_id): ifc_tcpip.c'],['../group__tls__sender.html#ga10574da0c956724741173a3fe5c8eea3',1,'disconnect_client(tls_sender_private_t *priv, int cl_id): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_5.html b/doc/libtrap-devel/search/functions_5.html new file mode 100644 index 00000000..a34446ce --- /dev/null +++ b/doc/libtrap-devel/search/functions_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_5.js b/doc/libtrap-devel/search/functions_5.js new file mode 100644 index 00000000..f8e38786 --- /dev/null +++ b/doc/libtrap-devel/search/functions_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['encode_5fcnts_5fto_5fjson',['encode_cnts_to_json',['../group__supervisor.html#gac987671508929a3664e703d9884fc58b',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_6.html b/doc/libtrap-devel/search/functions_6.html new file mode 100644 index 00000000..6fd4b1f3 --- /dev/null +++ b/doc/libtrap-devel/search/functions_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_6.js b/doc/libtrap-devel/search/functions_6.js new file mode 100644 index 00000000..cdc6cc94 --- /dev/null +++ b/doc/libtrap-devel/search/functions_6.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['file_5fcreate_5fdump',['file_create_dump',['../group__file__ifc.html#ga87730dbc566bc75c062ef8320e95ce08',1,'ifc_file.c']]], + ['file_5fdestroy',['file_destroy',['../group__file__ifc.html#gaab5dc7028507246eaa18eb0ce1bbfa60',1,'ifc_file.c']]], + ['file_5fflush',['file_flush',['../group__file__sender.html#ga159700c278c2b3bfdc40b0dbca3880d6',1,'ifc_file.c']]], + ['file_5fget_5fclient_5fcount',['file_get_client_count',['../group__file__sender.html#gad8d2e1557a04cd5c6a2fd5c722ecaacd',1,'ifc_file.c']]], + ['file_5fget_5fclient_5fstats_5fjson',['file_get_client_stats_json',['../group__file__sender.html#ga372655b12fa8a43fcba5e0240306885b',1,'ifc_file.c']]], + ['file_5frecv',['file_recv',['../group__file__receiver.html#ga04d056bce3131b5857c1b337a9c4341d',1,'ifc_file.c']]], + ['file_5frecv_5fifc_5fget_5fid',['file_recv_ifc_get_id',['../group__file__receiver.html#ga56fb5e7e44c4cc38d2fdc1c5a1ccd91a',1,'ifc_file.c']]], + ['file_5frecv_5fifc_5fis_5fconn',['file_recv_ifc_is_conn',['../group__file__receiver.html#ga495ae064256c7d03083b842c9dc5f0cf',1,'ifc_file.c']]], + ['file_5fsend',['file_send',['../group__file__sender.html#ga919f85f1befced920f91f1c8e7cd4e69',1,'ifc_file.c']]], + ['file_5fsend_5fifc_5fget_5fid',['file_send_ifc_get_id',['../group__file__sender.html#ga8884e86269fc6b140df7f8a2b1927ed2',1,'ifc_file.c']]], + ['file_5fterminate',['file_terminate',['../group__file__ifc.html#ga46fc8df7837e8ea42e85133a9fcd3e49',1,'ifc_file.c']]], + ['file_5fwrite_5fbuffer',['file_write_buffer',['../group__file__sender.html#gaca49ec64aaa518a6e2e9c5396ccd3dc9',1,'ifc_file.c']]], + ['finish_5fbuffer',['finish_buffer',['../group__file__sender.html#ga584d20386ac54de01865ab04c1ec99df',1,'finish_buffer(file_buffer_t *buffer): ifc_file.c'],['../group__tcpip__sender.html#gab869dcac96b4cbda388a9d40a35c5eb7',1,'finish_buffer(tcpip_sender_private_t *priv, buffer_t *buffer): ifc_tcpip.c'],['../group__tls__sender.html#ga329b6a3a0d0527736d44acfafd2be576',1,'finish_buffer(tls_sender_private_t *priv, buffer_t *buffer): ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_7.html b/doc/libtrap-devel/search/functions_7.html new file mode 100644 index 00000000..6e09abf1 --- /dev/null +++ b/doc/libtrap-devel/search/functions_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_7.js b/doc/libtrap-devel/search/functions_7.js new file mode 100644 index 00000000..d2089c1f --- /dev/null +++ b/doc/libtrap-devel/search/functions_7.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['generator_5fdestroy',['generator_destroy',['../ifc__dummy_8c.html#a5f5b4ed13c71d88e3227816269408d7d',1,'ifc_dummy.c']]], + ['generator_5fifc_5fget_5fid',['generator_ifc_get_id',['../ifc__dummy_8c.html#a1b40bee42c536c742a9533b56740e78e',1,'ifc_dummy.c']]], + ['generator_5fifc_5fis_5fconn',['generator_ifc_is_conn',['../ifc__dummy_8c.html#afd5cb06e77b00bc241680b7590698571',1,'ifc_dummy.c']]], + ['generator_5frecv',['generator_recv',['../ifc__dummy_8c.html#a203edf773b635e53b635b60139495bdb',1,'ifc_dummy.c']]], + ['generator_5fterminate',['generator_terminate',['../ifc__dummy_8c.html#a6987f7fe70dc8e21205dac583bb2457c',1,'ifc_dummy.c']]], + ['get_5fcur_5ftimestamp',['get_cur_timestamp',['../group__tcpip__receiver.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): ifc_tcpip.c'],['../group__tls__sender.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): ifc_tls.c'],['../group__contextapi.html#ga83472c2cd46eac526175b30d48495135',1,'get_cur_timestamp(): trap.c']]], + ['get_5fin_5faddr',['get_in_addr',['../group__tcpip__ifc.html#ga67d03b167f8adca86cde7eeed5850982',1,'get_in_addr(struct sockaddr *sa): ifc_tcpip.c'],['../group__tls__ifc.html#ga67d03b167f8adca86cde7eeed5850982',1,'get_in_addr(struct sockaddr *sa): ifc_tls.c']]], + ['get_5flevel',['get_level',['../trap__internal_8c.html#abc051816fb35ec8ec9cba4d99460acc4',1,'trap_internal.c']]], + ['get_5fmodule_5fname',['get_module_name',['../trap_8c.html#ac7b9ed8ab44057b9ad6a53f98b81d4a4',1,'trap.c']]], + ['get_5fparam_5fby_5fdelimiter',['get_param_by_delimiter',['../trap_8c.html#a2186e85312c99ab71fb9466c9fda0e5a',1,'trap.c']]], + ['get_5fterminal_5fwidth',['get_terminal_width',['../trap_8c.html#a4d05e2325a8020e342295597aef447a4',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_8.html b/doc/libtrap-devel/search/functions_8.html new file mode 100644 index 00000000..d59ea971 --- /dev/null +++ b/doc/libtrap-devel/search/functions_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_8.js b/doc/libtrap-devel/search/functions_8.js new file mode 100644 index 00000000..d28acf8d --- /dev/null +++ b/doc/libtrap-devel/search/functions_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['handle_5finifc_5fsetters',['handle_inifc_setters',['../group__contextapi.html#ga9fdbcb1c73cc4df9cef9b1e782cfb6af',1,'trap.c']]], + ['handle_5foutifc_5fsetters',['handle_outifc_setters',['../group__contextapi.html#ga7ea44d513b6c0e105a38d93a4360880a',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_9.html b/doc/libtrap-devel/search/functions_9.html new file mode 100644 index 00000000..5ccec429 --- /dev/null +++ b/doc/libtrap-devel/search/functions_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_9.js b/doc/libtrap-devel/search/functions_9.js new file mode 100644 index 00000000..6e555d71 --- /dev/null +++ b/doc/libtrap-devel/search/functions_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['input_5fifc_5fnegotiation',['input_ifc_negotiation',['../trap_8c.html#a2c722200cdfbd15e5ab203e88e44bc33',1,'input_ifc_negotiation(void *ifc_priv_data, char ifc_type): trap.c'],['../trap_8h.html#a2c722200cdfbd15e5ab203e88e44bc33',1,'input_ifc_negotiation(void *ifc_priv_data, char ifc_type): trap.c']]], + ['insert_5finto_5fbuffer',['insert_into_buffer',['../group__file__sender.html#ga3570e854829adb6314a2589e10393f9f',1,'insert_into_buffer(file_buffer_t *buffer, const void *data, uint16_t size): ifc_file.c'],['../ifc__socket__common_8h.html#af5a1afc2e76d7beb1bbe068f30581925',1,'insert_into_buffer(buffer_t *buffer, const void *data, uint16_t size): ifc_socket_common.h']]] +]; diff --git a/doc/libtrap-devel/search/functions_a.html b/doc/libtrap-devel/search/functions_a.html new file mode 100644 index 00000000..3958eb7b --- /dev/null +++ b/doc/libtrap-devel/search/functions_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_a.js b/doc/libtrap-devel/search/functions_a.js new file mode 100644 index 00000000..04a28a30 --- /dev/null +++ b/doc/libtrap-devel/search/functions_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['output_5fifc_5fnegotiation',['output_ifc_negotiation',['../trap_8c.html#a392fc5b75861ca76dd868dc05af20cdc',1,'output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx): trap.c'],['../trap_8h.html#a392fc5b75861ca76dd868dc05af20cdc',1,'output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx): trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_b.html b/doc/libtrap-devel/search/functions_b.html new file mode 100644 index 00000000..b99b702d --- /dev/null +++ b/doc/libtrap-devel/search/functions_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_b.js b/doc/libtrap-devel/search/functions_b.js new file mode 100644 index 00000000..5bdc0d11 --- /dev/null +++ b/doc/libtrap-devel/search/functions_b.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['print_5faligned',['print_aligned',['../trap_8c.html#a682459a46e96db216ba53576cec54040',1,'trap.c']]], + ['print_5faligned_5fmultiline',['print_aligned_multiline',['../trap_8c.html#a64b9357a0c937d4f20e3b7f259174f75',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_c.html b/doc/libtrap-devel/search/functions_c.html new file mode 100644 index 00000000..3a33d874 --- /dev/null +++ b/doc/libtrap-devel/search/functions_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_c.js b/doc/libtrap-devel/search/functions_c.js new file mode 100644 index 00000000..7a33b825 --- /dev/null +++ b/doc/libtrap-devel/search/functions_c.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['receive_5fpart',['receive_part',['../group__tcpip__receiver.html#gabe0a6881a61e366a8cf11c4b90ba3698',1,'receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm): ifc_tcpip.c'],['../group__tls__receiver.html#gabe0a6881a61e366a8cf11c4b90ba3698',1,'receive_part(void *priv, void **data, uint32_t *size, struct timeval *tm): ifc_tls.c']]], + ['remove_5fsetter_5ffrom_5fparam',['remove_setter_from_param',['../group__contextapi.html#gab887e30e4251f7bc48485799bfad173a',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_d.html b/doc/libtrap-devel/search/functions_d.html new file mode 100644 index 00000000..31b75b88 --- /dev/null +++ b/doc/libtrap-devel/search/functions_d.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_d.js b/doc/libtrap-devel/search/functions_d.js new file mode 100644 index 00000000..11a3b340 --- /dev/null +++ b/doc/libtrap-devel/search/functions_d.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['send_5fdata',['send_data',['../group__tcpip__sender.html#ga1c122c5ed90b47bd03fa9e22b18d5c82',1,'send_data(tcpip_sender_private_t *priv, client_t *c, uint32_t cl_id): ifc_tcpip.c'],['../group__tls__sender.html#ga83aa590c182c7739d18df9f42fd90944',1,'send_data(tls_sender_private_t *priv, tlsclient_t *c, uint32_t cl_id): ifc_tls.c']]], + ['sending_5fthread_5ffunc',['sending_thread_func',['../group__tcpip__sender.html#ga029de4ad961a1d3d89a52cbc5e3a10a0',1,'sending_thread_func(void *priv): ifc_tcpip.c'],['../group__tls__sender.html#ga029de4ad961a1d3d89a52cbc5e3a10a0',1,'sending_thread_func(void *priv): ifc_tls.c']]], + ['server_5fsocket_5fopen',['server_socket_open',['../group__tcpip__sender.html#gaf8253ffec1871584621b3dc838055d87',1,'server_socket_open(void *priv): ifc_tcpip.c'],['../group__tls__sender.html#gaf8253ffec1871584621b3dc838055d87',1,'server_socket_open(void *priv): ifc_tls.c']]], + ['service_5fget_5fdata',['service_get_data',['../group__supervisor.html#ga260e9f14321268444cab75b214a82811',1,'trap.c']]], + ['service_5fsend_5fdata',['service_send_data',['../group__supervisor.html#ga8a8ad4e5c6ac70d1d8dece93d58da755',1,'trap.c']]], + ['service_5fthread_5froutine',['service_thread_routine',['../group__supervisor.html#ga5f455505997f558e3f975b54a55aa65d',1,'trap.c']]], + ['set_5findex',['set_index',['../ifc__socket__common_8h.html#a39682f44b96aabab2c05f0d8b0186bee',1,'ifc_socket_common.h']]], + ['switch_5ffile',['switch_file',['../group__file__ifc.html#gac0f2fbc2888f6354257ac88d9a9853c1',1,'ifc_file.c']]], + ['switch_5ffile_5fwrapper',['switch_file_wrapper',['../group__file__ifc.html#ga32cd1cfb7fb21703391aee752a0d647e',1,'ifc_file.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_e.html b/doc/libtrap-devel/search/functions_e.html new file mode 100644 index 00000000..cddb9bb5 --- /dev/null +++ b/doc/libtrap-devel/search/functions_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_e.js b/doc/libtrap-devel/search/functions_e.js new file mode 100644 index 00000000..53e49b50 --- /dev/null +++ b/doc/libtrap-devel/search/functions_e.js @@ -0,0 +1,101 @@ +var searchData= +[ + ['tcpip_5freceiver_5fcreate_5fdump',['tcpip_receiver_create_dump',['../group__tcpip__receiver.html#ga6fa6335d8d722e969e66e4601893b053',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5fdestroy',['tcpip_receiver_destroy',['../group__tcpip__receiver.html#gac72d44fcf38e4740167ec967d083ee1c',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5frecv',['tcpip_receiver_recv',['../group__tcpip__receiver.html#gad93a311e4d889c963082988a3489f0c0',1,'ifc_tcpip.c']]], + ['tcpip_5freceiver_5fterminate',['tcpip_receiver_terminate',['../group__tcpip__receiver.html#ga3b90935d63bbc0262f3d45312a6962d4',1,'ifc_tcpip.c']]], + ['tcpip_5frecv_5fifc_5fget_5fid',['tcpip_recv_ifc_get_id',['../group__tcpip__receiver.html#gac897200a57fdb142b2a471cfd242107b',1,'ifc_tcpip.c']]], + ['tcpip_5frecv_5fifc_5fis_5fconn',['tcpip_recv_ifc_is_conn',['../group__tcpip__receiver.html#gabda68c8dca42004f03d7fa11e8078be2',1,'ifc_tcpip.c']]], + ['tcpip_5fsend_5fifc_5fget_5fid',['tcpip_send_ifc_get_id',['../group__tcpip__sender.html#ga90dbe211caa71064dd3c44b9eac5932a',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fcreate_5fdump',['tcpip_sender_create_dump',['../group__tcpip__sender.html#ga7cb4c51ce43d85a04c6406a17fc1fe0b',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fdestroy',['tcpip_sender_destroy',['../group__tcpip__sender.html#ga5ad10441ac50af06112eee9db2047919',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fflush',['tcpip_sender_flush',['../group__tcpip__sender.html#ga84f6fd9cc7f2ecb7f175f2149b6381a5',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fget_5fclient_5fcount',['tcpip_sender_get_client_count',['../group__tcpip__sender.html#ga3d1beceb2af358ffb6116184e9f61026',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fget_5fclient_5fstats_5fjson',['tcpip_sender_get_client_stats_json',['../group__tcpip__sender.html#ga610a2d03c2351110e984fc74c26356bf',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fsend',['tcpip_sender_send',['../group__tcpip__sender.html#ga4c778885040ccd9dafe56b1f9ecd355f',1,'ifc_tcpip.c']]], + ['tcpip_5fsender_5fterminate',['tcpip_sender_terminate',['../group__tcpip__sender.html#ga0b43746d012021fe6af3b6fde17d12c3',1,'ifc_tcpip.c']]], + ['tcpip_5fserver_5fdisconnect_5fall_5fclients',['tcpip_server_disconnect_all_clients',['../group__tcpip__sender.html#gab09f65cfd346e2d795e09e7b3533e95a',1,'ifc_tcpip.c']]], + ['tls_5fconfigure_5fctx',['tls_configure_ctx',['../group__tls__ifc.html#ga5ca1db90a22c8ddedc5e88c4992d53c0',1,'ifc_tls.c']]], + ['tls_5freceiver_5fcreate_5fdump',['tls_receiver_create_dump',['../group__tls__receiver.html#ga1ce46e0e5685ba0484f6c20d6634f0be',1,'ifc_tls.c']]], + ['tls_5freceiver_5fdestroy',['tls_receiver_destroy',['../group__tls__receiver.html#gaa1c6a709f10285070373a2153e5c99bd',1,'ifc_tls.c']]], + ['tls_5freceiver_5frecv',['tls_receiver_recv',['../group__tls__receiver.html#gaa57cf3a16267d7213589886a11a8e2b1',1,'ifc_tls.c']]], + ['tls_5freceiver_5fterminate',['tls_receiver_terminate',['../group__tls__receiver.html#ga21cd7b2e5b2a0b0839a8d796b618fadf',1,'ifc_tls.c']]], + ['tls_5frecv_5fifc_5fget_5fid',['tls_recv_ifc_get_id',['../group__tls__receiver.html#gad96732e9b2d458007350ae013f39e08b',1,'ifc_tls.c']]], + ['tls_5frecv_5fifc_5fis_5fconn',['tls_recv_ifc_is_conn',['../group__tls__receiver.html#ga27a72e24932cd5c81e5eac4356b6a1b8',1,'ifc_tls.c']]], + ['tls_5fsend_5fifc_5fget_5fid',['tls_send_ifc_get_id',['../group__tls__sender.html#gaa359345fa6728d47aa48b8d8510cbfa1',1,'ifc_tls.c']]], + ['tls_5fsender_5fcreate_5fdump',['tls_sender_create_dump',['../group__tls__sender.html#ga6a5c96daa3b31f978960c4a6e7254dc0',1,'ifc_tls.c']]], + ['tls_5fsender_5fdestroy',['tls_sender_destroy',['../group__tls__sender.html#gab89480d7e111593867b3d31b8fd7af97',1,'ifc_tls.c']]], + ['tls_5fsender_5fflush',['tls_sender_flush',['../group__tls__sender.html#ga7275190583a84764542fa8814ff0b4de',1,'ifc_tls.c']]], + ['tls_5fsender_5fget_5fclient_5fcount',['tls_sender_get_client_count',['../group__tls__sender.html#ga917b981d1bafb671093a40c0216e07fa',1,'ifc_tls.c']]], + ['tls_5fsender_5fget_5fclient_5fstats_5fjson',['tls_sender_get_client_stats_json',['../group__tls__sender.html#ga523e71d675979d48e01a634ef54d652d',1,'ifc_tls.c']]], + ['tls_5fsender_5fsend',['tls_sender_send',['../group__tls__sender.html#ga67c0673f9a702036f37933840891192a',1,'ifc_tls.c']]], + ['tls_5fsender_5fterminate',['tls_sender_terminate',['../group__tls__sender.html#gad3e0654a4636e0d138b15529aff51131',1,'ifc_tls.c']]], + ['tls_5fserver_5fconfigure_5fctx',['tls_server_configure_ctx',['../group__tls__ifc.html#gac210df49fc535a17e99fd54220a26bb7',1,'ifc_tls.c']]], + ['tls_5fserver_5fdisconnect_5fall_5fclients',['tls_server_disconnect_all_clients',['../group__tls__sender.html#ga3f5aa45f5c8641f9fd83159208d62647',1,'ifc_tls.c']]], + ['tlsclient_5fcreate_5fcontext',['tlsclient_create_context',['../group__tls__ifc.html#ga935780a2ed8282257f7592df061ec763',1,'ifc_tls.c']]], + ['tlsserver_5fcreate_5fcontext',['tlsserver_create_context',['../group__tls__ifc.html#ga0013ab56b5b70304b618c0d9ba36b828',1,'ifc_tls.c']]], + ['trap_5fcheck_5fbuffer_5fcontent',['trap_check_buffer_content',['../group__buffering.html#gab4ba2c95a8817983f23a58aae093f48f',1,'trap_check_buffer_content(void *buffer, uint32_t buffer_size): trap.c'],['../group__commonapi.html#gab4ba2c95a8817983f23a58aae093f48f',1,'trap_check_buffer_content(void *buffer, uint32_t buffer_size): trap.c']]], + ['trap_5fcheck_5fglobal_5fvars',['trap_check_global_vars',['../trap_8c.html#a1fa1a6cb72b2c1d4ee2230d02879b595',1,'trap.c']]], + ['trap_5fconvert_5fmodule_5finfo_5fto_5fjson',['trap_convert_module_info_to_json',['../trap_8c.html#aa7d12305ed7cd625f63bf7280cdd179c',1,'trap.c']]], + ['trap_5fcreate_5fctx_5ft',['trap_create_ctx_t',['../group__contextapi.html#gac49fa7525b8de6bbc6d37fc52f11e1be',1,'trap_create_ctx_t(): trap.c'],['../group__contextapi.html#gac49fa7525b8de6bbc6d37fc52f11e1be',1,'trap_create_ctx_t(): trap.c']]], + ['trap_5fcreate_5fmodule_5finfo',['trap_create_module_info',['../trap_8c.html#a0a1fe50eb250f63d0150294af2721916',1,'trap.c']]], + ['trap_5fctx_5fcmp_5fdata_5ffmt',['trap_ctx_cmp_data_fmt',['../group__trap__mess__fmt.html#ga1a036c53c7629eb220fa582a7a4ae56c',1,'trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt): trap.c'],['../group__commonapi.html#ga1a036c53c7629eb220fa582a7a4ae56c',1,'trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt): trap.c']]], + ['trap_5fctx_5fcreate_5fifc_5fdump',['trap_ctx_create_ifc_dump',['../group__supervisor.html#ga19b26aef67596239ccc72a6f0f1d05fd',1,'trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path): trap.c'],['../group__contextapi.html#ga19b26aef67596239ccc72a6f0f1d05fd',1,'trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path): trap.c']]], + ['trap_5fctx_5ffinalize',['trap_ctx_finalize',['../group__contextapi.html#ga5b84d682c3c68fe814896f7f002b319b',1,'trap.c']]], + ['trap_5fctx_5fget_5fclient_5fcount',['trap_ctx_get_client_count',['../group__supervisor.html#gacf18085a199ed89010eaf8afb375f2db',1,'trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx): trap.c'],['../group__contextapi.html#gacf18085a199ed89010eaf8afb375f2db',1,'trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx): trap.c']]], + ['trap_5fctx_5fget_5fdata_5ffmt',['trap_ctx_get_data_fmt',['../group__trap__mess__fmt.html#gacba5dba90afc66aa5fa36b505c49226f',1,'trap.c']]], + ['trap_5fctx_5fget_5fin_5fifc_5fstate',['trap_ctx_get_in_ifc_state',['../group__trap__mess__fmt.html#ga0f4ff32ca8352ec4ebbbaf4c40d2e8b7',1,'trap.c']]], + ['trap_5fctx_5fget_5flast_5ferror',['trap_ctx_get_last_error',['../group__contextapi.html#ga2902ffa62edfbfae946d232ff446b1f4',1,'trap.c']]], + ['trap_5fctx_5fget_5flast_5ferror_5fmsg',['trap_ctx_get_last_error_msg',['../group__contextapi.html#ga7c98c3764b024c49bb50ac850fa65f79',1,'trap.c']]], + ['trap_5fctx_5fget_5fverbose_5flevel',['trap_ctx_get_verbose_level',['../group__contextapi.html#gae0d72b263e714adcf85b5b15dad98dad',1,'trap.h']]], + ['trap_5fctx_5fifcctl',['trap_ctx_ifcctl',['../group__contextapi.html#ga5ef43a88e58beb25cfbceed7643e5fba',1,'trap.c']]], + ['trap_5fctx_5finit',['trap_ctx_init',['../group__contextapi.html#gad63272a184d3a4f5a386bf10629f4266',1,'trap.c']]], + ['trap_5fctx_5finit2',['trap_ctx_init2',['../group__contextapi.html#ga5a66c582ecfb422c02716d64020ca4f3',1,'trap.c']]], + ['trap_5fctx_5finit3',['trap_ctx_init3',['../group__contextapi.html#ga9a78b1581ccf324cb9dd1f4222b5d083',1,'trap.c']]], + ['trap_5fctx_5frecv',['trap_ctx_recv',['../group__contextapi.html#ga000e7c5b259aad735f066f2e5e8529bb',1,'trap.c']]], + ['trap_5fctx_5fsend',['trap_ctx_send',['../group__contextapi.html#ga9201daf1d4b3123b1caeab26e50c3a61',1,'trap.c']]], + ['trap_5fctx_5fsend_5fflush',['trap_ctx_send_flush',['../group__contextapi.html#ga94141c10e9f43926c03fe1404650b768',1,'trap.c']]], + ['trap_5fctx_5fset_5fdata_5ffmt',['trap_ctx_set_data_fmt',['../group__trap__mess__fmt.html#gae876dcd1ae5562bc85c7a10d93909e76',1,'trap.c']]], + ['trap_5fctx_5fset_5frequired_5ffmt',['trap_ctx_set_required_fmt',['../group__trap__mess__fmt.html#ga016bd84888f31fe8caf652553fb053aa',1,'trap.c']]], + ['trap_5fctx_5fset_5fverbose_5flevel',['trap_ctx_set_verbose_level',['../group__contextapi.html#ga91d29b40d546e03bd132854c7ae2bf9c',1,'trap.h']]], + ['trap_5fctx_5fterminate',['trap_ctx_terminate',['../group__contextapi.html#ga8fb998ec081c6f0ad96a669d95efcfe7',1,'trap.c']]], + ['trap_5fctx_5fvifcctl',['trap_ctx_vifcctl',['../group__contextapi.html#ga5d734e6839140420db59190197d7cac8',1,'trap.c']]], + ['trap_5fctx_5fvset_5fdata_5ffmt',['trap_ctx_vset_data_fmt',['../group__trap__mess__fmt.html#gae2a28b33476acd05869aebfd99b140fd',1,'trap.c']]], + ['trap_5fctx_5fvset_5frequired_5ffmt',['trap_ctx_vset_required_fmt',['../group__trap__mess__fmt.html#gafa497348ff404d5a26d349b63a8888d5',1,'trap.c']]], + ['trap_5ferror',['trap_error',['../trap__error_8h.html#a41ae164bf79849bf28e8043fc242577a',1,'trap_error.h']]], + ['trap_5ferrorf',['trap_errorf',['../trap__error_8h.html#afbe885c6cdd55431071f2164f1bc6208',1,'trap_error.h']]], + ['trap_5ferrorp',['trap_errorp',['../trap__error_8h.html#af4cc92d8e7364457eb530294a4ca5a27',1,'trap_error.h']]], + ['trap_5ffinalize',['trap_finalize',['../group__simpleapi.html#ga2694fb89b2da11d529ef69c21f2197ef',1,'trap_finalize(): trap.c'],['../group__simpleapi.html#ga2694fb89b2da11d529ef69c21f2197ef',1,'trap_finalize(): trap.c']]], + ['trap_5ffree_5fctx_5ft',['trap_free_ctx_t',['../group__contextapi.html#ga68be429edf74da1b74bede6ff2c785d3',1,'trap.c']]], + ['trap_5ffree_5fglobal_5fvars',['trap_free_global_vars',['../trap_8c.html#a40c47f921815265e8958850041f1e6ae',1,'trap.c']]], + ['trap_5ffree_5fifc_5fspec',['trap_free_ifc_spec',['../group__simpleapi.html#ga957443419c0e9961b8efba34f8e79009',1,'trap_free_ifc_spec(trap_ifc_spec_t ifc_spec): trap.c'],['../group__simpleapi.html#ga957443419c0e9961b8efba34f8e79009',1,'trap_free_ifc_spec(trap_ifc_spec_t ifc_spec): trap.c']]], + ['trap_5fget_5fdata_5ffmt',['trap_get_data_fmt',['../group__trap__mess__fmt.html#gaafb028aba366c69626fb86f85700128b',1,'trap.c']]], + ['trap_5fget_5fglobal_5fctx',['trap_get_global_ctx',['../group__trap__mess__fmt.html#gaf23b66446f6a9549460c6f9315fa612b',1,'trap_get_global_ctx(): trap.c'],['../group__commonapi.html#gaf23b66446f6a9549460c6f9315fa612b',1,'trap_get_global_ctx(): trap.c']]], + ['trap_5fget_5fin_5fifc_5fstate',['trap_get_in_ifc_state',['../group__trap__mess__fmt.html#ga0e46ea6655ac72ab1508a092cec5b05e',1,'trap_get_in_ifc_state(uint32_t ifc_idx): trap.c'],['../group__commonapi.html#ga0e46ea6655ac72ab1508a092cec5b05e',1,'trap_get_in_ifc_state(uint32_t ifc_idx): trap.c']]], + ['trap_5fget_5finternal_5fbuffer',['trap_get_internal_buffer',['../trap_8c.html#a8969280e1c6d6b509b837b310631e8db',1,'trap.c']]], + ['trap_5fget_5fparam_5fby_5fdelimiter',['trap_get_param_by_delimiter',['../group__commonapi.html#ga4b31b73a73b203d80cfcb424ccd9edf5',1,'trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter): trap.c'],['../group__commonapi.html#ga4b31b73a73b203d80cfcb424ccd9edf5',1,'trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter): trap.c']]], + ['trap_5fget_5ftype_5fand_5fname_5ffrom_5fstring',['trap_get_type_and_name_from_string',['../group__trap__mess__fmt.html#ga8cb714bba0bf01ccf7584332936e2113',1,'trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type): trap.c'],['../group__commonapi.html#ga8cb714bba0bf01ccf7584332936e2113',1,'trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type): trap.c']]], + ['trap_5fget_5fverbose_5flevel',['trap_get_verbose_level',['../group__simpleapi.html#gaf7d9a764eeb924fe2dedaed0b79b2cec',1,'trap_get_verbose_level(): trap.c'],['../group__simpleapi.html#gaf7d9a764eeb924fe2dedaed0b79b2cec',1,'trap_get_verbose_level(): trap.c']]], + ['trap_5fifcctl',['trap_ifcctl',['../group__simpleapi.html#ga63de9d9334839f0fe2871ab5a987be32',1,'trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...): trap.c'],['../group__simpleapi.html#ga63de9d9334839f0fe2871ab5a987be32',1,'trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...): trap.c']]], + ['trap_5finit',['trap_init',['../group__simpleapi.html#ga7d7849e0fda93ec1502cb55c1b10cc34',1,'trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec): trap.c'],['../group__simpleapi.html#ga7d7849e0fda93ec1502cb55c1b10cc34',1,'trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec): trap.c']]], + ['trap_5fjson_5fprint_5fstring',['trap_json_print_string',['../trap_8c.html#a87804f44234503c9e31d37702a7706e2',1,'trap.c']]], + ['trap_5fparse_5fparams',['trap_parse_params',['../group__commonapi.html#gaefbccf1d04407e6d79ab4b8a8307cdf9',1,'trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec): trap.c'],['../group__commonapi.html#gaefbccf1d04407e6d79ab4b8a8307cdf9',1,'trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec): trap.c']]], + ['trap_5fprint_5fhelp',['trap_print_help',['../group__simpleapi.html#gaaec5413b3ef25596138f12ae65e58097',1,'trap_print_help(const trap_module_info_t *module_info): trap.c'],['../group__simpleapi.html#gaaec5413b3ef25596138f12ae65e58097',1,'trap_print_help(const trap_module_info_t *module_info): trap.c']]], + ['trap_5fprint_5fifc_5fspec_5fhelp',['trap_print_ifc_spec_help',['../group__simpleapi.html#ga594bc6f6e105611a06b5e1235796e758',1,'trap_print_ifc_spec_help(): trap.c'],['../group__simpleapi.html#ga594bc6f6e105611a06b5e1235796e758',1,'trap_print_ifc_spec_help(): trap.c']]], + ['trap_5fread_5ffrom_5fbuffer',['trap_read_from_buffer',['../group__buffering.html#ga1b570e9a0c3871ef23cc9fc649a110a1',1,'trap.c']]], + ['trap_5frecv',['trap_recv',['../group__simpleapi.html#gac8149d036a3b839adaeb876ccc9fcda5',1,'trap_recv(uint32_t ifcidx, const void **data, uint16_t *size): trap.c'],['../group__simpleapi.html#gac8149d036a3b839adaeb876ccc9fcda5',1,'trap_recv(uint32_t ifcidx, const void **data, uint16_t *size): trap.c']]], + ['trap_5fsend',['trap_send',['../group__simpleapi.html#ga165b017fa4b66422275c4e502ac95d2a',1,'trap_send(uint32_t ifcidx, const void *data, uint16_t size): trap.c'],['../group__simpleapi.html#ga165b017fa4b66422275c4e502ac95d2a',1,'trap_send(uint32_t ifcidx, const void *data, uint16_t size): trap.c']]], + ['trap_5fsend_5fdata',['trap_send_data',['../group__simpleapi.html#gab889fdf90a8a4103bfa072c64d2aed1e',1,'trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout): trap.c'],['../group__simpleapi.html#gab889fdf90a8a4103bfa072c64d2aed1e',1,'trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout): trap.c']]], + ['trap_5fsend_5fflush',['trap_send_flush',['../group__simpleapi.html#ga52ebce274203e2f54abc1ef487090618',1,'trap_send_flush(uint32_t ifc): trap.c'],['../group__simpleapi.html#ga52ebce274203e2f54abc1ef487090618',1,'trap_send_flush(uint32_t ifc): trap.c']]], + ['trap_5fset_5fabs_5ftimespec',['trap_set_abs_timespec',['../group__trap__ifc.html#gaa5100d1b2d961dbaf9ffa58aaebd6050',1,'trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk): trap.c'],['../group__trap__ifc.html#gaa5100d1b2d961dbaf9ffa58aaebd6050',1,'trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk): trap.c']]], + ['trap_5fset_5fdata_5ffmt',['trap_set_data_fmt',['../group__trap__mess__fmt.html#gaafa4932ad483eceed010a6b84972df02',1,'trap.c']]], + ['trap_5fset_5fhelp_5fsection',['trap_set_help_section',['../group__simpleapi.html#ga780616f8da6339da2c3f11441a6e0f91',1,'trap_set_help_section(int level): trap.c'],['../group__simpleapi.html#ga780616f8da6339da2c3f11441a6e0f91',1,'trap_set_help_section(int level): trap.c']]], + ['trap_5fset_5frequired_5ffmt',['trap_set_required_fmt',['../group__trap__mess__fmt.html#ga36d50e3cf2e6fdb959e7e5af660947f1',1,'trap.c']]], + ['trap_5fset_5ftimeouts',['trap_set_timeouts',['../group__trap__ifc.html#ga60d0627e30a6d9a3a8d3caf70f7137e4',1,'trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk): trap.c'],['../group__trap__ifc.html#ga60d0627e30a6d9a3a8d3caf70f7137e4',1,'trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk): trap.c']]], + ['trap_5fset_5fverbose_5flevel',['trap_set_verbose_level',['../group__simpleapi.html#ga896b102140653a204da81782981e04f6',1,'trap_set_verbose_level(int level): trap.c'],['../group__simpleapi.html#ga896b102140653a204da81782981e04f6',1,'trap_set_verbose_level(int level): trap.c']]], + ['trap_5fterminate',['trap_terminate',['../group__simpleapi.html#ga4fc7c94bc72b9400ea765187882d532e',1,'trap_terminate(): trap.c'],['../group__simpleapi.html#ga4fc7c94bc72b9400ea765187882d532e',1,'trap_terminate(): trap.c']]], + ['trap_5fupdate_5fmodule_5fparam',['trap_update_module_param',['../trap_8c.html#a63b7ddacd43d8be38ac3d3c18b374aa1',1,'trap.c']]], + ['trap_5fverbose_5fmsg',['trap_verbose_msg',['../group__debug.html#gadc507c418b7b19701be88c6b8438c7f9',1,'trap_verbose_msg(int level, char *string): trap_internal.c'],['../group__debug.html#gadc507c418b7b19701be88c6b8438c7f9',1,'trap_verbose_msg(int level, char *string): trap_internal.c']]], + ['trapifc_5fin_5fconstruct',['trapifc_in_construct',['../group__contextapi.html#ga8e3bd04c657631263c17fa9aa05d39e7',1,'trap.c']]], + ['trapifc_5fout_5fconstruct',['trapifc_out_construct',['../group__contextapi.html#ga30009499f64ee53baecf6b01263d9875',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/functions_f.html b/doc/libtrap-devel/search/functions_f.html new file mode 100644 index 00000000..49672926 --- /dev/null +++ b/doc/libtrap-devel/search/functions_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/functions_f.js b/doc/libtrap-devel/search/functions_f.js new file mode 100644 index 00000000..4e11a56d --- /dev/null +++ b/doc/libtrap-devel/search/functions_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['verify_5fcertificate',['verify_certificate',['../group__tls__ifc.html#ga1b1be6968656713b283b9918b310a0dc',1,'ifc_tls.c']]] +]; diff --git a/doc/libtrap-devel/search/groups_0.html b/doc/libtrap-devel/search/groups_0.html new file mode 100644 index 00000000..f4895cb4 --- /dev/null +++ b/doc/libtrap-devel/search/groups_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_0.js b/doc/libtrap-devel/search/groups_0.js new file mode 100644 index 00000000..9e4144fa --- /dev/null +++ b/doc/libtrap-devel/search/groups_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['buffering_20sublayer',['Buffering sublayer',['../group__buffering.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_1.html b/doc/libtrap-devel/search/groups_1.html new file mode 100644 index 00000000..31952659 --- /dev/null +++ b/doc/libtrap-devel/search/groups_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_1.js b/doc/libtrap-devel/search/groups_1.js new file mode 100644 index 00000000..00d0165c --- /dev/null +++ b/doc/libtrap-devel/search/groups_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['common_20libtrap_20api',['Common libtrap API',['../group__commonapi.html',1,'']]], + ['context_20api',['Context API',['../group__contextapi.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_2.html b/doc/libtrap-devel/search/groups_2.html new file mode 100644 index 00000000..58824467 --- /dev/null +++ b/doc/libtrap-devel/search/groups_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_2.js b/doc/libtrap-devel/search/groups_2.js new file mode 100644 index 00000000..541500dd --- /dev/null +++ b/doc/libtrap-devel/search/groups_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['error_20codes',['Error codes',['../group__errorcodes.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_3.html b/doc/libtrap-devel/search/groups_3.html new file mode 100644 index 00000000..bd23aa6e --- /dev/null +++ b/doc/libtrap-devel/search/groups_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_3.js b/doc/libtrap-devel/search/groups_3.js new file mode 100644 index 00000000..ea96e764 --- /dev/null +++ b/doc/libtrap-devel/search/groups_3.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['file_20interface_20module',['file interface module',['../group__file__ifc.html',1,'']]], + ['file_5freceiver',['File_receiver',['../group__file__receiver.html',1,'']]], + ['file_5fsender',['File_sender',['../group__file__sender.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_4.html b/doc/libtrap-devel/search/groups_4.html new file mode 100644 index 00000000..34edffce --- /dev/null +++ b/doc/libtrap-devel/search/groups_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_4.js b/doc/libtrap-devel/search/groups_4.js new file mode 100644 index 00000000..c67c16c9 --- /dev/null +++ b/doc/libtrap-devel/search/groups_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ifc_20counters',['IFC counters',['../group__ctxifccounters.html',1,'']]], + ['ifc_20api',['IFC API',['../group__trap__ifc__api.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_5.html b/doc/libtrap-devel/search/groups_5.html new file mode 100644 index 00000000..6d9adbf8 --- /dev/null +++ b/doc/libtrap-devel/search/groups_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_5.js b/doc/libtrap-devel/search/groups_5.js new file mode 100644 index 00000000..5281e865 --- /dev/null +++ b/doc/libtrap-devel/search/groups_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['macros_20for_20verbose_20and_20debug_20listings',['Macros for verbose and debug listings',['../group__debug.html',1,'']]], + ['message_20format',['Message format',['../group__trap__mess__fmt.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_6.html b/doc/libtrap-devel/search/groups_6.html new file mode 100644 index 00000000..f8f80851 --- /dev/null +++ b/doc/libtrap-devel/search/groups_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_6.js b/doc/libtrap-devel/search/groups_6.js new file mode 100644 index 00000000..ea7ce095 --- /dev/null +++ b/doc/libtrap-devel/search/groups_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['nemea_20module_20macros',['Nemea module macros',['../group__modulemacros.html',1,'']]], + ['negotiation_20return_20values',['Negotiation return values',['../group__negotiationretvals.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_7.html b/doc/libtrap-devel/search/groups_7.html new file mode 100644 index 00000000..8c734ab4 --- /dev/null +++ b/doc/libtrap-devel/search/groups_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_7.js b/doc/libtrap-devel/search/groups_7.js new file mode 100644 index 00000000..3d8a5103 --- /dev/null +++ b/doc/libtrap-devel/search/groups_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['simple_20api',['Simple API',['../group__simpleapi.html',1,'']]], + ['supervisor_20monitoring_20feature',['Supervisor monitoring feature',['../group__supervisor.html',1,'']]], + ['specifier_20of_20trap_20interfaces',['Specifier of TRAP interfaces',['../group__trapifcspec.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_8.html b/doc/libtrap-devel/search/groups_8.html new file mode 100644 index 00000000..2d0c65d4 --- /dev/null +++ b/doc/libtrap-devel/search/groups_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_8.js b/doc/libtrap-devel/search/groups_8.js new file mode 100644 index 00000000..a64922c3 --- /dev/null +++ b/doc/libtrap-devel/search/groups_8.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['types_20of_20ifc',['Types of IFC',['../group__ifctypes.html',1,'']]], + ['tcp_2fip_20and_20unix_20socket_20communication_20interface_20module',['TCP/IP and UNIX socket communication interface module',['../group__tcpip__ifc.html',1,'']]], + ['tcpip_20input_20ifc',['TCPIP input IFC',['../group__tcpip__receiver.html',1,'']]], + ['tcpip_20output_20ifc',['TCPIP output IFC',['../group__tcpip__sender.html',1,'']]], + ['tls_20communication_20interface_20module',['TLS communication interface module',['../group__tls__ifc.html',1,'']]], + ['tls_20input_20ifc',['TLS Input IFC',['../group__tls__receiver.html',1,'']]], + ['tls_20output_20ifc',['TLS Output IFC',['../group__tls__sender.html',1,'']]], + ['trap_20communication_20module_20interface',['TRAP communication module interface',['../group__trap__ifc.html',1,'']]], + ['trap_20timeout',['TRAP Timeout',['../group__trap__timeout.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_9.html b/doc/libtrap-devel/search/groups_9.html new file mode 100644 index 00000000..f7957bda --- /dev/null +++ b/doc/libtrap-devel/search/groups_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_9.js b/doc/libtrap-devel/search/groups_9.js new file mode 100644 index 00000000..3d8a5103 --- /dev/null +++ b/doc/libtrap-devel/search/groups_9.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['simple_20api',['Simple API',['../group__simpleapi.html',1,'']]], + ['supervisor_20monitoring_20feature',['Supervisor monitoring feature',['../group__supervisor.html',1,'']]], + ['specifier_20of_20trap_20interfaces',['Specifier of TRAP interfaces',['../group__trapifcspec.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/groups_a.html b/doc/libtrap-devel/search/groups_a.html new file mode 100644 index 00000000..98c7322e --- /dev/null +++ b/doc/libtrap-devel/search/groups_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/groups_a.js b/doc/libtrap-devel/search/groups_a.js new file mode 100644 index 00000000..a64922c3 --- /dev/null +++ b/doc/libtrap-devel/search/groups_a.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['types_20of_20ifc',['Types of IFC',['../group__ifctypes.html',1,'']]], + ['tcp_2fip_20and_20unix_20socket_20communication_20interface_20module',['TCP/IP and UNIX socket communication interface module',['../group__tcpip__ifc.html',1,'']]], + ['tcpip_20input_20ifc',['TCPIP input IFC',['../group__tcpip__receiver.html',1,'']]], + ['tcpip_20output_20ifc',['TCPIP output IFC',['../group__tcpip__sender.html',1,'']]], + ['tls_20communication_20interface_20module',['TLS communication interface module',['../group__tls__ifc.html',1,'']]], + ['tls_20input_20ifc',['TLS Input IFC',['../group__tls__receiver.html',1,'']]], + ['tls_20output_20ifc',['TLS Output IFC',['../group__tls__sender.html',1,'']]], + ['trap_20communication_20module_20interface',['TRAP communication module interface',['../group__trap__ifc.html',1,'']]], + ['trap_20timeout',['TRAP Timeout',['../group__trap__timeout.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/mag_sel.png b/doc/libtrap-devel/search/mag_sel.png new file mode 100644 index 00000000..81f6040a Binary files /dev/null and b/doc/libtrap-devel/search/mag_sel.png differ diff --git a/doc/libtrap-devel/search/nomatches.html b/doc/libtrap-devel/search/nomatches.html new file mode 100644 index 00000000..b1ded27e --- /dev/null +++ b/doc/libtrap-devel/search/nomatches.html @@ -0,0 +1,12 @@ + + + + + + + +
+
No Matches
+
+ + diff --git a/doc/libtrap-devel/search/pages_0.html b/doc/libtrap-devel/search/pages_0.html new file mode 100644 index 00000000..d7528582 --- /dev/null +++ b/doc/libtrap-devel/search/pages_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/pages_0.js b/doc/libtrap-devel/search/pages_0.js new file mode 100644 index 00000000..9bffa405 --- /dev/null +++ b/doc/libtrap-devel/search/pages_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['deprecated_20list',['Deprecated List',['../deprecated.html',1,'']]], + ['development_20of_20libtrap_20interface',['Development of libtrap interface',['../devel-ifc.html',1,'']]], + ['development_20documentation',['Development documentation',['../index.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/pages_1.html b/doc/libtrap-devel/search/pages_1.html new file mode 100644 index 00000000..924fb482 --- /dev/null +++ b/doc/libtrap-devel/search/pages_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/pages_1.js b/doc/libtrap-devel/search/pages_1.js new file mode 100644 index 00000000..441b2dec --- /dev/null +++ b/doc/libtrap-devel/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['todo_20list',['Todo List',['../todo.html',1,'']]] +]; diff --git a/doc/libtrap-devel/search/search.css b/doc/libtrap-devel/search/search.css new file mode 100644 index 00000000..3cf9df94 --- /dev/null +++ b/doc/libtrap-devel/search/search.css @@ -0,0 +1,271 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#MSearchBox { + white-space : nowrap; + float: none; + margin-top: 8px; + right: 0px; + width: 170px; + height: 24px; + z-index: 102; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:115px; + margin-left:20px; + padding-left:4px; + color: #909090; + outline: none; + font: 9pt Arial, Verdana, sans-serif; + -webkit-border-radius: 0px; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + top:8px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; + z-index:10000; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/doc/libtrap-devel/search/search.js b/doc/libtrap-devel/search/search.js new file mode 100644 index 00000000..a554ab9c --- /dev/null +++ b/doc/libtrap-devel/search/search.js @@ -0,0 +1,814 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches.html'; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName == 'DIV' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName == 'DIV' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_0.js b/doc/libtrap-devel/search/typedefs_0.js new file mode 100644 index 00000000..bf1384ad --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['buffer_5ft',['buffer_t',['../ifc__socket__common_8h.html#a9aa12143b2c71bd60b9418ee7f4d3bb6',1,'ifc_socket_common.h']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_1.html b/doc/libtrap-devel/search/typedefs_1.html new file mode 100644 index 00000000..7af807db --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_1.js b/doc/libtrap-devel/search/typedefs_1.js new file mode 100644 index 00000000..82a91eb1 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['client_5ft',['client_t',['../group__tcpip__sender.html#ga8db229da62af6e778b15d0dfeab62c2d',1,'ifc_tcpip_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_2.html b/doc/libtrap-devel/search/typedefs_2.html new file mode 100644 index 00000000..745d076c --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_2.js b/doc/libtrap-devel/search/typedefs_2.js new file mode 100644 index 00000000..3bb649dc --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['file_5fbuffer_5ft',['file_buffer_t',['../ifc__file_8h.html#a6771f3504e314bf07a67292019daf0fc',1,'ifc_file.h']]], + ['file_5fprivate_5ft',['file_private_t',['../ifc__file_8h.html#a309be75527e82357484eaba1295e654e',1,'ifc_file.h']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_3.html b/doc/libtrap-devel/search/typedefs_3.html new file mode 100644 index 00000000..def60a5b --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_3.js b/doc/libtrap-devel/search/typedefs_3.js new file mode 100644 index 00000000..28697019 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['generator_5fprivate_5ft',['generator_private_t',['../ifc__dummy_8c.html#a605f9f7108e53a58658ef2baee532ccd',1,'ifc_dummy.c']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_4.html b/doc/libtrap-devel/search/typedefs_4.html new file mode 100644 index 00000000..ef733ad2 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_4.js b/doc/libtrap-devel/search/typedefs_4.js new file mode 100644 index 00000000..d3f7a617 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hello_5fmsg_5fheader_5ft',['hello_msg_header_t',['../group__debug.html#ga0bb675fdd36b974d3cdf9b7405863eb1',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_5.html b/doc/libtrap-devel/search/typedefs_5.html new file mode 100644 index 00000000..94db6d21 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_5.js b/doc/libtrap-devel/search/typedefs_5.js new file mode 100644 index 00000000..00449bb2 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_5.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['ifc_5fautoflush_5ft',['ifc_autoflush_t',['../trap__internal_8h.html#a86ac574ead4f87e3db30492d68f4b55e',1,'trap_internal.h']]], + ['ifc_5fcreate_5fdump_5ffunc_5ft',['ifc_create_dump_func_t',['../group__trap__ifc__api.html#gad789bf24bbd5e30da20fc11dc732c544',1,'trap_ifc.h']]], + ['ifc_5fdestroy_5ffunc_5ft',['ifc_destroy_func_t',['../group__trap__ifc__api.html#gaef77298c8ccd823ddadf00368698c35f',1,'trap_ifc.h']]], + ['ifc_5fdisconn_5fclients_5ffunc_5ft',['ifc_disconn_clients_func_t',['../group__trap__ifc__api.html#gaf5f4628c38e49b659827242e0c9dbac1',1,'trap_ifc.h']]], + ['ifc_5fflush_5ffunc_5ft',['ifc_flush_func_t',['../group__trap__ifc__api.html#ga7c977395d33e33ab6fde6c50b8f25f7d',1,'trap_ifc.h']]], + ['ifc_5fget_5fclient_5fcount_5ffunc_5ft',['ifc_get_client_count_func_t',['../group__trap__ifc__api.html#gaa49b0bc8ebc826ed9112a1cb228eeef1',1,'trap_ifc.h']]], + ['ifc_5fget_5fclient_5fstats_5fjson_5ffunc_5ft',['ifc_get_client_stats_json_func_t',['../group__trap__ifc__api.html#gaa32b9a8860575cb4e268d06d0937de22',1,'trap_ifc.h']]], + ['ifc_5fget_5fid_5ffunc_5ft',['ifc_get_id_func_t',['../group__trap__ifc__api.html#gacb6c2dfcdb3afeeb6a61aa249ba2fcf6',1,'trap_ifc.h']]], + ['ifc_5fis_5fconn_5ffunc_5ft',['ifc_is_conn_func_t',['../group__trap__ifc__api.html#ga3d55759655bbae5059f00e151eafb5ff',1,'trap_ifc.h']]], + ['ifc_5frecv_5ffunc_5ft',['ifc_recv_func_t',['../group__trap__ifc__api.html#ga4df8e9b4c9b942e791128088c490bd58',1,'trap_ifc.h']]], + ['ifc_5fsend_5ffunc_5ft',['ifc_send_func_t',['../group__trap__ifc__api.html#gabfcce0a5be5c71565e19f8605c607283',1,'trap_ifc.h']]], + ['ifc_5fterminate_5ffunc_5ft',['ifc_terminate_func_t',['../group__trap__ifc__api.html#ga135751b3a4b270e8681881877095ec21',1,'trap_ifc.h']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_6.html b/doc/libtrap-devel/search/typedefs_6.html new file mode 100644 index 00000000..bda8ea1c --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_6.js b/doc/libtrap-devel/search/typedefs_6.js new file mode 100644 index 00000000..715a4756 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['msg_5fheader_5ft',['msg_header_t',['../group__supervisor.html#gaa438010db529a6f3b186ba789b877804',1,'trap.c']]] +]; diff --git a/doc/libtrap-devel/search/typedefs_7.html b/doc/libtrap-devel/search/typedefs_7.html new file mode 100644 index 00000000..565b233f --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/typedefs_7.js b/doc/libtrap-devel/search/typedefs_7.js new file mode 100644 index 00000000..8dbcf164 --- /dev/null +++ b/doc/libtrap-devel/search/typedefs_7.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['tcpip_5freceiver_5fprivate_5ft',['tcpip_receiver_private_t',['../group__tcpip__receiver.html#ga8c4c1adea41d582cd619ce9ee9b27aa3',1,'ifc_tcpip_internal.h']]], + ['tcpip_5fsender_5fprivate_5ft',['tcpip_sender_private_t',['../group__tcpip__sender.html#ga45657b399741b8bd08cbfcef2ad490f1',1,'ifc_tcpip_internal.h']]], + ['tls_5freceiver_5fprivate_5ft',['tls_receiver_private_t',['../group__tls__receiver.html#ga8e72f8a86412ea09d3497eb42438bbab',1,'ifc_tls_internal.h']]], + ['tls_5fsender_5fprivate_5ft',['tls_sender_private_t',['../group__tls__sender.html#ga07cc54970619735031e328a849dbbc83',1,'ifc_tls_internal.h']]], + ['tlsclient_5ft',['tlsclient_t',['../group__tls__sender.html#gab81355a0ad8e318125a88642ecd3544a',1,'ifc_tls_internal.h']]], + ['trap_5fbuffer_5fheader_5ft',['trap_buffer_header_t',['../trap__internal_8h.html#a40b126ea10058bade088e6246959fd97',1,'trap_internal.h']]], + ['trap_5fctx_5fpriv_5ft',['trap_ctx_priv_t',['../group__debug.html#ga7c1820c9482b11ef772ed7ef95d4f7f0',1,'trap_internal.h']]], + ['trap_5fifc_5fspec_5ft',['trap_ifc_spec_t',['../group__commonapi.html#ga6a9b60e8305f9c9af1c42b0b1dbac21b',1,'trap.h']]], + ['trap_5finput_5fifc_5ft',['trap_input_ifc_t',['../group__trap__ifc.html#ga7fed1038d017739605bf620f60d86f3d',1,'trap_ifc.h']]], + ['trap_5foutput_5fifc_5ft',['trap_output_ifc_t',['../group__trap__ifc.html#ga67931b1db8d9f47c96534b924252b370',1,'trap_ifc.h']]], + ['trap_5fverbose_5flevel_5ft',['trap_verbose_level_t',['../group__debug.html#ga9545680da8da49e3a0a59af63ff204ef',1,'trap_internal.h']]] +]; diff --git a/doc/libtrap-devel/search/variables_0.html b/doc/libtrap-devel/search/variables_0.html new file mode 100644 index 00000000..51f7bd6b --- /dev/null +++ b/doc/libtrap-devel/search/variables_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_0.js b/doc/libtrap-devel/search/variables_0.js new file mode 100644 index 00000000..b89c07ef --- /dev/null +++ b/doc/libtrap-devel/search/variables_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_5f_5fattribute_5f_5f',['__attribute__',['../group__ifctypes.html#ga0dc7518c8c83ec891c44073ca8a12974',1,'trap.h']]] +]; diff --git a/doc/libtrap-devel/search/variables_1.html b/doc/libtrap-devel/search/variables_1.html new file mode 100644 index 00000000..f46154d8 --- /dev/null +++ b/doc/libtrap-devel/search/variables_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_1.js b/doc/libtrap-devel/search/variables_1.js new file mode 100644 index 00000000..f98b73a2 --- /dev/null +++ b/doc/libtrap-devel/search/variables_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['accept_5fthr',['accept_thr',['../structtcpip__sender__private__s.html#af688f39844447509add21404319679d7',1,'tcpip_sender_private_s::accept_thr()'],['../structtls__sender__private__s.html#a38c2db22ad82addfc5c582ad15c57deb',1,'tls_sender_private_s::accept_thr()']]], + ['active_5fbuffer',['active_buffer',['../structtcpip__sender__private__s.html#a8cb92d563f4d8f5fabdf7957496569b8',1,'tcpip_sender_private_s::active_buffer()'],['../structtls__sender__private__s.html#ac233eb23578bf3726d4c0f95d821ebdc',1,'tls_sender_private_s::active_buffer()']]], + ['assigned_5fbuffer',['assigned_buffer',['../structclient__s.html#a58689156e1d447bc7d888164b16fb3d8',1,'client_s::assigned_buffer()'],['../structtlsclient__s.html#a89887e49546012db19081215dd06efd4',1,'tlsclient_s::assigned_buffer()']]], + ['atomic_5fmutex',['atomic_mutex',['../trap__internal_8c.html#a417e9acbbc27e47555ce6670c64121fb',1,'trap_internal.c']]], + ['autoflush_5ftimestamp',['autoflush_timestamp',['../structtcpip__sender__private__s.html#a2756e5f58f6fc3f786a8f60df248c9cf',1,'tcpip_sender_private_s::autoflush_timestamp()'],['../structtls__sender__private__s.html#adf7f478e809472a860eb1fa143e8ef9f',1,'tls_sender_private_s::autoflush_timestamp()']]] +]; diff --git a/doc/libtrap-devel/search/variables_10.html b/doc/libtrap-devel/search/variables_10.html new file mode 100644 index 00000000..b62b717e --- /dev/null +++ b/doc/libtrap-devel/search/variables_10.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_10.js b/doc/libtrap-devel/search/variables_10.js new file mode 100644 index 00000000..cd69f3be --- /dev/null +++ b/doc/libtrap-devel/search/variables_10.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['sd',['sd',['../structclient__s.html#ad3adabb7ae7c7acd95fc58b8c91274d0',1,'client_s::sd()'],['../structtcpip__receiver__private__s.html#adeeedd594c051b2634657dfaa1846189',1,'tcpip_receiver_private_s::sd()'],['../structtlsclient__s.html#a51dc25444cc24571d9c6b23a51dcd81d',1,'tlsclient_s::sd()'],['../structtls__receiver__private__s.html#ad969cc2935980f27fc7bbdf5ed27ef18',1,'tls_receiver_private_s::sd()']]], + ['sem',['sem',['../structreader__threads__s.html#af62b1ad716c2fa065143b125a31dfa7b',1,'reader_threads_s']]], + ['send',['send',['../structtrap__output__ifc__s.html#ae897ccae374c5ac1287d25391b1d5ba5',1,'trap_output_ifc_s']]], + ['send_5fthr',['send_thr',['../structtcpip__sender__private__s.html#a3057afc26c4862f9245e25d31a01cbc0',1,'tcpip_sender_private_s::send_thr()'],['../structtls__sender__private__s.html#a5998112ad5f7d6e572b5f3022bcbe21d',1,'tls_sender_private_s::send_thr()']]], + ['sending_5fpointer',['sending_pointer',['../structclient__s.html#aa7ae0554314e538955d14a4bfe2ca6fc',1,'client_s::sending_pointer()'],['../structtlsclient__s.html#aa48ac2d54ce0795e30a730ed6f6a927d',1,'tlsclient_s::sending_pointer()']]], + ['server_5fport',['server_port',['../structtcpip__sender__private__s.html#ad628d7081819b8236c693ba485cfd10b',1,'tcpip_sender_private_s::server_port()'],['../structtls__sender__private__s.html#a13c88f5e2dfdebfbbb2ab34d30897b76',1,'tls_sender_private_s::server_port()']]], + ['server_5fsd',['server_sd',['../structtcpip__sender__private__s.html#a7e0cc56dd2c6570b60ccbcfdfc6fc3ac',1,'tcpip_sender_private_s::server_sd()'],['../structtls__sender__private__s.html#addda5947d3e0b68d79c922f7300cee92',1,'tls_sender_private_s::server_sd()']]], + ['service_5fifc_5fname',['service_ifc_name',['../structtrap__ctx__priv__s.html#a2ff58b090a07f9fbc6795ecbcda326ee',1,'trap_ctx_priv_s']]], + ['service_5fthread',['service_thread',['../structtrap__ctx__priv__s.html#a8679c035870a267754ced49a2d3260e9',1,'trap_ctx_priv_s']]], + ['service_5fthread_5finitialized',['service_thread_initialized',['../structtrap__ctx__priv__s.html#a7e6b71dab19372c5baac9a9a8a6d27bd',1,'trap_ctx_priv_s']]], + ['socket_5ftype',['socket_type',['../structtcpip__sender__private__s.html#a19976c4d73b748dfd0a402fbe1d4a512',1,'tcpip_sender_private_s::socket_type()'],['../structtcpip__receiver__private__s.html#a9b9f68cd09485b9b2a50d012d9519edc',1,'tcpip_receiver_private_s::socket_type()']]], + ['ssl',['ssl',['../structtlsclient__s.html#a7784cbc5018b861a41948fbef28bc73c',1,'tlsclient_s::ssl()'],['../structtls__receiver__private__s.html#a712ad2731c418bbdbd08b01989f84f92',1,'tls_receiver_private_s::ssl()']]], + ['sslctx',['sslctx',['../structtls__sender__private__s.html#a691a55a9c7a7c50a5779afa5a5c99796',1,'tls_sender_private_s::sslctx()'],['../structtls__receiver__private__s.html#a59a066f97ece753d4c44f75af5ec4f66',1,'tls_receiver_private_s::sslctx()']]] +]; diff --git a/doc/libtrap-devel/search/variables_11.html b/doc/libtrap-devel/search/variables_11.html new file mode 100644 index 00000000..2ce8561a --- /dev/null +++ b/doc/libtrap-devel/search/variables_11.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_11.js b/doc/libtrap-devel/search/variables_11.js new file mode 100644 index 00000000..fefd5773 --- /dev/null +++ b/doc/libtrap-devel/search/variables_11.js @@ -0,0 +1,29 @@ +var searchData= +[ + ['tcpip_5faddr',['tcpip_addr',['../uniontcpip__socket__addr.html#a62e73f6a1f3324336efa8813fb1f05ed',1,'tcpip_socket_addr']]], + ['term_5fpipe',['term_pipe',['../structtcpip__sender__private__s.html#a2d291d39d4fa615d69eebeb4bffe1f4e',1,'tcpip_sender_private_s::term_pipe()'],['../structtls__sender__private__s.html#a249d112b71d13702659fd0d3f8385cad',1,'tls_sender_private_s::term_pipe()']]], + ['terminate',['terminate',['../structtrap__input__ifc__s.html#a4eba7ef455b394109a14d7e133a9fcd0',1,'trap_input_ifc_s::terminate()'],['../structtrap__output__ifc__s.html#ac7b9f92faabc9454e426e344d0fa42e1',1,'trap_output_ifc_s::terminate()']]], + ['terminated',['terminated',['../structtrap__ctx__priv__s.html#a1766aa58f50d6d56d3ec7b7d03830e82',1,'trap_ctx_priv_s']]], + ['thr',['thr',['../structreader__threads__s.html#a91f529465e26ed75d5bc193e6713d7a7',1,'reader_threads_s']]], + ['timeout',['timeout',['../structtrap__output__ifc__s.html#a12225c3a52f5fa28db243073ae58c2d3',1,'trap_output_ifc_s']]], + ['timeout_5ffixed',['timeout_fixed',['../structtrap__output__ifc__s.html#ae5f88f58a178f17e95596e4118fe69a8',1,'trap_output_ifc_s']]], + ['timeouts',['timeouts',['../structclient__s.html#accac71a3ff6b597e6138752c50306ae2',1,'client_s::timeouts()'],['../structtlsclient__s.html#a5ea334db46f220252917167566ca113e',1,'tlsclient_s::timeouts()']]], + ['timer_5flast',['timer_last',['../structclient__s.html#a280d8c33cf50280aa0053cf955278dc4',1,'client_s::timer_last()'],['../structtlsclient__s.html#abdc38614e0122200e245508bf0ca0714',1,'tlsclient_s::timer_last()']]], + ['timer_5ftotal',['timer_total',['../structclient__s.html#a0c58ec753aa9ec16990fb9500d1e940a',1,'client_s::timer_total()'],['../structtlsclient__s.html#ad0d2358902686e45c81f982712d6e69c',1,'tlsclient_s::timer_total()']]], + ['tls_5faddr',['tls_addr',['../uniontls__socket__addr.html#ab079470415e72216a900bbb4bac043ee',1,'tls_socket_addr']]], + ['tm',['tm',['../structautoflush__timeouts.html#ad0ba56ad8d8f9eaee10b847f0159265f',1,'autoflush_timeouts']]], + ['tm_5fbackup',['tm_backup',['../structautoflush__timeouts.html#a6271cc0799ca1890bb9d0b9514560dd7',1,'autoflush_timeouts']]], + ['trap_5fdebug',['trap_debug',['../group__debug.html#ga3b3befcce5bb831d533b29013308578e',1,'trap_debug(): trap_internal.c'],['../group__debug.html#ga3b3befcce5bb831d533b29013308578e',1,'trap_debug(): trap_internal.c']]], + ['trap_5fdefault_5fsocket_5fpath_5fformat',['trap_default_socket_path_format',['../group__commonapi.html#gaf7b7bed58a3f3c7900264fd442613526',1,'trap.h']]], + ['trap_5ferr_5fmsg',['trap_err_msg',['../group__debug.html#ga9735d32bc4c81447d8acada6f9a53d3e',1,'trap_err_msg(): trap_internal.c'],['../group__debug.html#ga9735d32bc4c81447d8acada6f9a53d3e',1,'trap_err_msg(): trap_internal.c']]], + ['trap_5fgit_5fversion',['trap_git_version',['../group__commonapi.html#gaf27b94a242d49569cd6f943023176083',1,'trap.h']]], + ['trap_5fglob_5fctx',['trap_glob_ctx',['../group__debug.html#ga4fcc14efc331481c2957dab472950df5',1,'trap_glob_ctx(): trap.c'],['../group__debug.html#ga4fcc14efc331481c2957dab472950df5',1,'trap_glob_ctx(): trap.c']]], + ['trap_5fhelp_5fifcspec',['trap_help_ifcspec',['../help__trapifcspec_8c.html#ad42ed2f9863287a22ef816d79e4cc4ab',1,'help_trapifcspec.c']]], + ['trap_5fhelp_5fspec',['trap_help_spec',['../trap_8c.html#ad538ab23674c9067a0dfd2570a521f7b',1,'trap.c']]], + ['trap_5fifc_5ftype_5fsupported',['trap_ifc_type_supported',['../group__ifctypes.html#ga6419b14997f2d75db88aae23213be54e',1,'trap_ifc_type_supported(): trap.c'],['../group__ifctypes.html#ga6419b14997f2d75db88aae23213be54e',1,'trap_ifc_type_supported(): trap.c']]], + ['trap_5flast_5ferror',['trap_last_error',['../structtrap__ctx__priv__s.html#a3df9ece66f6d6a59a99a720f12132539',1,'trap_ctx_priv_s::trap_last_error()'],['../group__simpleapi.html#ga605937391a4c6fbe1510bf4381a8a2b4',1,'trap_last_error(): trap.c'],['../group__simpleapi.html#ga605937391a4c6fbe1510bf4381a8a2b4',1,'trap_last_error(): trap.c']]], + ['trap_5flast_5ferror_5fmsg',['trap_last_error_msg',['../structtrap__ctx__priv__s.html#a9f89537f85add16fd2359ae690999247',1,'trap_ctx_priv_s::trap_last_error_msg()'],['../group__simpleapi.html#ga440c46189a0111c0946583c56e1ff7a9',1,'trap_last_error_msg(): trap.c'],['../group__simpleapi.html#ga440c46189a0111c0946583c56e1ff7a9',1,'trap_last_error_msg(): trap.c']]], + ['trap_5fverbose',['trap_verbose',['../group__debug.html#gaf2a32a74fdc82cfc2f13a9a8e4d32da1',1,'trap_verbose(): trap_internal.c'],['../group__debug.html#gaf2a32a74fdc82cfc2f13a9a8e4d32da1',1,'trap_verbose(): trap_internal.c']]], + ['trap_5fversion',['trap_version',['../group__commonapi.html#gabc3ef5d4460eee3691cc57d54ad3ee04',1,'trap.h']]], + ['types',['types',['../structtrap__ifc__spec__s.html#a6af4e85e62b9408f48e264516c5a4eae',1,'trap_ifc_spec_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_12.html b/doc/libtrap-devel/search/variables_12.html new file mode 100644 index 00000000..bba5857f --- /dev/null +++ b/doc/libtrap-devel/search/variables_12.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_12.js b/doc/libtrap-devel/search/variables_12.js new file mode 100644 index 00000000..14239363 --- /dev/null +++ b/doc/libtrap-devel/search/variables_12.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['unix_5faddr',['unix_addr',['../uniontcpip__socket__addr.html#af3851c41de7540cb7c6cbef21b04a850',1,'tcpip_socket_addr::unix_addr()'],['../uniontls__socket__addr.html#aa3a8625b304cdbce27b115c951abbae3',1,'tls_socket_addr::unix_addr()']]] +]; diff --git a/doc/libtrap-devel/search/variables_13.html b/doc/libtrap-devel/search/variables_13.html new file mode 100644 index 00000000..c92cbcc3 --- /dev/null +++ b/doc/libtrap-devel/search/variables_13.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_13.js b/doc/libtrap-devel/search/variables_13.js new file mode 100644 index 00000000..5fec801d --- /dev/null +++ b/doc/libtrap-devel/search/variables_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['wr_5findex',['wr_index',['../structfile__buffer__s.html#ab829db2e26b5af715fb2346977d8fd7b',1,'file_buffer_s::wr_index()'],['../structbuffer__s.html#a0fa940aa266e3ea33e46a13c1a570a3f',1,'buffer_s::wr_index()']]] +]; diff --git a/doc/libtrap-devel/search/variables_14.html b/doc/libtrap-devel/search/variables_14.html new file mode 100644 index 00000000..2c462043 --- /dev/null +++ b/doc/libtrap-devel/search/variables_14.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_14.js b/doc/libtrap-devel/search/variables_14.js new file mode 100644 index 00000000..84a7339b --- /dev/null +++ b/doc/libtrap-devel/search/variables_14.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['write_5fdata',['write_data',['../structtb__block__s.html#a027175035688ea5014bae0387a5e229b',1,'tb_block_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_2.html b/doc/libtrap-devel/search/variables_2.html new file mode 100644 index 00000000..15275b7a --- /dev/null +++ b/doc/libtrap-devel/search/variables_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_2.js b/doc/libtrap-devel/search/variables_2.js new file mode 100644 index 00000000..8c45c105 --- /dev/null +++ b/doc/libtrap-devel/search/variables_2.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['buffer',['buffer',['../structfile__private__s.html#a8ff9df8afeac5f74c30f019ae696b256',1,'file_private_s::buffer()'],['../structtrap__input__ifc__s.html#a87780edf8780e7716d55f54071a5fa76',1,'trap_input_ifc_s::buffer()']]], + ['buffer_5fcount',['buffer_count',['../structtcpip__sender__private__s.html#a29dd6625940588237aebf9f69ed1adc8',1,'tcpip_sender_private_s::buffer_count()'],['../structtls__sender__private__s.html#a5e1631f2bf5115bee0078dce29560b49',1,'tls_sender_private_s::buffer_count()']]], + ['buffer_5fpointer',['buffer_pointer',['../structtrap__input__ifc__s.html#a1161fe2715f7d7764780113652abf065',1,'trap_input_ifc_s']]], + ['buffer_5fsize',['buffer_size',['../structfile__private__s.html#a13716e3cdd9c15f593fcf2958829613c',1,'file_private_s::buffer_size()'],['../structtcpip__sender__private__s.html#a4df87fb84906232ded39166388dc682c',1,'tcpip_sender_private_s::buffer_size()'],['../structtls__sender__private__s.html#ab5718a15499529368bd5b35ced602367',1,'tls_sender_private_s::buffer_size()']]], + ['buffer_5funread_5fbytes',['buffer_unread_bytes',['../structtrap__input__ifc__s.html#a073bfa12bdb89c7093a03a1beb8ecfc2',1,'trap_input_ifc_s']]], + ['buffers',['buffers',['../structtcpip__sender__private__s.html#a4e8c10eab95a85dc2432062f23106d2e',1,'tcpip_sender_private_s::buffers()'],['../structtls__sender__private__s.html#acde38ffd6ba0f6e3c369f672a21e25e8',1,'tls_sender_private_s::buffers()']]], + ['bufferswitch',['bufferswitch',['../structtrap__output__ifc__s.html#a7ce082171e11f211070d8835a9b62db1',1,'trap_output_ifc_s']]], + ['bufferswitch_5ffixed',['bufferswitch_fixed',['../structtrap__output__ifc__s.html#a65eadcfdc7a5021dbbc985161fe9369b',1,'trap_output_ifc_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_3.html b/doc/libtrap-devel/search/variables_3.html new file mode 100644 index 00000000..fbc36712 --- /dev/null +++ b/doc/libtrap-devel/search/variables_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_3.js b/doc/libtrap-devel/search/variables_3.js new file mode 100644 index 00000000..1daf7150 --- /dev/null +++ b/doc/libtrap-devel/search/variables_3.js @@ -0,0 +1,26 @@ +var searchData= +[ + ['cafile',['cafile',['../structtls__sender__private__s.html#a0c9cd9cec3ca174563f41532172e90f4',1,'tls_sender_private_s::cafile()'],['../structtls__receiver__private__s.html#a39c7d6c5ea6416a2b5d072bcfb7c0f2e',1,'tls_receiver_private_s::cafile()']]], + ['certfile',['certfile',['../structtls__sender__private__s.html#a33339810bcd649fb009e7167c1346d58',1,'tls_sender_private_s::certfile()'],['../structtls__receiver__private__s.html#ab46c84a4ec6e7053a2bf54589b9eae39',1,'tls_receiver_private_s::certfile()']]], + ['client_5fstate',['client_state',['../structtrap__input__ifc__s.html#a2376f3c21323e16da224419553f5b0b1',1,'trap_input_ifc_s']]], + ['clients',['clients',['../structtcpip__sender__private__s.html#a412b6897ac143d737be4975c10a867d7',1,'tcpip_sender_private_s::clients()'],['../structtls__sender__private__s.html#a823f0044374b027154d88eea92347eb3',1,'tls_sender_private_s::clients()']]], + ['clients_5farr_5fsize',['clients_arr_size',['../structtcpip__sender__private__s.html#a02a377a621708255d892ada0c673cc3d',1,'tcpip_sender_private_s::clients_arr_size()'],['../structtls__sender__private__s.html#a00bed81250e7d1d9535282689cda77ec',1,'tls_sender_private_s::clients_arr_size()']]], + ['clients_5fbit_5farr',['clients_bit_arr',['../structbuffer__s.html#a0e0434b25109353c3306cbc5636c06e0',1,'buffer_s::clients_bit_arr()'],['../structtcpip__sender__private__s.html#a5abdcd36392cb8f8d064c0f0923bf80a',1,'tcpip_sender_private_s::clients_bit_arr()'],['../structtls__sender__private__s.html#a02d907d63b75a2b192089a8b317fa392',1,'tls_sender_private_s::clients_bit_arr()']]], + ['clients_5fpfds',['clients_pfds',['../structtcpip__sender__private__s.html#a8f36f7fc99dbeff1c3b12efb94dead82',1,'tcpip_sender_private_s']]], + ['com',['com',['../structmsg__header__s.html#ad82826f258d15be6d9f75ffdb4807218',1,'msg_header_s']]], + ['cond_5ffull_5fbuffer',['cond_full_buffer',['../structtcpip__sender__private__s.html#a3d50d013267786b222ddaedef253200f',1,'tcpip_sender_private_s::cond_full_buffer()'],['../structtls__sender__private__s.html#aa090c48986159a77c6cba2f47f242cc4',1,'tls_sender_private_s::cond_full_buffer()']]], + ['cond_5fno_5fdata',['cond_no_data',['../structtcpip__sender__private__s.html#ac6f604e6c4f8ecf8e440277b6e05efe8',1,'tcpip_sender_private_s::cond_no_data()'],['../structtls__sender__private__s.html#a4330546abe8d147885440cb91b89d9d5',1,'tls_sender_private_s::cond_no_data()']]], + ['connected',['connected',['../structtcpip__receiver__private__s.html#a981dafd77ae2442f3d21a4fd2e9758b9',1,'tcpip_receiver_private_s::connected()'],['../structtls__receiver__private__s.html#a54f6857f38498677fdfe125dfa0a3734',1,'tls_receiver_private_s::connected()']]], + ['connected_5fclients',['connected_clients',['../structtcpip__sender__private__s.html#a4810967e529ac208af0b5f7cb0677348',1,'tcpip_sender_private_s::connected_clients()'],['../structtls__sender__private__s.html#a9b3305cd83e88e536c09444a29161f84',1,'tls_sender_private_s::connected_clients()']]], + ['counter_5fautoflush',['counter_autoflush',['../group__ctxifccounters.html#gae918d788c4f2e3b77fc3e3c9d7eef7a3',1,'trap_ctx_priv_s']]], + ['counter_5fdropped_5fmessage',['counter_dropped_message',['../group__ctxifccounters.html#gab13490f32b1a27c2df99426d665ef9b7',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fbuffer',['counter_recv_buffer',['../group__ctxifccounters.html#gabf8d83b97e6807743758827a9627a7b9',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fdelay_5flast',['counter_recv_delay_last',['../group__ctxifccounters.html#ga5e34bd70f9d3373186a8bf6d5870733f',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fdelay_5ftotal',['counter_recv_delay_total',['../group__ctxifccounters.html#ga94165668161797455663b67406badc8c',1,'trap_ctx_priv_s']]], + ['counter_5frecv_5fmessage',['counter_recv_message',['../group__ctxifccounters.html#ga595bb998ac7a9257d8eb1bcb2b253311',1,'trap_ctx_priv_s']]], + ['counter_5fsend_5fbuffer',['counter_send_buffer',['../group__ctxifccounters.html#ga2567b4aa09c5832bd1bc7820bd6f60e7',1,'trap_ctx_priv_s']]], + ['counter_5fsend_5fmessage',['counter_send_message',['../group__ctxifccounters.html#ga6b244b237ff990977c8d2ecf7bd3c714',1,'trap_ctx_priv_s']]], + ['create_5fdump',['create_dump',['../structtrap__input__ifc__s.html#adf4d5b5be596232cb87f46aeb07df730',1,'trap_input_ifc_s::create_dump()'],['../structtrap__output__ifc__s.html#af2e7f89eb3c80aedc8fd08ac6d68f5bf',1,'trap_output_ifc_s::create_dump()']]], + ['create_5ftime',['create_time',['../structfile__private__s.html#a3a3694d34807552bdc40f4e1dfe9ba57',1,'file_private_s']]], + ['ctx',['ctx',['../structgenerator__private__s.html#a1a6188d5c588d98d1f5eb02e51cf58c2',1,'generator_private_s::ctx()'],['../structfile__private__s.html#ae5af1c6b080272c106d3e397a3190bb5',1,'file_private_s::ctx()'],['../structtcpip__sender__private__s.html#aa77c2248885aef1d8c3eb76dae5ffc9d',1,'tcpip_sender_private_s::ctx()'],['../structtcpip__receiver__private__s.html#ad37a1a719a07f93ac8110463c8d89894',1,'tcpip_receiver_private_s::ctx()'],['../structtls__sender__private__s.html#a0a536abae4016eeb276e63830a4a3117',1,'tls_sender_private_s::ctx()'],['../structtls__receiver__private__s.html#a2b90d739337a901fe0aa0956468037ee',1,'tls_receiver_private_s::ctx()']]] +]; diff --git a/doc/libtrap-devel/search/variables_4.html b/doc/libtrap-devel/search/variables_4.html new file mode 100644 index 00000000..8067e67f --- /dev/null +++ b/doc/libtrap-devel/search/variables_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_4.js b/doc/libtrap-devel/search/variables_4.js new file mode 100644 index 00000000..aa94da74 --- /dev/null +++ b/doc/libtrap-devel/search/variables_4.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['data',['data',['../structfile__buffer__s.html#a919ba393df19d1834772b610ca3f25fe',1,'file_buffer_s::data()'],['../structbuffer__s.html#ac522c6bea3709dcbfb638b5c49e70a6f',1,'buffer_s::data()'],['../structtrap__buffer__header__s.html#aae10443c28056e457903d575569b0d28',1,'trap_buffer_header_s::data()'],['../trap__internal_8h.html#ac3c027f9a365f5741871df5ace13943f',1,'data(): trap_internal.h']]], + ['data_5ffmt_5fspec',['data_fmt_spec',['../structtrap__input__ifc__s.html#a79c2aec80238bff3237d36d51f8a2243',1,'trap_input_ifc_s::data_fmt_spec()'],['../structtrap__output__ifc__s.html#a093102d7e5d3d6d4bd826e4a24263d11',1,'trap_output_ifc_s::data_fmt_spec()']]], + ['data_5ffmt_5fspec_5fsize',['data_fmt_spec_size',['../structhello__msg__header__s.html#ae37e4704fcec4bf662271a2d1a8b5620',1,'hello_msg_header_s']]], + ['data_5flength',['data_length',['../structtrap__buffer__header__s.html#aed3f6bcfd1e281004b06a20ba2fda99d',1,'trap_buffer_header_s::data_length()'],['../trap__internal_8h.html#af0cc3d1d5957cce931bb8e02130c6550',1,'data_length(): trap_internal.h']]], + ['data_5fpointer',['data_pointer',['../structtcpip__receiver__private__s.html#ae8cec0ad2ee75a4155cb96923e735e4d',1,'tcpip_receiver_private_s::data_pointer()'],['../structtls__receiver__private__s.html#aa1f10de57ccc5896e79d29c1c8d7865b',1,'tls_receiver_private_s::data_pointer()']]], + ['data_5fsize',['data_size',['../structgenerator__private__s.html#ac4d0225c08ddc2576ac4f615b6fd0d08',1,'generator_private_s::data_size()'],['../structmsg__header__s.html#a73a8038fa9802846f520cd6595acd659',1,'msg_header_s::data_size()']]], + ['data_5fto_5fsend',['data_to_send',['../structgenerator__private__s.html#a5267d7eae706c2f8f0bfbe0d24e6842a',1,'generator_private_s']]], + ['data_5ftype',['data_type',['../structtrap__input__ifc__s.html#af0736e926bbf4a185c5e31581c35be87',1,'trap_input_ifc_s::data_type()'],['../structtrap__output__ifc__s.html#af9c88c83b303ca2a3c1a2276215798d1',1,'trap_output_ifc_s::data_type()'],['../structhello__msg__header__s.html#af5c9eb543221381b46a917b4e4a77d0d',1,'hello_msg_header_s::data_type()']]], + ['data_5fwait_5fsize',['data_wait_size',['../structtcpip__receiver__private__s.html#aaf78da3865264b84f90d2aa6a799edd6',1,'tcpip_receiver_private_s::data_wait_size()'],['../structtls__receiver__private__s.html#a67fa5b6ad8f2119bb56d37f6a3ac9c3e',1,'tls_receiver_private_s::data_wait_size()']]], + ['datatimeout',['datatimeout',['../structtrap__input__ifc__s.html#a4c37dc3eb2f6cfb02bd3828fa3ea8fb4',1,'trap_input_ifc_s::datatimeout()'],['../structtrap__output__ifc__s.html#abb71b89e140f0ee7a6d9af206b6cfb67',1,'trap_output_ifc_s::datatimeout()']]], + ['datatimeout_5ffixed',['datatimeout_fixed',['../structtrap__input__ifc__s.html#a9050603d789b2ce45a6107f8b0f082f8',1,'trap_input_ifc_s::datatimeout_fixed()'],['../structtrap__output__ifc__s.html#a3f6cd83e1b2ec500efa23323f3dce5e1',1,'trap_output_ifc_s::datatimeout_fixed()']]], + ['default_5ferr_5fmsg',['default_err_msg',['../trap__error_8c.html#a1eb88024c15fe7f4533fe79a397bfbc4',1,'default_err_msg(): trap_error.c'],['../trap__error_8h.html#a1eb88024c15fe7f4533fe79a397bfbc4',1,'default_err_msg(): trap_error.c']]], + ['dest_5faddr',['dest_addr',['../structtcpip__receiver__private__s.html#a111fa5f95510969bfd4e925edf7237d4',1,'tcpip_receiver_private_s::dest_addr()'],['../structtls__receiver__private__s.html#a8f3cfa12b5fa34c4de91aac7f1c51c7c',1,'tls_receiver_private_s::dest_addr()']]], + ['dest_5fport',['dest_port',['../structtcpip__receiver__private__s.html#a7ea56509c6a257092d8368a4ad590742',1,'tcpip_receiver_private_s::dest_port()'],['../structtls__receiver__private__s.html#ac28adda0e00270bfb2d9807bf7dc9aeb',1,'tls_receiver_private_s::dest_port()']]], + ['destroy',['destroy',['../structtrap__input__ifc__s.html#aae8d7a18be825294c20f629153462116',1,'trap_input_ifc_s::destroy()'],['../structtrap__output__ifc__s.html#a979738421c4f54f28541d215e5a8d799',1,'trap_output_ifc_s::destroy()']]], + ['disconn_5fclients',['disconn_clients',['../structtrap__output__ifc__s.html#a8a0e19f2cf99eafe6de0b4b116946c34',1,'trap_output_ifc_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_5.html b/doc/libtrap-devel/search/variables_5.html new file mode 100644 index 00000000..7e95e946 --- /dev/null +++ b/doc/libtrap-devel/search/variables_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_5.js b/doc/libtrap-devel/search/variables_5.js new file mode 100644 index 00000000..fba99047 --- /dev/null +++ b/doc/libtrap-devel/search/variables_5.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['environ',['environ',['../trap_8c.html#aa006daaf11f1e2e45a6ababaf463212b',1,'trap.c']]], + ['error_5fmsg_5fbuffer',['error_msg_buffer',['../structtrap__ctx__priv__s.html#aeef7583ee81ee1466988bfb119cfe2f6',1,'trap_ctx_priv_s::error_msg_buffer()'],['../trap_8c.html#a49a03fbb455c0e359822206aca324a11',1,'error_msg_buffer(): trap.c']]], + ['error_5fmtx',['error_mtx',['../structtrap__ctx__priv__s.html#a1ac9f3b84a8531e68be50a39c21e0126',1,'trap_ctx_priv_s']]], + ['ext_5fbuffer',['ext_buffer',['../structtcpip__receiver__private__s.html#a8ad662859f70d5f9273786d5463f75a4',1,'tcpip_receiver_private_s::ext_buffer()'],['../structtls__receiver__private__s.html#a4bd1b8948058470972de12b89ef84c9f',1,'tls_receiver_private_s::ext_buffer()']]], + ['ext_5fbuffer_5fsize',['ext_buffer_size',['../structtcpip__receiver__private__s.html#a17e57dc2d73bc867e81b4dd04f5207fa',1,'tcpip_receiver_private_s::ext_buffer_size()'],['../structtls__receiver__private__s.html#a98725a8d0044d2f1e13a4df3a9c1cd3f',1,'tls_receiver_private_s::ext_buffer_size()']]] +]; diff --git a/doc/libtrap-devel/search/variables_6.html b/doc/libtrap-devel/search/variables_6.html new file mode 100644 index 00000000..3d398e62 --- /dev/null +++ b/doc/libtrap-devel/search/variables_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_6.js b/doc/libtrap-devel/search/variables_6.js new file mode 100644 index 00000000..6ee6166e --- /dev/null +++ b/doc/libtrap-devel/search/variables_6.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['fd',['fd',['../structfile__private__s.html#a0f49fbacaadcec3fc9c914c663f3bd77',1,'file_private_s']]], + ['file_5fchange_5fsize',['file_change_size',['../structfile__private__s.html#a25e4771159d10884bf7b2e1f5cfa253d',1,'file_private_s']]], + ['file_5fchange_5ftime',['file_change_time',['../structfile__private__s.html#ad6f5db2aa05e5f2b18538927013eeee1',1,'file_private_s']]], + ['file_5fcnt',['file_cnt',['../structfile__private__s.html#a0d4ae5dcc1efdc5f9f8c6f6c4bc184e1',1,'file_private_s']]], + ['file_5findex',['file_index',['../structfile__private__s.html#a9eacdca484084ad746ef7a3680406459',1,'file_private_s']]], + ['filename',['filename',['../structfile__private__s.html#acf8b68231ba794c9b46a6ff5975054de',1,'file_private_s']]], + ['filename_5ftmplt',['filename_tmplt',['../structfile__private__s.html#ad5a67bd241648aef4aaafb4797219657',1,'file_private_s']]], + ['files',['files',['../structfile__private__s.html#aea5dc7260d32d183302f3ba816031265',1,'file_private_s']]], + ['finished',['finished',['../structfile__buffer__s.html#a9ed90d5c89d45557b13432c3686fe728',1,'file_buffer_s']]], + ['flush',['flush',['../structtrap__output__ifc__s.html#a7f3576961e82e438956cf0c52ce99dac',1,'trap_output_ifc_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_7.html b/doc/libtrap-devel/search/variables_7.html new file mode 100644 index 00000000..7b791460 --- /dev/null +++ b/doc/libtrap-devel/search/variables_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_7.js b/doc/libtrap-devel/search/variables_7.js new file mode 100644 index 00000000..706903c7 --- /dev/null +++ b/doc/libtrap-devel/search/variables_7.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['get_5fclient_5fcount',['get_client_count',['../structtrap__output__ifc__s.html#aa135ef165a2e73933ab8eec7536fc82c',1,'trap_output_ifc_s']]], + ['get_5fclient_5fstats_5fjson',['get_client_stats_json',['../structtrap__output__ifc__s.html#a866ae11670b262a4f195a27ca7e7b597',1,'trap_output_ifc_s']]], + ['get_5fdata_5ftimeout',['get_data_timeout',['../structtrap__ctx__priv__s.html#a61f86431123ad98238d934e907b608a5',1,'trap_ctx_priv_s']]], + ['get_5fid',['get_id',['../structtrap__input__ifc__s.html#a5edf9feb69e975253a087433793a26e2',1,'trap_input_ifc_s::get_id()'],['../structtrap__output__ifc__s.html#a28066d0bcee909ef82a308acd89c903c',1,'trap_output_ifc_s::get_id()']]] +]; diff --git a/doc/libtrap-devel/search/variables_8.html b/doc/libtrap-devel/search/variables_8.html new file mode 100644 index 00000000..8ebc5f6b --- /dev/null +++ b/doc/libtrap-devel/search/variables_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_8.js b/doc/libtrap-devel/search/variables_8.js new file mode 100644 index 00000000..8596941d --- /dev/null +++ b/doc/libtrap-devel/search/variables_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['header',['header',['../structfile__buffer__s.html#a6d82f8e1c69ec54aa27491f1b7e1c3b6',1,'file_buffer_s::header()'],['../structbuffer__s.html#aa2ad479ae2dabc1066c956ad3cc6f6c6',1,'buffer_s::header()']]] +]; diff --git a/doc/libtrap-devel/search/variables_9.html b/doc/libtrap-devel/search/variables_9.html new file mode 100644 index 00000000..12136613 --- /dev/null +++ b/doc/libtrap-devel/search/variables_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_9.js b/doc/libtrap-devel/search/variables_9.js new file mode 100644 index 00000000..d25d17c5 --- /dev/null +++ b/doc/libtrap-devel/search/variables_9.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['id',['id',['../structclient__s.html#a4294300096ccb1946f3444e61631a14a',1,'client_s::id()'],['../structtlsclient__s.html#a53113575cc2a2cd0692753e88672ae73',1,'tlsclient_s::id()']]], + ['idx',['idx',['../structautoflush__timeouts.html#abdd42145684f843c79e427f8d4bfb703',1,'autoflush_timeouts']]], + ['ifc_5fautoflush_5ftimeout',['ifc_autoflush_timeout',['../structtrap__ctx__priv__s.html#a69d5cc5cb537abe973335b0ddc7c0815',1,'trap_ctx_priv_s']]], + ['ifc_5fchange',['ifc_change',['../structtrap__ctx__priv__s.html#a63bd99bb735df5ac63113537fb03f765',1,'trap_ctx_priv_s']]], + ['ifc_5fidx',['ifc_idx',['../structfile__private__s.html#a8fde42ac826019a1de2caa53208d2773',1,'file_private_s::ifc_idx()'],['../structtcpip__sender__private__s.html#a80c87058c06716405b0fb99e8089afd1',1,'tcpip_sender_private_s::ifc_idx()'],['../structtcpip__receiver__private__s.html#aa6557670605b124f2a41f9474d94b5f7',1,'tcpip_receiver_private_s::ifc_idx()'],['../structtls__sender__private__s.html#a46059128ac5b82f796aa795dea690522',1,'tls_sender_private_s::ifc_idx()'],['../structtls__receiver__private__s.html#a5c428f93f37710a4981478dea2cad534',1,'tls_receiver_private_s::ifc_idx()']]], + ['ifc_5fmtx',['ifc_mtx',['../structtrap__input__ifc__s.html#a4058587a4584a7fc650bbfb4a6a73bee',1,'trap_input_ifc_s::ifc_mtx()'],['../structtrap__output__ifc__s.html#a1ccb40690e646da10a123308491d7899',1,'trap_output_ifc_s::ifc_mtx()']]], + ['ifc_5ftype',['ifc_type',['../structtrap__input__ifc__s.html#ae3e4a235d9034c9f998676c286f745b3',1,'trap_input_ifc_s::ifc_type()'],['../structtrap__output__ifc__s.html#ad11a1060b35406f5e0453c7ab3078b83',1,'trap_output_ifc_s::ifc_type()']]], + ['in_5fifc_5flist',['in_ifc_list',['../structtrap__ctx__priv__s.html#a0c1dbb818a0ca11597f28c494a30cd5f',1,'trap_ctx_priv_s']]], + ['initialized',['initialized',['../structtcpip__sender__private__s.html#a0229b95daa25e85efe6f04b55bc3a150',1,'tcpip_sender_private_s::initialized()'],['../structtls__sender__private__s.html#a67d8252f20ffd1d3eaf2fbec4af892fc',1,'tls_sender_private_s::initialized()'],['../structtrap__ctx__priv__s.html#a91a63a3c23a2bd6e97ea4b1bbe69219b',1,'trap_ctx_priv_s::initialized()']]], + ['int_5fmess_5fheader',['int_mess_header',['../structtcpip__receiver__private__s.html#a962be8fe5802e31ee65f689c5e2a8975',1,'tcpip_receiver_private_s::int_mess_header()'],['../structtls__receiver__private__s.html#acd1281b3fe949fef8382b490589c3d6d',1,'tls_receiver_private_s::int_mess_header()']]], + ['is_5fconn',['is_conn',['../structtrap__input__ifc__s.html#aa6657d505447e117948bc0fca7f8ba79',1,'trap_input_ifc_s']]], + ['is_5fterminated',['is_terminated',['../structgenerator__private__s.html#a892f8f16a299820033abbb9ef5c915de',1,'generator_private_s::is_terminated()'],['../structfile__private__s.html#aff4a8fb12ae452ebcc50581860764b32',1,'file_private_s::is_terminated()'],['../structtcpip__sender__private__s.html#a20a41fc7667d03bdc8134a5c5bee2229',1,'tcpip_sender_private_s::is_terminated()'],['../structtcpip__receiver__private__s.html#a7997188b334e7c35b9ea25bf81cc5eaa',1,'tcpip_receiver_private_s::is_terminated()'],['../structtls__sender__private__s.html#a851c24506384508921b7410c0686dee0',1,'tls_sender_private_s::is_terminated()'],['../structtls__receiver__private__s.html#ab20da0d5adeaff59a7a98702e4af8e3b',1,'tls_receiver_private_s::is_terminated()']]] +]; diff --git a/doc/libtrap-devel/search/variables_a.html b/doc/libtrap-devel/search/variables_a.html new file mode 100644 index 00000000..24819a37 --- /dev/null +++ b/doc/libtrap-devel/search/variables_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_a.js b/doc/libtrap-devel/search/variables_a.js new file mode 100644 index 00000000..920634f0 --- /dev/null +++ b/doc/libtrap-devel/search/variables_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['keyfile',['keyfile',['../structtls__sender__private__s.html#a1b1f1272d5e989a6b95b5a26741699f3',1,'tls_sender_private_s::keyfile()'],['../structtls__receiver__private__s.html#a79b489b10fa36669da8c40cafc7f781d',1,'tls_receiver_private_s::keyfile()']]] +]; diff --git a/doc/libtrap-devel/search/variables_b.html b/doc/libtrap-devel/search/variables_b.html new file mode 100644 index 00000000..b306931e --- /dev/null +++ b/doc/libtrap-devel/search/variables_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_b.js b/doc/libtrap-devel/search/variables_b.js new file mode 100644 index 00000000..ee507f3c --- /dev/null +++ b/doc/libtrap-devel/search/variables_b.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['mask',['mask',['../ifc__socket__common_8h.html#a07f30ec0a21b8214e936114f6438fd6e',1,'ifc_socket_common.h']]], + ['mode',['mode',['../structfile__private__s.html#ab92bb308a82414c03133b8aba613eea3',1,'file_private_s']]], + ['mtx_5fno_5fdata',['mtx_no_data',['../structtcpip__sender__private__s.html#a5c0a335e7cde72ecd34a5e8ba15b47a3',1,'tcpip_sender_private_s::mtx_no_data()'],['../structtls__sender__private__s.html#a817dd02237d0bf183682acfa96f25c96',1,'tls_sender_private_s::mtx_no_data()']]] +]; diff --git a/doc/libtrap-devel/search/variables_c.html b/doc/libtrap-devel/search/variables_c.html new file mode 100644 index 00000000..75709df8 --- /dev/null +++ b/doc/libtrap-devel/search/variables_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_c.js b/doc/libtrap-devel/search/variables_c.js new file mode 100644 index 00000000..0044226e --- /dev/null +++ b/doc/libtrap-devel/search/variables_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['neg_5finitialized',['neg_initialized',['../structfile__private__s.html#a6a49aa9f86e4da7c239d89f3a180ef8b',1,'file_private_s']]], + ['num_5fifc_5fin',['num_ifc_in',['../structtrap__ctx__priv__s.html#a2e4d1aa8eb64743dda03cee9430197d1',1,'trap_ctx_priv_s']]], + ['num_5fifc_5fout',['num_ifc_out',['../structtrap__ctx__priv__s.html#a1f71f0c46759591ff11107870d66111b',1,'trap_ctx_priv_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_d.html b/doc/libtrap-devel/search/variables_d.html new file mode 100644 index 00000000..34c80a48 --- /dev/null +++ b/doc/libtrap-devel/search/variables_d.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_d.js b/doc/libtrap-devel/search/variables_d.js new file mode 100644 index 00000000..23b51a9d --- /dev/null +++ b/doc/libtrap-devel/search/variables_d.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['out_5fifc_5flist',['out_ifc_list',['../structtrap__ctx__priv__s.html#a7dc607a5c8f21a2ecc8501c3356ed14a',1,'trap_ctx_priv_s']]] +]; diff --git a/doc/libtrap-devel/search/variables_e.html b/doc/libtrap-devel/search/variables_e.html new file mode 100644 index 00000000..4a1c8a61 --- /dev/null +++ b/doc/libtrap-devel/search/variables_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_e.js b/doc/libtrap-devel/search/variables_e.js new file mode 100644 index 00000000..809ad16a --- /dev/null +++ b/doc/libtrap-devel/search/variables_e.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['params',['params',['../structtrap__ifc__spec__s.html#a67f46fe3c5ea43d1c8894ce9b8f551ab',1,'trap_ifc_spec_s']]], + ['pending_5fbytes',['pending_bytes',['../structclient__s.html#a70807d3454b3edc69da68944c5361f82',1,'client_s::pending_bytes()'],['../structtlsclient__s.html#af78d35cba81bd53d5acf1ad6c5a25396',1,'tlsclient_s::pending_bytes()']]], + ['pfds_5findex',['pfds_index',['../structclient__s.html#a87c4e6f9fd9d595ae725de498a70d3fc',1,'client_s']]], + ['priv',['priv',['../structtrap__input__ifc__s.html#a6fe747dbf5b4371b1d03072a4314d7b7',1,'trap_input_ifc_s::priv()'],['../structtrap__output__ifc__s.html#a144ca021f2c9ff608d539c49679fe0c5',1,'trap_output_ifc_s::priv()']]] +]; diff --git a/doc/libtrap-devel/search/variables_f.html b/doc/libtrap-devel/search/variables_f.html new file mode 100644 index 00000000..cc86fb59 --- /dev/null +++ b/doc/libtrap-devel/search/variables_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/libtrap-devel/search/variables_f.js b/doc/libtrap-devel/search/variables_f.js new file mode 100644 index 00000000..07867dfe --- /dev/null +++ b/doc/libtrap-devel/search/variables_f.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['recv',['recv',['../structtrap__input__ifc__s.html#a8db5f9ec43dbfae33f00ab64193ed47e',1,'trap_input_ifc_s']]], + ['recv_5fdelay_5ftimestamp',['recv_delay_timestamp',['../group__ctxifccounters.html#gaef1f0d9cee8a5c519c741aa5d3c8f79a',1,'trap_ctx_priv_s']]], + ['req_5fdata_5ffmt_5fspec',['req_data_fmt_spec',['../structtrap__input__ifc__s.html#a66bf6d0e2e0f2d9912e3979359e17c14',1,'trap_input_ifc_s']]], + ['req_5fdata_5ftype',['req_data_type',['../structtrap__input__ifc__s.html#a9c7711e7a191fd43ca23e39a0d274bdc',1,'trap_input_ifc_s']]] +]; diff --git a/doc/libtrap-devel/splitbar.png b/doc/libtrap-devel/splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/doc/libtrap-devel/splitbar.png differ diff --git a/doc/libtrap-devel/structautoflush__timeouts.html b/doc/libtrap-devel/structautoflush__timeouts.html new file mode 100644 index 00000000..6255ead8 --- /dev/null +++ b/doc/libtrap-devel/structautoflush__timeouts.html @@ -0,0 +1,153 @@ + + + + + + + +Libtrap: Internal development docs: autoflush_timeouts Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
autoflush_timeouts Struct Reference
+
+
+ +

List of autoflush timeouts of output interfaces. + More...

+ +

#include <trap_internal.h>

+ + + + + + + + +

+Data Fields

int idx
 
int64_t tm
 
int64_t tm_backup
 
+

Detailed Description

+

List of autoflush timeouts of output interfaces.

+ +

Definition at line 208 of file trap_internal.h.

+

Field Documentation

+ +

◆ idx

+ +
+
+ + + + +
int autoflush_timeouts::idx
+
+

Index of output interface.

+ +

Definition at line 209 of file trap_internal.h.

+ +
+
+ +

◆ tm

+ +
+
+ + + + +
int64_t autoflush_timeouts::tm
+
+

Autoflush timeout to be elapsed.

+ +

Definition at line 210 of file trap_internal.h.

+ +
+
+ +

◆ tm_backup

+ +
+
+ + + + +
int64_t autoflush_timeouts::tm_backup
+
+

Backup value of the autoflush timeout.

+ +

Definition at line 211 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structbuffer__s.html b/doc/libtrap-devel/structbuffer__s.html new file mode 100644 index 00000000..022ed13f --- /dev/null +++ b/doc/libtrap-devel/structbuffer__s.html @@ -0,0 +1,172 @@ + + + + + + + +Libtrap: Internal development docs: buffer_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
buffer_s Struct Reference
+
+
+ +

Output buffer structure. + More...

+ +

#include <ifc_socket_common.h>

+ + + + + + + + + + +

+Data Fields

uint32_t wr_index
 
uint64_t clients_bit_arr
 
uint8_t * header
 
uint8_t * data
 
+

Detailed Description

+

Output buffer structure.

+ +

Definition at line 70 of file ifc_socket_common.h.

+

Field Documentation

+ +

◆ clients_bit_arr

+ +
+
+ + + + +
uint64_t buffer_s::clients_bit_arr
+
+

Bit array of clients that have not yet received the buffer

+ +

Definition at line 72 of file ifc_socket_common.h.

+ +
+
+ +

◆ data

+ +
+
+ + + + +
uint8_t* buffer_s::data
+
+

Pointer to first byte of buffer payload

+ +

Definition at line 75 of file ifc_socket_common.h.

+ +
+
+ +

◆ header

+ +
+
+ + + + +
uint8_t* buffer_s::header
+
+

Pointer to first byte in buffer

+ +

Definition at line 74 of file ifc_socket_common.h.

+ +
+
+ +

◆ wr_index

+ +
+
+ + + + +
uint32_t buffer_s::wr_index
+
+

Pointer to first free byte in buffer

+ +

Definition at line 71 of file ifc_socket_common.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structclient__s.html b/doc/libtrap-devel/structclient__s.html new file mode 100644 index 00000000..97a025cc --- /dev/null +++ b/doc/libtrap-devel/structclient__s.html @@ -0,0 +1,267 @@ + + + + + + + +Libtrap: Internal development docs: client_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

Structure for TCP/IP IFC client information. + More...

+ +

#include <ifc_tcpip_internal.h>

+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

int sd
 
int pfds_index
 
void * sending_pointer
 
uint64_t timer_total
 
uint64_t timeouts
 
uint32_t timer_last
 
uint32_t pending_bytes
 
uint32_t id
 
uint32_t assigned_buffer
 
+

Detailed Description

+

Structure for TCP/IP IFC client information.

+ +

Definition at line 62 of file ifc_tcpip_internal.h.

+

Field Documentation

+ +

◆ assigned_buffer

+ +
+
+ + + + +
uint32_t client_s::assigned_buffer
+
+

Index of assigned buffer in array of buffers

+ +

Definition at line 73 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ id

+ +
+
+ + + + +
uint32_t client_s::id
+
+

Client identification - PID for unix socket, port number for TCP socket

+ +

Definition at line 72 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ pending_bytes

+ +
+
+ + + + +
uint32_t client_s::pending_bytes
+
+

The size of data that must be sent

+ +

Definition at line 71 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ pfds_index

+ +
+
+ + + + +
int client_s::pfds_index
+
+

Client pfds struct array index.

+ +

Definition at line 64 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ sd

+ +
+
+ + + + +
int client_s::sd
+
+

Client socket descriptor

+ +

Definition at line 63 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ sending_pointer

+ +
+
+ + + + +
void* client_s::sending_pointer
+
+

Pointer to data in client's assigned buffer

+ +

Definition at line 65 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ timeouts

+ +
+
+ + + + +
uint64_t client_s::timeouts
+
+

Number of messages dropped (since connection) due to client blocking active buffer

+ +

Definition at line 68 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ timer_last

+ +
+
+ + + + +
uint32_t client_s::timer_last
+
+

Time spent on last send call [microseconds]

+ +

Definition at line 70 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ timer_total

+ +
+
+ + + + +
uint64_t client_s::timer_total
+
+

Total time spent sending (microseconds) since client connection

+ +

Definition at line 67 of file ifc_tcpip_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structfile__buffer__s.html b/doc/libtrap-devel/structfile__buffer__s.html new file mode 100644 index 00000000..8c13473f --- /dev/null +++ b/doc/libtrap-devel/structfile__buffer__s.html @@ -0,0 +1,168 @@ + + + + + + + +Libtrap: Internal development docs: file_buffer_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
file_buffer_s Struct Reference
+
+
+ +

#include <ifc_file.h>

+ + + + + + + + + + +

+Data Fields

uint32_t wr_index
 
uint8_t * header
 
uint8_t * data
 
uint8_t finished
 
+

Detailed Description

+
+

Definition at line 58 of file ifc_file.h.

+

Field Documentation

+ +

◆ data

+ +
+
+ + + + +
uint8_t* file_buffer_s::data
+
+

Pointer to first byte of buffer payload

+ +

Definition at line 61 of file ifc_file.h.

+ +
+
+ +

◆ finished

+ +
+
+ + + + +
uint8_t file_buffer_s::finished
+
+

Flag indicating whether buffer is full and ready to be sent

+ +

Definition at line 62 of file ifc_file.h.

+ +
+
+ +

◆ header

+ +
+
+ + + + +
uint8_t* file_buffer_s::header
+
+

Pointer to first byte in buffer

+ +

Definition at line 60 of file ifc_file.h.

+ +
+
+ +

◆ wr_index

+ +
+
+ + + + +
uint32_t file_buffer_s::wr_index
+
+

Pointer to first free byte in buffer payload

+ +

Definition at line 59 of file ifc_file.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structfile__private__s.html b/doc/libtrap-devel/structfile__private__s.html new file mode 100644 index 00000000..97bd98ad --- /dev/null +++ b/doc/libtrap-devel/structfile__private__s.html @@ -0,0 +1,394 @@ + + + + + + + +Libtrap: Internal development docs: file_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
file_private_s Struct Reference
+
+
+ +

#include <ifc_file.h>

+
+Collaboration diagram for file_private_s:
+
+
Collaboration graph
+ + + + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
FILE * fd
 
time_t create_time
 
char ** files
 
char filename_tmplt [FILENAME_TEMPLATE_LEN]
 
char filename [PATH_MAX]
 
char mode [3]
 
char is_terminated
 
uint8_t neg_initialized
 
uint16_t file_index
 
uint16_t file_cnt
 
uint32_t file_change_size
 
uint32_t file_change_time
 
uint32_t buffer_size
 
uint32_t ifc_idx
 
file_buffer_t buffer
 
+

Detailed Description

+
+

Definition at line 65 of file ifc_file.h.

+

Field Documentation

+ +

◆ buffer

+ +
+
+ + + + +
file_buffer_t file_private_s::buffer
+
+ +

Definition at line 82 of file ifc_file.h.

+ +
+
+ +

◆ buffer_size

+ +
+
+ + + + +
uint32_t file_private_s::buffer_size
+
+

Buffer size [bytes]

+ +

Definition at line 79 of file ifc_file.h.

+ +
+
+ +

◆ create_time

+ +
+
+ + + + +
time_t file_private_s::create_time
+
+ +

Definition at line 68 of file ifc_file.h.

+ +
+
+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* file_private_s::ctx
+
+ +

Definition at line 66 of file ifc_file.h.

+ +
+
+ +

◆ fd

+ +
+
+ + + + +
FILE* file_private_s::fd
+
+ +

Definition at line 67 of file ifc_file.h.

+ +
+
+ +

◆ file_change_size

+ +
+
+ + + + +
uint32_t file_private_s::file_change_size
+
+ +

Definition at line 77 of file ifc_file.h.

+ +
+
+ +

◆ file_change_time

+ +
+
+ + + + +
uint32_t file_private_s::file_change_time
+
+ +

Definition at line 78 of file ifc_file.h.

+ +
+
+ +

◆ file_cnt

+ +
+
+ + + + +
uint16_t file_private_s::file_cnt
+
+ +

Definition at line 76 of file ifc_file.h.

+ +
+
+ +

◆ file_index

+ +
+
+ + + + +
uint16_t file_private_s::file_index
+
+ +

Definition at line 75 of file ifc_file.h.

+ +
+
+ +

◆ filename

+ +
+
+ + + + +
char file_private_s::filename[PATH_MAX]
+
+ +

Definition at line 71 of file ifc_file.h.

+ +
+
+ +

◆ filename_tmplt

+ +
+
+ + + + +
char file_private_s::filename_tmplt[FILENAME_TEMPLATE_LEN]
+
+ +

Definition at line 70 of file ifc_file.h.

+ +
+
+ +

◆ files

+ +
+
+ + + + +
char** file_private_s::files
+
+ +

Definition at line 69 of file ifc_file.h.

+ +
+
+ +

◆ ifc_idx

+ +
+
+ + + + +
uint32_t file_private_s::ifc_idx
+
+

Index of interface in 'ctx->out_ifc_list' array

+ +

Definition at line 80 of file ifc_file.h.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char file_private_s::is_terminated
+
+ +

Definition at line 73 of file ifc_file.h.

+ +
+
+ +

◆ mode

+ +
+
+ + + + +
char file_private_s::mode[3]
+
+ +

Definition at line 72 of file ifc_file.h.

+ +
+
+ +

◆ neg_initialized

+ +
+
+ + + + +
uint8_t file_private_s::neg_initialized
+
+ +

Definition at line 74 of file ifc_file.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structfile__private__s__coll__graph.map b/doc/libtrap-devel/structfile__private__s__coll__graph.map new file mode 100644 index 00000000..93902467 --- /dev/null +++ b/doc/libtrap-devel/structfile__private__s__coll__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap-devel/structfile__private__s__coll__graph.md5 b/doc/libtrap-devel/structfile__private__s__coll__graph.md5 new file mode 100644 index 00000000..407da596 --- /dev/null +++ b/doc/libtrap-devel/structfile__private__s__coll__graph.md5 @@ -0,0 +1 @@ +961bf4aa0cf801298ccacf50ecc58ae2 \ No newline at end of file diff --git a/doc/libtrap-devel/structfile__private__s__coll__graph.png b/doc/libtrap-devel/structfile__private__s__coll__graph.png new file mode 100644 index 00000000..1c9aeeac Binary files /dev/null and b/doc/libtrap-devel/structfile__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structgenerator__private__s.html b/doc/libtrap-devel/structgenerator__private__s.html new file mode 100644 index 00000000..2dddda36 --- /dev/null +++ b/doc/libtrap-devel/structgenerator__private__s.html @@ -0,0 +1,173 @@ + + + + + + + +Libtrap: Internal development docs: generator_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
generator_private_s Struct Reference
+
+
+
+Collaboration diagram for generator_private_s:
+
+
Collaboration graph
+ + + + + + +
[legend]
+ + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
char * data_to_send
 
int data_size
 
char is_terminated
 
+

Detailed Description

+
+

Definition at line 56 of file ifc_dummy.c.

+

Field Documentation

+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* generator_private_s::ctx
+
+ +

Definition at line 57 of file ifc_dummy.c.

+ +
+
+ +

◆ data_size

+ +
+
+ + + + +
int generator_private_s::data_size
+
+ +

Definition at line 59 of file ifc_dummy.c.

+ +
+
+ +

◆ data_to_send

+ +
+
+ + + + +
char* generator_private_s::data_to_send
+
+ +

Definition at line 58 of file ifc_dummy.c.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char generator_private_s::is_terminated
+
+ +

Definition at line 60 of file ifc_dummy.c.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structgenerator__private__s__coll__graph.map b/doc/libtrap-devel/structgenerator__private__s__coll__graph.map new file mode 100644 index 00000000..24ccaa22 --- /dev/null +++ b/doc/libtrap-devel/structgenerator__private__s__coll__graph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/libtrap-devel/structgenerator__private__s__coll__graph.md5 b/doc/libtrap-devel/structgenerator__private__s__coll__graph.md5 new file mode 100644 index 00000000..b93d509c --- /dev/null +++ b/doc/libtrap-devel/structgenerator__private__s__coll__graph.md5 @@ -0,0 +1 @@ +a4dcd77d2b6ebb76594db89fabad3674 \ No newline at end of file diff --git a/doc/libtrap-devel/structgenerator__private__s__coll__graph.png b/doc/libtrap-devel/structgenerator__private__s__coll__graph.png new file mode 100644 index 00000000..a81697a2 Binary files /dev/null and b/doc/libtrap-devel/structgenerator__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structhello__msg__header__s.html b/doc/libtrap-devel/structhello__msg__header__s.html new file mode 100644 index 00000000..857010da --- /dev/null +++ b/doc/libtrap-devel/structhello__msg__header__s.html @@ -0,0 +1,129 @@ + + + + + + + +Libtrap: Internal development docs: hello_msg_header_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
hello_msg_header_s Struct Reference
+
+
+ +

#include <trap_internal.h>

+ + + + + + +

+Data Fields

uint8_t data_type
 
uint32_t data_fmt_spec_size
 
+

Detailed Description

+

Hello message header structure (used during the output and input interface negotiation). Contains data format and data specifier size of the output interface which is making the negotiation.

+ +

Definition at line 107 of file trap_internal.h.

+

Field Documentation

+ +

◆ data_fmt_spec_size

+ +
+
+ + + + +
uint32_t hello_msg_header_s::data_fmt_spec_size
+
+ +

Definition at line 109 of file trap_internal.h.

+ +
+
+ +

◆ data_type

+ +
+
+ + + + +
uint8_t hello_msg_header_s::data_type
+
+ +

Definition at line 108 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structmsg__header__s.html b/doc/libtrap-devel/structmsg__header__s.html new file mode 100644 index 00000000..b3461056 --- /dev/null +++ b/doc/libtrap-devel/structmsg__header__s.html @@ -0,0 +1,126 @@ + + + + + + + +Libtrap: Internal development docs: msg_header_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
msg_header_s Struct Reference
+
+
+ + + + + + +

+Data Fields

uint8_t com
 
uint32_t data_size
 
+

Detailed Description

+
+

Definition at line 2136 of file trap.c.

+

Field Documentation

+ +

◆ com

+ +
+
+ + + + +
uint8_t msg_header_s::com
+
+ +

Definition at line 2137 of file trap.c.

+ +
+
+ +

◆ data_size

+ +
+
+ + + + +
uint32_t msg_header_s::data_size
+
+ +

Definition at line 2138 of file trap.c.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structout__ifc__timeout__s.html b/doc/libtrap-devel/structout__ifc__timeout__s.html new file mode 100644 index 00000000..6f4a929e --- /dev/null +++ b/doc/libtrap-devel/structout__ifc__timeout__s.html @@ -0,0 +1,132 @@ + + + + + + + +Libtrap: Internal development docs: out_ifc_timeout_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
out_ifc_timeout_s Struct Reference
+
+
+ +

#include <trap_internal.h>

+ + + + + + +

+Data Fields

int idx
 
int64_t tm
 
+

Detailed Description

+

List of all output interfaces and their timeouts.

+

It is used by automatic flush buffer thread to send buffer after a timeout on one of the output interfaces has elapsed.

+ +

Definition at line 213 of file trap_internal.h.

+

Field Documentation

+ +

◆ idx

+ +
+
+ + + + +
int out_ifc_timeout_s::idx
+
+

index of output interface

+ +

Definition at line 214 of file trap_internal.h.

+ +
+
+ +

◆ tm

+ +
+
+ + + + +
int64_t out_ifc_timeout_s::tm
+
+

timeout to be elapsed

+ +

Definition at line 215 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structreader__threads__arg.html b/doc/libtrap-devel/structreader__threads__arg.html new file mode 100644 index 00000000..0236e59f --- /dev/null +++ b/doc/libtrap-devel/structreader__threads__arg.html @@ -0,0 +1,139 @@ + + + + + + + +Libtrap: Internal development docs: reader_threads_arg Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
reader_threads_arg Struct Reference
+
+
+
+Collaboration diagram for reader_threads_arg:
+
+
Collaboration graph
+ + + + + + + + +
[legend]
+ + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
int thread_index
 
+

Detailed Description

+
+

Definition at line 478 of file trap.c.

+

Field Documentation

+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* reader_threads_arg::ctx
+
+ +

Definition at line 479 of file trap.c.

+ +
+
+ +

◆ thread_index

+ +
+
+ + + + +
int reader_threads_arg::thread_index
+
+ +

Definition at line 480 of file trap.c.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structreader__threads__arg__coll__graph.map b/doc/libtrap-devel/structreader__threads__arg__coll__graph.map new file mode 100644 index 00000000..3e619d2b --- /dev/null +++ b/doc/libtrap-devel/structreader__threads__arg__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/libtrap-devel/structreader__threads__arg__coll__graph.md5 b/doc/libtrap-devel/structreader__threads__arg__coll__graph.md5 new file mode 100644 index 00000000..ed113835 --- /dev/null +++ b/doc/libtrap-devel/structreader__threads__arg__coll__graph.md5 @@ -0,0 +1 @@ +200953ad08fc587dc421fe4c5b8e4620 \ No newline at end of file diff --git a/doc/libtrap-devel/structreader__threads__arg__coll__graph.png b/doc/libtrap-devel/structreader__threads__arg__coll__graph.png new file mode 100644 index 00000000..306fac74 Binary files /dev/null and b/doc/libtrap-devel/structreader__threads__arg__coll__graph.png differ diff --git a/doc/libtrap-devel/structreader__threads__s.html b/doc/libtrap-devel/structreader__threads__s.html new file mode 100644 index 00000000..51fbe0b3 --- /dev/null +++ b/doc/libtrap-devel/structreader__threads__s.html @@ -0,0 +1,132 @@ + + + + + + + +Libtrap: Internal development docs: reader_threads_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
reader_threads_s Struct Reference
+
+
+ +

#include <trap_internal.h>

+ + + + + + +

+Data Fields

pthread_t thr
 
sem_t sem
 
+

Detailed Description

+

List of threads and their semaphores.

+

It is used for multi-result reading when _get_data() is called with ifc_mask including more than one ifc.

+ +

Definition at line 200 of file trap_internal.h.

+

Field Documentation

+ +

◆ sem

+ +
+
+ + + + +
sem_t reader_threads_s::sem
+
+

semaphore used when thread is ought to sleep

+ +

Definition at line 202 of file trap_internal.h.

+ +
+
+ +

◆ thr

+ +
+
+ + + + +
pthread_t reader_threads_s::thr
+
+

thread of reader

+ +

Definition at line 201 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtb__block__data__s.html b/doc/libtrap-devel/structtb__block__data__s.html new file mode 100644 index 00000000..9e6e756c --- /dev/null +++ b/doc/libtrap-devel/structtb__block__data__s.html @@ -0,0 +1,131 @@ + + + + + + + +Libtrap: Internal development docs: tb_block_data_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
tb_block_data_s Struct Reference
+
+
+ +

#include <trap_buffer.h>

+ + + + + + +

+Data Fields

uint32_t size
 
char data [0]
 
+

Detailed Description

+
+

Definition at line 60 of file trap_buffer.h.

+

Field Documentation

+ +

◆ data

+ +
+
+ + + + +
char tb_block_data_s::data[0]
+
+

Pointer to the beginning of data stored in this block

+ +

Definition at line 70 of file trap_buffer.h.

+ +
+
+ +

◆ size

+ +
+
+ + + + +
uint32_t tb_block_data_s::size
+
+

Size of stored data, it must be always <= (blocksize - sizeof(size)).

+

If the size is 0, the block is free.

+ +

Definition at line 66 of file trap_buffer.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtb__block__s.html b/doc/libtrap-devel/structtb__block__s.html new file mode 100644 index 00000000..ba1e966d --- /dev/null +++ b/doc/libtrap-devel/structtb__block__s.html @@ -0,0 +1,195 @@ + + + + + + + +Libtrap: Internal development docs: tb_block_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
tb_block_s Struct Reference
+
+
+ +

#include <trap_buffer.h>

+
+Collaboration diagram for tb_block_s:
+
+
Collaboration graph
+ + + +
[legend]
+ + + + + + + + + + + + +

+Data Fields

char * write_data
 
char * read_data
 
uint16_t refcount
 
pthread_mutex_t lock
 
struct tb_block_data_s data [0]
 
+

Detailed Description

+
+

Definition at line 73 of file trap_buffer.h.

+

Field Documentation

+ +

◆ data

+ +
+
+ + + + +
struct tb_block_data_s tb_block_s::data[0]
+
+

Pointer to data in the block (to the header of the first message)

+ +

Definition at line 97 of file trap_buffer.h.

+ +
+
+ +

◆ lock

+ +
+
+ + + + +
pthread_mutex_t tb_block_s::lock
+
+

Lock the block

+ +

Definition at line 92 of file trap_buffer.h.

+ +
+
+ +

◆ read_data

+ +
+
+ + + + +
char* tb_block_s::read_data
+
+

Pointer to the space for adding new data (to the header of message)

+ +

Definition at line 82 of file trap_buffer.h.

+ +
+
+ +

◆ refcount

+ +
+
+ + + + +
uint16_t tb_block_s::refcount
+
+

Reference counter with non-zero value means that the block is used and cannot be freed.

+ +

Definition at line 87 of file trap_buffer.h.

+ +
+
+ +

◆ write_data

+ +
+
+ + + + +
char* tb_block_s::write_data
+
+

Pointer to the space for adding new data (to the header of message)

+ +

Definition at line 77 of file trap_buffer.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtb__block__s__coll__graph.map b/doc/libtrap-devel/structtb__block__s__coll__graph.map new file mode 100644 index 00000000..72c02a93 --- /dev/null +++ b/doc/libtrap-devel/structtb__block__s__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/structtb__block__s__coll__graph.md5 b/doc/libtrap-devel/structtb__block__s__coll__graph.md5 new file mode 100644 index 00000000..5c79f08a --- /dev/null +++ b/doc/libtrap-devel/structtb__block__s__coll__graph.md5 @@ -0,0 +1 @@ +da679f88c2b214092e00c69c4e56a4a3 \ No newline at end of file diff --git a/doc/libtrap-devel/structtb__block__s__coll__graph.png b/doc/libtrap-devel/structtb__block__s__coll__graph.png new file mode 100644 index 00000000..773c0f38 Binary files /dev/null and b/doc/libtrap-devel/structtb__block__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtcpip__receiver__private__s.html b/doc/libtrap-devel/structtcpip__receiver__private__s.html new file mode 100644 index 00000000..233ce826 --- /dev/null +++ b/doc/libtrap-devel/structtcpip__receiver__private__s.html @@ -0,0 +1,344 @@ + + + + + + + +Libtrap: Internal development docs: tcpip_receiver_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

#include <ifc_tcpip_internal.h>

+
+Collaboration diagram for tcpip_receiver_private_s:
+
+
Collaboration graph
+ + + + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
char * dest_addr
 
char * dest_port
 
char connected
 
char is_terminated
 
int sd
 
enum tcpip_ifc_sockettype socket_type
 
void * data_pointer
 
uint32_t data_wait_size
 
void * ext_buffer
 
uint32_t ext_buffer_size
 
trap_buffer_header_t int_mess_header
 
uint32_t ifc_idx
 
+

Detailed Description

+
+

Definition at line 122 of file ifc_tcpip_internal.h.

+

Field Documentation

+ +

◆ connected

+ +
+
+ + + + +
char tcpip_receiver_private_s::connected
+
+ +

Definition at line 126 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* tcpip_receiver_private_s::ctx
+
+

Libtrap context

+ +

Definition at line 123 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ data_pointer

+ +
+
+ + + + +
void* tcpip_receiver_private_s::data_pointer
+
+

Pointer to next free byte, if NULL, we ended in header

+ +

Definition at line 130 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ data_wait_size

+ +
+
+ + + + +
uint32_t tcpip_receiver_private_s::data_wait_size
+
+

Missing data to accept in the next function call

+ +

Definition at line 131 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ dest_addr

+ +
+
+ + + + +
char* tcpip_receiver_private_s::dest_addr
+
+ +

Definition at line 124 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ dest_port

+ +
+
+ + + + +
char* tcpip_receiver_private_s::dest_port
+
+ +

Definition at line 125 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ext_buffer

+ +
+
+ + + + +
void* tcpip_receiver_private_s::ext_buffer
+
+

Pointer to buffer that was passed by higher layer - this is the place we write

+ +

Definition at line 132 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ext_buffer_size

+ +
+
+ + + + +
uint32_t tcpip_receiver_private_s::ext_buffer_size
+
+

size of content of the extbuffer

+ +

Definition at line 133 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ifc_idx

+ +
+
+ + + + +
uint32_t tcpip_receiver_private_s::ifc_idx
+
+ +

Definition at line 135 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ int_mess_header

+ +
+
+ + + + +
trap_buffer_header_t tcpip_receiver_private_s::int_mess_header
+
+

Internal message header - used for message_buffer payload size

Note
message_buffer size is sizeof(tcpip_tdu_header_t) + payload size
+ +

Definition at line 134 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char tcpip_receiver_private_s::is_terminated
+
+ +

Definition at line 127 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ sd

+ +
+
+ + + + +
int tcpip_receiver_private_s::sd
+
+ +

Definition at line 128 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ socket_type

+ +
+
+ + + + +
enum tcpip_ifc_sockettype tcpip_receiver_private_s::socket_type
+
+ +

Definition at line 129 of file ifc_tcpip_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.map b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.map new file mode 100644 index 00000000..cb33efc6 --- /dev/null +++ b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.md5 b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.md5 new file mode 100644 index 00000000..c49aed90 --- /dev/null +++ b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.md5 @@ -0,0 +1 @@ +4cb3d23477904e263e28a80f8cf8fbcd \ No newline at end of file diff --git a/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.png b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.png new file mode 100644 index 00000000..78bc0a74 Binary files /dev/null and b/doc/libtrap-devel/structtcpip__receiver__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtcpip__sender__private__s.html b/doc/libtrap-devel/structtcpip__sender__private__s.html new file mode 100644 index 00000000..716991cc --- /dev/null +++ b/doc/libtrap-devel/structtcpip__sender__private__s.html @@ -0,0 +1,546 @@ + + + + + + + +Libtrap: Internal development docs: tcpip_sender_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

Structure for TCP/IP IFC private information. + More...

+ +

#include <ifc_tcpip_internal.h>

+
+Collaboration diagram for tcpip_sender_private_s:
+
+
Collaboration graph
+ + + + + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
enum tcpip_ifc_sockettype socket_type
 
int term_pipe [2]
 
int server_sd
 
char * server_port
 
char is_terminated
 
char initialized
 
uint64_t autoflush_timestamp
 
uint64_t clients_bit_arr
 
uint32_t ifc_idx
 
uint32_t connected_clients
 
uint32_t clients_arr_size
 
uint32_t buffer_count
 
uint32_t buffer_size
 
uint32_t active_buffer
 
buffer_tbuffers
 
client_tclients
 
struct pollfd * clients_pfds
 
pthread_t accept_thr
 
pthread_t send_thr
 
pthread_mutex_t mtx_no_data
 
pthread_cond_t cond_no_data
 
pthread_cond_t cond_full_buffer
 
+

Detailed Description

+

Structure for TCP/IP IFC private information.

+ +

Definition at line 79 of file ifc_tcpip_internal.h.

+

Field Documentation

+ +

◆ accept_thr

+ +
+
+ + + + +
pthread_t tcpip_sender_private_s::accept_thr
+
+

Pthread structure containing info about accept thread

+ +

Definition at line 106 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ active_buffer

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::active_buffer
+
+

Index of active buffer in 'buffers' array

+ +

Definition at line 99 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ autoflush_timestamp

+ +
+
+ + + + +
uint64_t tcpip_sender_private_s::autoflush_timestamp
+
+

Time when the last buffer was finished - used for autoflush

+ +

Definition at line 91 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ buffer_count

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::buffer_count
+
+

Number of buffers used

+ +

Definition at line 97 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ buffer_size

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::buffer_size
+
+

Buffer size [bytes]

+ +

Definition at line 98 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ buffers

+ +
+
+ + + + +
buffer_t* tcpip_sender_private_s::buffers
+
+

Array of buffer structures

+ +

Definition at line 101 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ clients

+ +
+
+ + + + +
client_t* tcpip_sender_private_s::clients
+
+

Array of client structures

+ +

Definition at line 102 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ clients_arr_size

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::clients_arr_size
+
+

Maximum number of clients

+ +

Definition at line 96 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ clients_bit_arr

+ +
+
+ + + + +
uint64_t tcpip_sender_private_s::clients_bit_arr
+
+

Bit array of currently connected clients - lowest bit = index 0, highest bit = index 63

+ +

Definition at line 92 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ clients_pfds

+ +
+
+ + + + +
struct pollfd* tcpip_sender_private_s::clients_pfds
+
+

Array of clients pfds for poll

+ +

Definition at line 104 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ cond_full_buffer

+ +
+
+ + + + +
pthread_cond_t tcpip_sender_private_s::cond_full_buffer
+
+

Condition struct used when waiting for free buffer

+ +

Definition at line 111 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ cond_no_data

+ +
+
+ + + + +
pthread_cond_t tcpip_sender_private_s::cond_no_data
+
+

Condition struct used when waiting for new data

+ +

Definition at line 110 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ connected_clients

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::connected_clients
+
+

Number of currently connected clients

+ +

Definition at line 95 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* tcpip_sender_private_s::ctx
+
+

Libtrap context

+ +

Definition at line 80 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ ifc_idx

+ +
+
+ + + + +
uint32_t tcpip_sender_private_s::ifc_idx
+
+

Index of interface in 'out_ifc_list' array

+ +

Definition at line 94 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ initialized

+ +
+
+ + + + +
char tcpip_sender_private_s::initialized
+
+

Initialization flag

+ +

Definition at line 89 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char tcpip_sender_private_s::is_terminated
+
+

Termination flag

+ +

Definition at line 88 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ mtx_no_data

+ +
+
+ + + + +
pthread_mutex_t tcpip_sender_private_s::mtx_no_data
+
+

Mutex for cond_no_data

+ +

Definition at line 109 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ send_thr

+ +
+
+ + + + +
pthread_t tcpip_sender_private_s::send_thr
+
+

Pthread structure containing info about sending thread

+ +

Definition at line 107 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ server_port

+ +
+
+ + + + +
char* tcpip_sender_private_s::server_port
+
+

TCPIP port number / UNIX socket path

+ +

Definition at line 87 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ server_sd

+ +
+
+ + + + +
int tcpip_sender_private_s::server_sd
+
+

Server socket descriptor

+ +

Definition at line 85 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ socket_type

+ +
+
+ + + + +
enum tcpip_ifc_sockettype tcpip_sender_private_s::socket_type
+
+

Socket type (TCPIP / UNIX)

+ +

Definition at line 82 of file ifc_tcpip_internal.h.

+ +
+
+ +

◆ term_pipe

+ +
+
+ + + + +
int tcpip_sender_private_s::term_pipe[2]
+
+

File descriptor pair for select() termination

+ +

Definition at line 84 of file ifc_tcpip_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.map b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.map new file mode 100644 index 00000000..9b1aa82b --- /dev/null +++ b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.md5 b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.md5 new file mode 100644 index 00000000..5e296f2b --- /dev/null +++ b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.md5 @@ -0,0 +1 @@ +dfb23d6e7aae30cc0bfbcc0a17d91c9e \ No newline at end of file diff --git a/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.png b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.png new file mode 100644 index 00000000..cc0a1cb7 Binary files /dev/null and b/doc/libtrap-devel/structtcpip__sender__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtls__receiver__private__s.html b/doc/libtrap-devel/structtls__receiver__private__s.html new file mode 100644 index 00000000..2250b77a --- /dev/null +++ b/doc/libtrap-devel/structtls__receiver__private__s.html @@ -0,0 +1,425 @@ + + + + + + + +Libtrap: Internal development docs: tls_receiver_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

#include <ifc_tls_internal.h>

+
+Collaboration diagram for tls_receiver_private_s:
+
+
Collaboration graph
+ + + + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
char * dest_addr
 
char * dest_port
 
char * keyfile
 
char * certfile
 
char * cafile
 
SSL_CTX * sslctx
 
SSL * ssl
 
char connected
 
char is_terminated
 
int sd
 
void * data_pointer
 
uint32_t data_wait_size
 
void * ext_buffer
 
uint32_t ext_buffer_size
 
trap_buffer_header_t int_mess_header
 
uint32_t ifc_idx
 
+

Detailed Description

+
+

Definition at line 130 of file ifc_tls_internal.h.

+

Field Documentation

+ +

◆ cafile

+ +
+
+ + + + +
char* tls_receiver_private_s::cafile
+
+

Path to trusted CAs (can be chain file) file in PEM format.

+ +

Definition at line 137 of file ifc_tls_internal.h.

+ +
+
+ +

◆ certfile

+ +
+
+ + + + +
char* tls_receiver_private_s::certfile
+
+

Path to certificate in PEM format.

+ +

Definition at line 136 of file ifc_tls_internal.h.

+ +
+
+ +

◆ connected

+ +
+
+ + + + +
char tls_receiver_private_s::connected
+
+

Indicates whether client is connected to server.

+ +

Definition at line 142 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* tls_receiver_private_s::ctx
+
+

Libtrap context

+ +

Definition at line 131 of file ifc_tls_internal.h.

+ +
+
+ +

◆ data_pointer

+ +
+
+ + + + +
void* tls_receiver_private_s::data_pointer
+
+

Pointer to next free byte, if NULL, we ended in header

+ +

Definition at line 145 of file ifc_tls_internal.h.

+ +
+
+ +

◆ data_wait_size

+ +
+
+ + + + +
uint32_t tls_receiver_private_s::data_wait_size
+
+ +

Definition at line 146 of file ifc_tls_internal.h.

+ +
+
+ +

◆ dest_addr

+ +
+
+ + + + +
char* tls_receiver_private_s::dest_addr
+
+

Destination address

+ +

Definition at line 132 of file ifc_tls_internal.h.

+ +
+
+ +

◆ dest_port

+ +
+
+ + + + +
char* tls_receiver_private_s::dest_port
+
+

Destination port

+ +

Definition at line 133 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ext_buffer

+ +
+
+ + + + +
void* tls_receiver_private_s::ext_buffer
+
+

Missing data to accept in the next function call Pointer to buffer that was passed by higher layer - this is the place we write

+ +

Definition at line 147 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ext_buffer_size

+ +
+
+ + + + +
uint32_t tls_receiver_private_s::ext_buffer_size
+
+ +

Definition at line 148 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ifc_idx

+ +
+
+ + + + +
uint32_t tls_receiver_private_s::ifc_idx
+
+

Index of IFC

+ +

Definition at line 150 of file ifc_tls_internal.h.

+ +
+
+ +

◆ int_mess_header

+ +
+
+ + + + +
trap_buffer_header_t tls_receiver_private_s::int_mess_header
+
+

size of content of the extbuffer Internal message header - used for message_buffer payload size

Note
message_buffer size is sizeof(tls_tdu_header_t) + payload size
+ +

Definition at line 149 of file ifc_tls_internal.h.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char tls_receiver_private_s::is_terminated
+
+

Indicates whether client should be destroyed.

+ +

Definition at line 143 of file ifc_tls_internal.h.

+ +
+
+ +

◆ keyfile

+ +
+
+ + + + +
char* tls_receiver_private_s::keyfile
+
+

Path to private key file in PEM format.

+ +

Definition at line 135 of file ifc_tls_internal.h.

+ +
+
+ +

◆ sd

+ +
+
+ + + + +
int tls_receiver_private_s::sd
+
+

Socket descriptor

+ +

Definition at line 144 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ssl

+ +
+
+ + + + +
SSL* tls_receiver_private_s::ssl
+
+

SSL conection info of client

+ +

Definition at line 140 of file ifc_tls_internal.h.

+ +
+
+ +

◆ sslctx

+ +
+
+ + + + +
SSL_CTX* tls_receiver_private_s::sslctx
+
+

Whole client SSL context.

+ +

Definition at line 139 of file ifc_tls_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.map b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.map new file mode 100644 index 00000000..ba42e8c5 --- /dev/null +++ b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.md5 b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.md5 new file mode 100644 index 00000000..8b5d8aca --- /dev/null +++ b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.md5 @@ -0,0 +1 @@ +a391e2a2b33ecbb833415b5b1ecf8b0f \ No newline at end of file diff --git a/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.png b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.png new file mode 100644 index 00000000..37fc6447 Binary files /dev/null and b/doc/libtrap-devel/structtls__receiver__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtls__sender__private__s.html b/doc/libtrap-devel/structtls__sender__private__s.html new file mode 100644 index 00000000..183a9697 --- /dev/null +++ b/doc/libtrap-devel/structtls__sender__private__s.html @@ -0,0 +1,584 @@ + + + + + + + +Libtrap: Internal development docs: tls_sender_private_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

Structure for TLS IFC private information. + More...

+ +

#include <ifc_tls_internal.h>

+
+Collaboration diagram for tls_sender_private_s:
+
+
Collaboration graph
+ + + + + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
SSL_CTX * sslctx
 
char * keyfile
 
char * certfile
 
char * cafile
 
int term_pipe [2]
 
int server_sd
 
char * server_port
 
char is_terminated
 
char initialized
 
uint64_t autoflush_timestamp
 
uint64_t clients_bit_arr
 
uint32_t ifc_idx
 
uint32_t connected_clients
 
uint32_t clients_arr_size
 
uint32_t buffer_count
 
uint32_t buffer_size
 
uint32_t active_buffer
 
buffer_tbuffers
 
tlsclient_tclients
 
pthread_t accept_thr
 
pthread_t send_thr
 
pthread_mutex_t mtx_no_data
 
pthread_cond_t cond_no_data
 
pthread_cond_t cond_full_buffer
 
+

Detailed Description

+

Structure for TLS IFC private information.

+ +

Definition at line 85 of file ifc_tls_internal.h.

+

Field Documentation

+ +

◆ accept_thr

+ +
+
+ + + + +
pthread_t tls_sender_private_s::accept_thr
+
+

Pthread structure containing info about accept thread

+ +

Definition at line 114 of file ifc_tls_internal.h.

+ +
+
+ +

◆ active_buffer

+ +
+
+ + + + +
uint32_t tls_sender_private_s::active_buffer
+
+

Index of active buffer in 'buffers' array

+ +

Definition at line 109 of file ifc_tls_internal.h.

+ +
+
+ +

◆ autoflush_timestamp

+ +
+
+ + + + +
uint64_t tls_sender_private_s::autoflush_timestamp
+
+

Time when the last buffer was finished - used for autoflush

+ +

Definition at line 101 of file ifc_tls_internal.h.

+ +
+
+ +

◆ buffer_count

+ +
+
+ + + + +
uint32_t tls_sender_private_s::buffer_count
+
+

Number of buffers used

+ +

Definition at line 107 of file ifc_tls_internal.h.

+ +
+
+ +

◆ buffer_size

+ +
+
+ + + + +
uint32_t tls_sender_private_s::buffer_size
+
+

Buffer size [bytes]

+ +

Definition at line 108 of file ifc_tls_internal.h.

+ +
+
+ +

◆ buffers

+ +
+
+ + + + +
buffer_t* tls_sender_private_s::buffers
+
+

Array of buffer structures

+ +

Definition at line 111 of file ifc_tls_internal.h.

+ +
+
+ +

◆ cafile

+ +
+
+ + + + +
char* tls_sender_private_s::cafile
+
+

Path to trusted CAs (can be chain file) file in PEM format.

+ +

Definition at line 92 of file ifc_tls_internal.h.

+ +
+
+ +

◆ certfile

+ +
+
+ + + + +
char* tls_sender_private_s::certfile
+
+

Path to certificate in PEM format.

+ +

Definition at line 91 of file ifc_tls_internal.h.

+ +
+
+ +

◆ clients

+ +
+
+ + + + +
tlsclient_t* tls_sender_private_s::clients
+
+

Array of client structures

+ +

Definition at line 112 of file ifc_tls_internal.h.

+ +
+
+ +

◆ clients_arr_size

+ +
+
+ + + + +
uint32_t tls_sender_private_s::clients_arr_size
+
+

Maximum number of clients

+ +

Definition at line 106 of file ifc_tls_internal.h.

+ +
+
+ +

◆ clients_bit_arr

+ +
+
+ + + + +
uint64_t tls_sender_private_s::clients_bit_arr
+
+

Bit array of currently connected clients - lowest bit = index 0, highest bit = index 63

+ +

Definition at line 102 of file ifc_tls_internal.h.

+ +
+
+ +

◆ cond_full_buffer

+ +
+
+ + + + +
pthread_cond_t tls_sender_private_s::cond_full_buffer
+
+

Condition struct used when waiting for free buffer

+ +

Definition at line 119 of file ifc_tls_internal.h.

+ +
+
+ +

◆ cond_no_data

+ +
+
+ + + + +
pthread_cond_t tls_sender_private_s::cond_no_data
+
+

Condition struct used when waiting for new data

+ +

Definition at line 118 of file ifc_tls_internal.h.

+ +
+
+ +

◆ connected_clients

+ +
+
+ + + + +
uint32_t tls_sender_private_s::connected_clients
+
+

Number of currently connected clients

+ +

Definition at line 105 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ctx

+ +
+
+ + + + +
trap_ctx_priv_t* tls_sender_private_s::ctx
+
+

Libtrap context

+ +

Definition at line 86 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ifc_idx

+ +
+
+ + + + +
uint32_t tls_sender_private_s::ifc_idx
+
+

Index of interface in 'out_ifc_list' array

+ +

Definition at line 104 of file ifc_tls_internal.h.

+ +
+
+ +

◆ initialized

+ +
+
+ + + + +
char tls_sender_private_s::initialized
+
+

Initialization flag

+ +

Definition at line 99 of file ifc_tls_internal.h.

+ +
+
+ +

◆ is_terminated

+ +
+
+ + + + +
char tls_sender_private_s::is_terminated
+
+

Termination flag

+ +

Definition at line 98 of file ifc_tls_internal.h.

+ +
+
+ +

◆ keyfile

+ +
+
+ + + + +
char* tls_sender_private_s::keyfile
+
+

Path to private key file in PEM format.

+ +

Definition at line 90 of file ifc_tls_internal.h.

+ +
+
+ +

◆ mtx_no_data

+ +
+
+ + + + +
pthread_mutex_t tls_sender_private_s::mtx_no_data
+
+

Mutex for cond_no_data

+ +

Definition at line 117 of file ifc_tls_internal.h.

+ +
+
+ +

◆ send_thr

+ +
+
+ + + + +
pthread_t tls_sender_private_s::send_thr
+
+

Pthread structure containing info about sending thread

+ +

Definition at line 115 of file ifc_tls_internal.h.

+ +
+
+ +

◆ server_port

+ +
+
+ + + + +
char* tls_sender_private_s::server_port
+
+

TCPIP port number / UNIX socket path

+ +

Definition at line 97 of file ifc_tls_internal.h.

+ +
+
+ +

◆ server_sd

+ +
+
+ + + + +
int tls_sender_private_s::server_sd
+
+

Server socket descriptor

+ +

Definition at line 95 of file ifc_tls_internal.h.

+ +
+
+ +

◆ sslctx

+ +
+
+ + + + +
SSL_CTX* tls_sender_private_s::sslctx
+
+

Server SSL context.

+ +

Definition at line 88 of file ifc_tls_internal.h.

+ +
+
+ +

◆ term_pipe

+ +
+
+ + + + +
int tls_sender_private_s::term_pipe[2]
+
+

File descriptor pair for select() termination

+ +

Definition at line 94 of file ifc_tls_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtls__sender__private__s__coll__graph.map b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.map new file mode 100644 index 00000000..20d602c2 --- /dev/null +++ b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/libtrap-devel/structtls__sender__private__s__coll__graph.md5 b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.md5 new file mode 100644 index 00000000..7e97952f --- /dev/null +++ b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.md5 @@ -0,0 +1 @@ +55b4294b2447adfaef7f5cbad186ff11 \ No newline at end of file diff --git a/doc/libtrap-devel/structtls__sender__private__s__coll__graph.png b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.png new file mode 100644 index 00000000..f96b4e9a Binary files /dev/null and b/doc/libtrap-devel/structtls__sender__private__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtlsclient__s.html b/doc/libtrap-devel/structtlsclient__s.html new file mode 100644 index 00000000..f22a9d6c --- /dev/null +++ b/doc/libtrap-devel/structtlsclient__s.html @@ -0,0 +1,267 @@ + + + + + + + +Libtrap: Internal development docs: tlsclient_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +

Structure for TLS IFC client information. + More...

+ +

#include <ifc_tls_internal.h>

+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

SSL * ssl
 
int sd
 
void * sending_pointer
 
uint64_t timer_total
 
uint64_t timeouts
 
uint32_t timer_last
 
uint32_t pending_bytes
 
uint32_t id
 
uint32_t assigned_buffer
 
+

Detailed Description

+

Structure for TLS IFC client information.

+ +

Definition at line 67 of file ifc_tls_internal.h.

+

Field Documentation

+ +

◆ assigned_buffer

+ +
+
+ + + + +
uint32_t tlsclient_s::assigned_buffer
+
+

Index of assigned buffer in array of buffers

+ +

Definition at line 79 of file ifc_tls_internal.h.

+ +
+
+ +

◆ id

+ +
+
+ + + + +
uint32_t tlsclient_s::id
+
+

Client identification - PID for unix socket, port number for TCP socket

+ +

Definition at line 78 of file ifc_tls_internal.h.

+ +
+
+ +

◆ pending_bytes

+ +
+
+ + + + +
uint32_t tlsclient_s::pending_bytes
+
+

The size of data that must be sent

+ +

Definition at line 77 of file ifc_tls_internal.h.

+ +
+
+ +

◆ sd

+ +
+
+ + + + +
int tlsclient_s::sd
+
+

Client socket descriptor

+ +

Definition at line 70 of file ifc_tls_internal.h.

+ +
+
+ +

◆ sending_pointer

+ +
+
+ + + + +
void* tlsclient_s::sending_pointer
+
+

Pointer to data in client's assigned buffer

+ +

Definition at line 71 of file ifc_tls_internal.h.

+ +
+
+ +

◆ ssl

+ +
+
+ + + + +
SSL* tlsclient_s::ssl
+
+

Client SSL info.

+ +

Definition at line 68 of file ifc_tls_internal.h.

+ +
+
+ +

◆ timeouts

+ +
+
+ + + + +
uint64_t tlsclient_s::timeouts
+
+

Number of messages dropped (since connection) due to client blocking active buffer

+ +

Definition at line 74 of file ifc_tls_internal.h.

+ +
+
+ +

◆ timer_last

+ +
+
+ + + + +
uint32_t tlsclient_s::timer_last
+
+

Time spent on last send call [microseconds]

+ +

Definition at line 76 of file ifc_tls_internal.h.

+ +
+
+ +

◆ timer_total

+ +
+
+ + + + +
uint64_t tlsclient_s::timer_total
+
+

Total time spent sending (microseconds) since client connection

+ +

Definition at line 73 of file ifc_tls_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__buffer__header__s.html b/doc/libtrap-devel/structtrap__buffer__header__s.html new file mode 100644 index 00000000..1befb220 --- /dev/null +++ b/doc/libtrap-devel/structtrap__buffer__header__s.html @@ -0,0 +1,129 @@ + + + + + + + +Libtrap: Internal development docs: trap_buffer_header_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_buffer_header_s Struct Reference
+
+
+ +

#include <trap_internal.h>

+ + + + + + +

+Data Fields

uint32_t data_length
 
uint8_t data [0]
 
+

Detailed Description

+
+

Definition at line 358 of file trap_internal.h.

+

Field Documentation

+ +

◆ data

+ +
+
+ + + + +
uint8_t trap_buffer_header_s::data[0]
+
+ +

Definition at line 363 of file trap_internal.h.

+ +
+
+ +

◆ data_length

+ +
+
+ + + + +
uint32_t trap_buffer_header_s::data_length
+
+

size of data in the data unit

+ +

Definition at line 359 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__buffer__s.html b/doc/libtrap-devel/structtrap__buffer__s.html new file mode 100644 index 00000000..f1884bf1 --- /dev/null +++ b/doc/libtrap-devel/structtrap__buffer__s.html @@ -0,0 +1,272 @@ + + + + + + + +Libtrap: Internal development docs: trap_buffer_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_buffer_s Struct Reference
+
+
+ +

#include <trap_buffer.h>

+
+Collaboration diagram for trap_buffer_s:
+
+
Collaboration graph
+ + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

char * mem
 
tb_block_tcur_wr_block
 
tb_block_t ** blocks
 
uint16_t cur_wr_block_idx
 
tb_block_tcur_rd_block
 
uint16_t cur_rd_block_idx
 
uint32_t blocksize
 
uint16_t nblocks
 
pthread_mutex_t lock
 
+

Detailed Description

+
+

Definition at line 100 of file trap_buffer.h.

+

Field Documentation

+ +

◆ blocks

+ +
+
+ + + + +
tb_block_t** trap_buffer_s::blocks
+
+

Array of pointers to blocks.

+ +

Definition at line 114 of file trap_buffer.h.

+ +
+
+ +

◆ blocksize

+ +
+
+ + + + +
uint32_t trap_buffer_s::blocksize
+
+

Maximal size of tb_block_data_s element (containing data + 32b header).

+ +

Definition at line 133 of file trap_buffer.h.

+ +
+
+ +

◆ cur_rd_block

+ +
+
+ + + + +
tb_block_t* trap_buffer_s::cur_rd_block
+
+

Pointer to current block

+ +

Definition at line 123 of file trap_buffer.h.

+ +
+
+ +

◆ cur_rd_block_idx

+ +
+
+ + + + +
uint16_t trap_buffer_s::cur_rd_block_idx
+
+

Index of current block to spare computation when moving to next block

+ +

Definition at line 128 of file trap_buffer.h.

+ +
+
+ +

◆ cur_wr_block

+ +
+
+ + + + +
tb_block_t* trap_buffer_s::cur_wr_block
+
+

Pointer to current block

+ +

Definition at line 109 of file trap_buffer.h.

+ +
+
+ +

◆ cur_wr_block_idx

+ +
+
+ + + + +
uint16_t trap_buffer_s::cur_wr_block_idx
+
+

Index of current block to spare computation when moving to next block

+ +

Definition at line 118 of file trap_buffer.h.

+ +
+
+ +

◆ lock

+ +
+
+ + + + +
pthread_mutex_t trap_buffer_s::lock
+
+

Lock the buffer

+ +

Definition at line 143 of file trap_buffer.h.

+ +
+
+ +

◆ mem

+ +
+
+ + + + +
char* trap_buffer_s::mem
+
+

Pointer to internal memory containing the whole ring buffer.

+ +

Definition at line 104 of file trap_buffer.h.

+ +
+
+ +

◆ nblocks

+ +
+
+ + + + +
uint16_t trap_buffer_s::nblocks
+
+

Number of blocks in the buffer.

+ +

Definition at line 138 of file trap_buffer.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__buffer__s__coll__graph.map b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.map new file mode 100644 index 00000000..815f8639 --- /dev/null +++ b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/structtrap__buffer__s__coll__graph.md5 b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.md5 new file mode 100644 index 00000000..a0bc3006 --- /dev/null +++ b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.md5 @@ -0,0 +1 @@ +100328361c8dc9ea43d96a976aa72ce0 \ No newline at end of file diff --git a/doc/libtrap-devel/structtrap__buffer__s__coll__graph.png b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.png new file mode 100644 index 00000000..519f2fc0 Binary files /dev/null and b/doc/libtrap-devel/structtrap__buffer__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtrap__ctx__priv__s.html b/doc/libtrap-devel/structtrap__ctx__priv__s.html new file mode 100644 index 00000000..b746da75 --- /dev/null +++ b/doc/libtrap-devel/structtrap__ctx__priv__s.html @@ -0,0 +1,426 @@ + + + + + + + +Libtrap: Internal development docs: trap_ctx_priv_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_ctx_priv_s Struct Reference
+
+
+ +

#include <trap_internal.h>

+
+Collaboration diagram for trap_ctx_priv_s:
+
+
Collaboration graph
+ + + + + +
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

int initialized
 
volatile int terminated
 
volatile int ifc_change
 
int trap_last_error
 
const char * trap_last_error_msg
 
char error_msg_buffer [MAX_ERROR_MSG_BUFF_SIZE]
 
trap_input_ifc_tin_ifc_list
 
trap_output_ifc_tout_ifc_list
 
uint32_t num_ifc_in
 
uint32_t num_ifc_out
 
int get_data_timeout
 
pthread_mutex_t error_mtx
 
ifc_autoflush_tifc_autoflush_timeout
 
pthread_t service_thread
 
char * service_ifc_name
 
int service_thread_initialized
 
uint64_t * counter_send_message
 
uint64_t * counter_dropped_message
 
uint64_t * counter_recv_message
 
uint64_t * counter_send_buffer
 
uint64_t * counter_autoflush
 
uint64_t * counter_recv_buffer
 
uint64_t * counter_recv_delay_last
 
uint64_t * counter_recv_delay_total
 
uint64_t * recv_delay_timestamp
 
+

Detailed Description

+

Libtrap context structure.

+

It contains the whole context of one instance of libtrap. The context contains arrays of communication interfaces (IFC), buffers, locks/mutexes.

+ +

Definition at line 220 of file trap_internal.h.

+

Field Documentation

+ +

◆ error_msg_buffer

+ +
+
+ + + + +
char trap_ctx_priv_s::error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
+
+

Buffer for dynamically generated messages

+ +

Definition at line 248 of file trap_internal.h.

+ +
+
+ +

◆ error_mtx

+ +
+
+ + + + +
pthread_mutex_t trap_ctx_priv_s::error_mtx
+
+

Lock setting last error code and last error message.

+ +

Definition at line 278 of file trap_internal.h.

+ +
+
+ +

◆ get_data_timeout

+ +
+
+ + + + +
int trap_ctx_priv_s::get_data_timeout
+
+

Timeout common to all readers for multiread feature

+ +

Definition at line 273 of file trap_internal.h.

+ +
+
+ +

◆ ifc_autoflush_timeout

+ +
+
+ + + + +
ifc_autoflush_t* trap_ctx_priv_s::ifc_autoflush_timeout
+
+

Timeouts for autoflush thread.

+ +

Definition at line 283 of file trap_internal.h.

+ +
+
+ +

◆ ifc_change

+ +
+
+ + + + +
volatile int trap_ctx_priv_s::ifc_change
+
+

Number of interface changes waiting to be applied.

+ +

Definition at line 233 of file trap_internal.h.

+ +
+
+ +

◆ in_ifc_list

+ +
+
+ + + + +
trap_input_ifc_t* trap_ctx_priv_s::in_ifc_list
+
+

Array of input interfaces

+ +

Definition at line 253 of file trap_internal.h.

+ +
+
+ +

◆ initialized

+ +
+
+ + + + +
int trap_ctx_priv_s::initialized
+
+

Is libtrap initialized correctly? (0 ~ false)

+ +

Definition at line 224 of file trap_internal.h.

+ +
+
+ +

◆ num_ifc_in

+ +
+
+ + + + +
uint32_t trap_ctx_priv_s::num_ifc_in
+
+

Number of input interfaces

+ +

Definition at line 263 of file trap_internal.h.

+ +
+
+ +

◆ num_ifc_out

+ +
+
+ + + + +
uint32_t trap_ctx_priv_s::num_ifc_out
+
+

Number of output interfaces

+ +

Definition at line 268 of file trap_internal.h.

+ +
+
+ +

◆ out_ifc_list

+ +
+
+ + + + +
trap_output_ifc_t* trap_ctx_priv_s::out_ifc_list
+
+

Arrays of output interfaces

+ +

Definition at line 258 of file trap_internal.h.

+ +
+
+ +

◆ service_ifc_name

+ +
+
+ + + + +
char* trap_ctx_priv_s::service_ifc_name
+
+

Name of the service IFC socket, it is disabled when NULL.

+ +

Definition at line 293 of file trap_internal.h.

+ +
+
+ +

◆ service_thread

+ +
+
+ + + + +
pthread_t trap_ctx_priv_s::service_thread
+
+

Service thread that enables communication with module

+ +

Definition at line 288 of file trap_internal.h.

+ +
+
+ +

◆ service_thread_initialized

+ +
+
+ + + + +
int trap_ctx_priv_s::service_thread_initialized
+
+

Indicator of initialized service thread

+ +

Definition at line 298 of file trap_internal.h.

+ +
+
+ +

◆ terminated

+ +
+
+ + + + +
volatile int trap_ctx_priv_s::terminated
+
+

Is libtrap terminated? (0 ~ false, should run)

+ +

Definition at line 228 of file trap_internal.h.

+ +
+
+ +

◆ trap_last_error

+ +
+
+ + + + +
int trap_ctx_priv_s::trap_last_error
+
+

Code of last error (one of the codes above)

+ +

Definition at line 238 of file trap_internal.h.

+ +
+
+ +

◆ trap_last_error_msg

+ +
+
+ + + + +
const char* trap_ctx_priv_s::trap_last_error_msg
+
+

Human-readable message about last error

+ +

Definition at line 243 of file trap_internal.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.map b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.map new file mode 100644 index 00000000..635879b4 --- /dev/null +++ b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.md5 b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.md5 new file mode 100644 index 00000000..de1c5d95 --- /dev/null +++ b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.md5 @@ -0,0 +1 @@ +2d6f4379aa11a3a6a8393e0eefaf555a \ No newline at end of file diff --git a/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.png b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.png new file mode 100644 index 00000000..b124c81a Binary files /dev/null and b/doc/libtrap-devel/structtrap__ctx__priv__s__coll__graph.png differ diff --git a/doc/libtrap-devel/structtrap__ifc__spec__s.html b/doc/libtrap-devel/structtrap__ifc__spec__s.html new file mode 100644 index 00000000..70e5d499 --- /dev/null +++ b/doc/libtrap-devel/structtrap__ifc__spec__s.html @@ -0,0 +1,129 @@ + + + + + + + +Libtrap: Internal development docs: trap_ifc_spec_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_ifc_spec_s Struct Reference
+
+
+ +

#include <trap.h>

+ + + + + + +

+Data Fields

char * types
 
char ** params
 
+

Detailed Description

+

Structure with specification of interface types and their parameters. This can be filled by command-line parameters using trap_parse_params function.

+ +

Definition at line 213 of file trap.h.

+

Field Documentation

+ +

◆ params

+ +
+
+ + + + +
char** trap_ifc_spec_s::params
+
+ +

Definition at line 215 of file trap.h.

+ +
+
+ +

◆ types

+ +
+
+ + + + +
char* trap_ifc_spec_s::types
+
+ +

Definition at line 214 of file trap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__input__ifc__s.html b/doc/libtrap-devel/structtrap__input__ifc__s.html new file mode 100644 index 00000000..4a75c161 --- /dev/null +++ b/doc/libtrap-devel/structtrap__input__ifc__s.html @@ -0,0 +1,482 @@ + + + + + + + +Libtrap: Internal development docs: trap_input_ifc_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_input_ifc_s Struct Reference
+
+
+ +

#include <trap_ifc.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

ifc_is_conn_func_t is_conn
 Pointer to is_connected function. More...
 
ifc_get_id_func_t get_id
 Pointer to get_id function. More...
 
ifc_recv_func_t recv
 Pointer to receive function. More...
 
ifc_terminate_func_t terminate
 Pointer to terminate function. More...
 
ifc_destroy_func_t destroy
 Pointer to destructor function. More...
 
ifc_create_dump_func_t create_dump
 Pointer to function for generating of dump. More...
 
void * priv
 Pointer to instance's private data. More...
 
char * buffer
 Internal pointer to buffer for messages. More...
 
char * buffer_pointer
 Internal pointer to current message in buffer. More...
 
uint32_t buffer_unread_bytes
 Number of unread bytes in buffer. More...
 
int32_t datatimeout
 Timeout for *_recv() calls. More...
 
char ifc_type
 Type of interface. More...
 
pthread_mutex_t ifc_mtx
 Locking mutex for interface. More...
 
char datatimeout_fixed
 
trap_in_ifc_state_t client_state
 
uint8_t data_type
 
char * data_fmt_spec
 
uint8_t req_data_type
 
char * req_data_fmt_spec
 
+

Detailed Description

+

Struct to hold an instance of some input interface.

+ +

Definition at line 180 of file trap_ifc.h.

+

Field Documentation

+ +

◆ buffer

+ +
+
+ + + + +
char* trap_input_ifc_s::buffer
+
+ +

Internal pointer to buffer for messages.

+ +

Definition at line 188 of file trap_ifc.h.

+ +
+
+ +

◆ buffer_pointer

+ +
+
+ + + + +
char* trap_input_ifc_s::buffer_pointer
+
+ +

Internal pointer to current message in buffer.

+ +

Definition at line 189 of file trap_ifc.h.

+ +
+
+ +

◆ buffer_unread_bytes

+ +
+
+ + + + +
uint32_t trap_input_ifc_s::buffer_unread_bytes
+
+ +

Number of unread bytes in buffer.

+ +

Definition at line 190 of file trap_ifc.h.

+ +
+
+ +

◆ client_state

+ +
+
+ + + + +
trap_in_ifc_state_t trap_input_ifc_s::client_state
+
+

Negotiation state defined as trap_in_ifc_state_t.

+ +

Definition at line 205 of file trap_ifc.h.

+ +
+
+ +

◆ create_dump

+ +
+
+ + + + +
ifc_create_dump_func_t trap_input_ifc_s::create_dump
+
+ +

Pointer to function for generating of dump.

+ +

Definition at line 186 of file trap_ifc.h.

+ +
+
+ +

◆ data_fmt_spec

+ +
+
+ + + + +
char* trap_input_ifc_s::data_fmt_spec
+
+

Message format specifier.

+

if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise, data_fmt_spec contains e.g. UniRec template specifier (string representation)

+ +

Definition at line 218 of file trap_ifc.h.

+ +
+
+ +

◆ data_type

+ +
+
+ + + + +
uint8_t trap_input_ifc_s::data_type
+
+

Message format defined by trap_data_format_t.

+ +

Definition at line 210 of file trap_ifc.h.

+ +
+
+ +

◆ datatimeout

+ +
+
+ + + + +
int32_t trap_input_ifc_s::datatimeout
+
+ +

Timeout for *_recv() calls.

+ +

Definition at line 191 of file trap_ifc.h.

+ +
+
+ +

◆ datatimeout_fixed

+ +
+
+ + + + +
char trap_input_ifc_s::datatimeout_fixed
+
+

If 1 do not allow to change timeout by module, it is used to force timeout of IFC by module's parameter. If 0 - timeout can be changed by standard way using trap_ctx_ifcctl().

+ +

Definition at line 200 of file trap_ifc.h.

+ +
+
+ +

◆ destroy

+ +
+
+ + + + +
ifc_destroy_func_t trap_input_ifc_s::destroy
+
+ +

Pointer to destructor function.

+ +

Definition at line 185 of file trap_ifc.h.

+ +
+
+ +

◆ get_id

+ +
+
+ + + + +
ifc_get_id_func_t trap_input_ifc_s::get_id
+
+ +

Pointer to get_id function.

+ +

Definition at line 182 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_mtx

+ +
+
+ + + + +
pthread_mutex_t trap_input_ifc_s::ifc_mtx
+
+ +

Locking mutex for interface.

+ +

Definition at line 193 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_type

+ +
+
+ + + + +
char trap_input_ifc_s::ifc_type
+
+ +

Type of interface.

+ +

Definition at line 192 of file trap_ifc.h.

+ +
+
+ +

◆ is_conn

+ +
+
+ + + + +
ifc_is_conn_func_t trap_input_ifc_s::is_conn
+
+ +

Pointer to is_connected function.

+ +

Definition at line 181 of file trap_ifc.h.

+ +
+
+ +

◆ priv

+ +
+
+ + + + +
void* trap_input_ifc_s::priv
+
+ +

Pointer to instance's private data.

+ +

Definition at line 187 of file trap_ifc.h.

+ +
+
+ +

◆ recv

+ +
+
+ + + + +
ifc_recv_func_t trap_input_ifc_s::recv
+
+ +

Pointer to receive function.

+ +

Definition at line 183 of file trap_ifc.h.

+ +
+
+ +

◆ req_data_fmt_spec

+ +
+
+ + + + +
char* trap_input_ifc_s::req_data_fmt_spec
+
+

Required message format specifier.

+

if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise, data_fmt_spec contains e.g. UniRec template specifier (string representation)

+ +

Definition at line 231 of file trap_ifc.h.

+ +
+
+ +

◆ req_data_type

+ +
+
+ + + + +
uint8_t trap_input_ifc_s::req_data_type
+
+

Required message format defined by trap_data_format_t

+ +

Definition at line 223 of file trap_ifc.h.

+ +
+
+ +

◆ terminate

+ +
+
+ + + + +
ifc_terminate_func_t trap_input_ifc_s::terminate
+
+ +

Pointer to terminate function.

+ +

Definition at line 184 of file trap_ifc.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__multi__result.html b/doc/libtrap-devel/structtrap__multi__result.html new file mode 100644 index 00000000..1fbbe133 --- /dev/null +++ b/doc/libtrap-devel/structtrap__multi__result.html @@ -0,0 +1,156 @@ + + + + + + + +Libtrap: Internal development docs: trap_multi_result Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_multi_result Struct Reference
+
+
+ +

#include <trap.h>

+ + + + + + + + + + + +

+Data Fields

uint16_t message_size
 Size of incoming message. More...
 
void * message
 Data of incoming message. More...
 
int result_code
 TRAP_OK if record is valid (message was received successfuly) More...
 
+

Detailed Description

+

Record with message of multi-result trap_get_data

+ +

Definition at line 216 of file trap.h.

+

Field Documentation

+ +

◆ message

+ +
+
+ + + + +
void* trap_multi_result::message
+
+ +

Data of incoming message.

+ +

Definition at line 218 of file trap.h.

+ +
+
+ +

◆ message_size

+ +
+
+ + + + +
uint16_t trap_multi_result::message_size
+
+ +

Size of incoming message.

+ +

Definition at line 217 of file trap.h.

+ +
+
+ +

◆ result_code

+ +
+
+ + + + +
int trap_multi_result::result_code
+
+ +

TRAP_OK if record is valid (message was received successfuly)

+ +

Definition at line 219 of file trap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__output__ifc__s.html b/doc/libtrap-devel/structtrap__output__ifc__s.html new file mode 100644 index 00000000..035bc8fc --- /dev/null +++ b/doc/libtrap-devel/structtrap__output__ifc__s.html @@ -0,0 +1,504 @@ + + + + + + + +Libtrap: Internal development docs: trap_output_ifc_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
trap_output_ifc_s Struct Reference
+
+
+ +

#include <trap_ifc.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

ifc_get_id_func_t get_id
 Pointer to get_id function. More...
 
ifc_disconn_clients_func_t disconn_clients
 Pointer to disconnect_clients function. More...
 
ifc_send_func_t send
 Pointer to send function. More...
 
ifc_flush_func_t flush
 Pointer to flush function. More...
 
ifc_terminate_func_t terminate
 Pointer to terminate function. More...
 
ifc_destroy_func_t destroy
 Pointer to destructor function. More...
 
ifc_create_dump_func_t create_dump
 Pointer to function for generating of dump. More...
 
ifc_get_client_count_func_t get_client_count
 Pointer to get_client_count function. More...
 
ifc_get_client_stats_json_func_t get_client_stats_json
 Pointer to get_client_stats_json function. More...
 
void * priv
 Pointer to instance's private data. More...
 
pthread_mutex_t ifc_mtx
 Locking mutex for interface. More...
 
int64_t timeout
 Internal structure to send partial data after timeout (autoflush). More...
 
int32_t datatimeout
 Timeout for *_send() calls. More...
 
char ifc_type
 Type of interface. More...
 
char bufferswitch
 Enable (1) or Disable (0) buffering, default is Enabled (1). More...
 
char timeout_fixed
 
char bufferswitch_fixed
 
char datatimeout_fixed
 
char * data_fmt_spec
 
uint8_t data_type
 
+

Detailed Description

+

Struct to hold an instance of some output interface.

+ +

Definition at line 235 of file trap_ifc.h.

+

Field Documentation

+ +

◆ bufferswitch

+ +
+
+ + + + +
char trap_output_ifc_s::bufferswitch
+
+ +

Enable (1) or Disable (0) buffering, default is Enabled (1).

+ +

Definition at line 250 of file trap_ifc.h.

+ +
+
+ +

◆ bufferswitch_fixed

+ +
+
+ + + + +
char trap_output_ifc_s::bufferswitch_fixed
+
+

If 1 do not allow to change bufferswitch by module. If 0 - bufferswitch can be changed by standard way using trap_ctx_ifcctl().

+ +

Definition at line 262 of file trap_ifc.h.

+ +
+
+ +

◆ create_dump

+ +
+
+ + + + +
ifc_create_dump_func_t trap_output_ifc_s::create_dump
+
+ +

Pointer to function for generating of dump.

+ +

Definition at line 242 of file trap_ifc.h.

+ +
+
+ +

◆ data_fmt_spec

+ +
+
+ + + + +
char* trap_output_ifc_s::data_fmt_spec
+
+

Message format specifier.

+

if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise, data_fmt_spec contains e.g. UniRec template specifier (string representation)

+ +

Definition at line 277 of file trap_ifc.h.

+ +
+
+ +

◆ data_type

+ +
+
+ + + + +
uint8_t trap_output_ifc_s::data_type
+
+

Message format defined by trap_data_format_t

+ +

Definition at line 282 of file trap_ifc.h.

+ +
+
+ +

◆ datatimeout

+ +
+
+ + + + +
int32_t trap_output_ifc_s::datatimeout
+
+ +

Timeout for *_send() calls.

+ +

Definition at line 248 of file trap_ifc.h.

+ +
+
+ +

◆ datatimeout_fixed

+ +
+
+ + + + +
char trap_output_ifc_s::datatimeout_fixed
+
+

If 1 do not allow to change timeout by module, it is used to force timeout of IFC by module's parameter. If 0 - timeout can be changed by standard way using trap_ctx_ifcctl().

+ +

Definition at line 269 of file trap_ifc.h.

+ +
+
+ +

◆ destroy

+ +
+
+ + + + +
ifc_destroy_func_t trap_output_ifc_s::destroy
+
+ +

Pointer to destructor function.

+ +

Definition at line 241 of file trap_ifc.h.

+ +
+
+ +

◆ disconn_clients

+ +
+
+ + + + +
ifc_disconn_clients_func_t trap_output_ifc_s::disconn_clients
+
+ +

Pointer to disconnect_clients function.

+ +

Definition at line 237 of file trap_ifc.h.

+ +
+
+ +

◆ flush

+ +
+
+ + + + +
ifc_flush_func_t trap_output_ifc_s::flush
+
+ +

Pointer to flush function.

+ +

Definition at line 239 of file trap_ifc.h.

+ +
+
+ +

◆ get_client_count

+ +
+
+ + + + +
ifc_get_client_count_func_t trap_output_ifc_s::get_client_count
+
+ +

Pointer to get_client_count function.

+ +

Definition at line 243 of file trap_ifc.h.

+ +
+
+ +

◆ get_client_stats_json

+ +
+
+ + + + +
ifc_get_client_stats_json_func_t trap_output_ifc_s::get_client_stats_json
+
+ +

Pointer to get_client_stats_json function.

+ +

Definition at line 244 of file trap_ifc.h.

+ +
+
+ +

◆ get_id

+ +
+
+ + + + +
ifc_get_id_func_t trap_output_ifc_s::get_id
+
+ +

Pointer to get_id function.

+ +

Definition at line 236 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_mtx

+ +
+
+ + + + +
pthread_mutex_t trap_output_ifc_s::ifc_mtx
+
+ +

Locking mutex for interface.

+ +

Definition at line 246 of file trap_ifc.h.

+ +
+
+ +

◆ ifc_type

+ +
+
+ + + + +
char trap_output_ifc_s::ifc_type
+
+ +

Type of interface.

+ +

Definition at line 249 of file trap_ifc.h.

+ +
+
+ +

◆ priv

+ +
+
+ + + + +
void* trap_output_ifc_s::priv
+
+ +

Pointer to instance's private data.

+ +

Definition at line 245 of file trap_ifc.h.

+ +
+
+ +

◆ send

+ +
+
+ + + + +
ifc_send_func_t trap_output_ifc_s::send
+
+ +

Pointer to send function.

+ +

Definition at line 238 of file trap_ifc.h.

+ +
+
+ +

◆ terminate

+ +
+
+ + + + +
ifc_terminate_func_t trap_output_ifc_s::terminate
+
+ +

Pointer to terminate function.

+ +

Definition at line 240 of file trap_ifc.h.

+ +
+
+ +

◆ timeout

+ +
+
+ + + + +
int64_t trap_output_ifc_s::timeout
+
+ +

Internal structure to send partial data after timeout (autoflush).

+ +

Definition at line 247 of file trap_ifc.h.

+ +
+
+ +

◆ timeout_fixed

+ +
+
+ + + + +
char trap_output_ifc_s::timeout_fixed
+
+

If 1 do not allow to change autoflush timeout by module. If 0 - autoflush can be changed by standard way using trap_ctx_ifcctl().

+ +

Definition at line 256 of file trap_ifc.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__service__thread__arg__s.html b/doc/libtrap-devel/structtrap__service__thread__arg__s.html new file mode 100644 index 00000000..e21fc104 --- /dev/null +++ b/doc/libtrap-devel/structtrap__service__thread__arg__s.html @@ -0,0 +1,153 @@ + + + + + + +Libtrap: Internal development docs: trap_service_thread_arg_s Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.7.0 +
+
+
+ + + + + + + + + +
+ +
+ +
+
+ +
+
trap_service_thread_arg_s Struct Reference
+
+
+
+Collaboration diagram for trap_service_thread_arg_s:
+
+
Collaboration graph
+ + +
[legend]
+ + + + + + +

+Data Fields

trap_ctx_priv_tctx
 
char * params
 
+

Detailed Description

+

Structure that contains arguments passed to service thread.

+ +

Definition at line 2405 of file trap.c.

+

Field Documentation

+ +
+
+ + + + +
trap_ctx_priv_t* trap_service_thread_arg_s::ctx
+
+

pointer to libtrap context

+ +

Definition at line 2409 of file trap.c.

+ +
+
+ +
+
+ + + + +
char* trap_service_thread_arg_s::params
+
+

IFC params

+ +

Definition at line 2413 of file trap.c.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.map b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.map new file mode 100644 index 00000000..cc640558 --- /dev/null +++ b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.md5 b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.md5 new file mode 100644 index 00000000..4e4bf4e4 --- /dev/null +++ b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.md5 @@ -0,0 +1 @@ +29428f3c01806c37d36820297146a1f0 \ No newline at end of file diff --git a/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.png b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.png new file mode 100644 index 00000000..bca85a65 Binary files /dev/null and b/doc/libtrap-devel/structtrap__service__thread__arg__s__coll__graph.png differ diff --git a/doc/libtrap-devel/sync_off.png b/doc/libtrap-devel/sync_off.png new file mode 100644 index 00000000..3b443fc6 Binary files /dev/null and b/doc/libtrap-devel/sync_off.png differ diff --git a/doc/libtrap-devel/sync_on.png b/doc/libtrap-devel/sync_on.png new file mode 100644 index 00000000..e08320fb Binary files /dev/null and b/doc/libtrap-devel/sync_on.png differ diff --git a/doc/libtrap-devel/tab_a.png b/doc/libtrap-devel/tab_a.png new file mode 100644 index 00000000..3b725c41 Binary files /dev/null and b/doc/libtrap-devel/tab_a.png differ diff --git a/doc/libtrap-devel/tab_b.png b/doc/libtrap-devel/tab_b.png new file mode 100644 index 00000000..e2b4a863 Binary files /dev/null and b/doc/libtrap-devel/tab_b.png differ diff --git a/doc/libtrap-devel/tab_h.png b/doc/libtrap-devel/tab_h.png new file mode 100644 index 00000000..fd5cb705 Binary files /dev/null and b/doc/libtrap-devel/tab_h.png differ diff --git a/doc/libtrap-devel/tab_s.png b/doc/libtrap-devel/tab_s.png new file mode 100644 index 00000000..ab478c95 Binary files /dev/null and b/doc/libtrap-devel/tab_s.png differ diff --git a/doc/libtrap-devel/tabs.css b/doc/libtrap-devel/tabs.css new file mode 100644 index 00000000..a28614b8 --- /dev/null +++ b/doc/libtrap-devel/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#doc-content{overflow:auto;display:block;padding:0;margin:0;-webkit-overflow-scrolling:touch}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file diff --git a/doc/libtrap-devel/todo.html b/doc/libtrap-devel/todo.html new file mode 100644 index 00000000..dc1f7118 --- /dev/null +++ b/doc/libtrap-devel/todo.html @@ -0,0 +1,81 @@ + + + + + + + +Libtrap: Internal development docs: Todo List + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
Todo List
+
+
+
+
Global receive_part (void *priv, void **data, uint32_t *size, struct timeval *tm)
+
continue with timeout minus time already waited
+
+
+ + + + diff --git a/doc/libtrap-devel/trap_8c.html b/doc/libtrap-devel/trap_8c.html new file mode 100644 index 00000000..d57a3b6e --- /dev/null +++ b/doc/libtrap-devel/trap_8c.html @@ -0,0 +1,1133 @@ + + + + + + + +Libtrap: Internal development docs: src/trap.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap.c File Reference
+
+
+ +

TRAP library base. +More...

+
#include <config.h>
+#include <ctype.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <getopt.h>
+#include <pthread.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <inttypes.h>
+#include <assert.h>
+#include <poll.h>
+#include "../include/libtrap/trap.h"
+#include "trap_internal.h"
+#include "trap_error.h"
+#include "trap_ifc.h"
+#include "ifc_dummy.h"
+#include "ifc_tcpip.h"
+#include "ifc_tcpip_internal.h"
+#include "ifc_file.h"
+
+Include dependency graph for trap.c:
+
+
+ + + + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

struct  msg_header_s
 
+ + + + + + + + + + + + + + + +

+Macros

#define _GNU_SOURCE
 
#define ifcdir2str(type)   (((type) == TRAPIFC_OUTPUT) ? "Output" : "Input")
 
#define SEND_DATA()
 
#define X(param, text, align, cut)
 
#define X(val)
 
#define X(val)
 
#define X(val)
 
+ + + +

+Typedefs

typedef struct msg_header_s msg_header_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

const char trap_version [] __attribute__ ((used))
 
static char * get_param_by_delimiter (const char *source, char **dest, const char delimiter)
 
void * service_thread_routine (void *arg)
 
void trap_check_global_vars (void)
 
void trap_free_global_vars (void)
 
trap_module_info_t * trap_create_module_info (const char *mname, const char *mdesc, int8_t i_ifcs, int8_t o_ifcs, uint16_t param_count)
 
int trap_update_module_param (trap_module_info_t *m, uint16_t param_id, char shortopt, const char *longopt, const char *desc, int req_arg, const char *arg_type)
 
int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
static int trap_read_from_buffer (trap_ctx_priv_t *ctx, uint32_t ifc_idx, const void **data, uint16_t *size, int timeout)
 
void trap_set_help_section (int level)
 
int trap_parse_params (int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
 
int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
 
void trap_free_ctx_t (trap_ctx_priv_t **ctx)
 
int trap_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 
int trap_terminate ()
 
int trap_finalize ()
 
void trap_get_internal_buffer (trap_ctx_priv_t *ctx, uint16_t ifc_idx, const void **data, uint32_t *size)
 Get pointer to data stored in buffer (with headers) and mark buffer as clean. More...
 
int trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
 
int trap_send (uint32_t ifcidx, const void *data, uint16_t size)
 Send data via output interface. More...
 
int trap_recv (uint32_t ifcidx, const void **data, uint16_t *size)
 Receive data from input interface. More...
 
void trap_set_verbose_level (int level)
 
int trap_get_verbose_level ()
 
void trap_json_print_string (char *str)
 
void trap_convert_module_info_to_json (const trap_module_info_t *info)
 
static void print_aligned (const char *s, uint16_t align, uint16_t cut)
 
static void print_aligned_multiline (const char *s, uint16_t align, uint16_t cut)
 
static uint16_t get_terminal_width ()
 
char * get_module_name (void)
 
void trap_print_help (const trap_module_info_t *module_info)
 
void trap_print_ifc_spec_help ()
 
char * trap_get_param_by_delimiter (const char *source, char **dest, const char delimiter)
 Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter. More...
 
void trap_set_abs_timespec (struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
void trap_set_timeouts (int timeout, struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
int trap_ifcctl (int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
void trap_send_flush (uint32_t ifc)
 Force flush of buffer. More...
 
trap_ctx_priv_ttrap_create_ctx_t ()
 
int trap_ctx_terminate (trap_ctx_t *ctx)
 Terminate libtrap context. More...
 
static uint64_t get_cur_timestamp ()
 
int trap_ctx_recv (trap_ctx_t *ctx, uint32_t ifc, const void **data, uint16_t *size)
 Read data from input interface. More...
 
int trap_ctx_finalize (trap_ctx_t **ctx)
 Terminate libtrap context and free resources. More...
 
int trap_ctx_send (trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
 Send data via output interface. More...
 
static void remove_setter_from_param (char *params, char *setter)
 
static void handle_inifc_setters (trap_input_ifc_t *ifc, char *params)
 
static int trapifc_in_construct (trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
 
static void handle_outifc_setters (trap_output_ifc_t *ifc, char *params)
 
static int trapifc_out_construct (trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
 
trap_ctx_ttrap_ctx_init3 (const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init2 (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
int trap_ctx_ifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
int trap_ctx_vifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
 Control TRAP interface. More...
 
int trap_ctx_get_last_error (trap_ctx_t *ctx)
 Get last result code from libtrap context. More...
 
const char * trap_ctx_get_last_error_msg (trap_ctx_t *ctx)
 Get last (error) message from libtrap context. More...
 
void trap_ctx_send_flush (trap_ctx_t *ctx, uint32_t ifc)
 Force flush of buffer. More...
 
int service_get_data (int sock_d, uint32_t size, void **data)
 
int service_send_data (int sock_d, uint32_t size, void **data)
 
int encode_cnts_to_json (char **data, trap_ctx_priv_t *ctx)
 
void trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path)
 Create dump files. More...
 
int trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx)
 Get number of connected clients. More...
 
void trap_ctx_vset_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
 
void trap_ctx_set_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_vset_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_set_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_get_data_fmt (trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
 
void trap_set_data_fmt (uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_set_required_fmt (uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_get_data_fmt (uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
 
int trap_ctx_get_in_ifc_state (trap_ctx_t *ctx, uint32_t ifc_idx)
 
int trap_get_in_ifc_state (uint32_t ifc_idx)
 
const char * trap_get_type_and_name_from_string (const char *source, const char **name, const char **type, int *length_name, int *length_type)
 
int trap_ctx_cmp_data_fmt (const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
 
void * trap_get_global_ctx ()
 
int output_ifc_negotiation (void *ifc_priv_data, char ifc_type, uint32_t client_idx)
 
int input_ifc_negotiation (void *ifc_priv_data, char ifc_type)
 
+ + + + + + + + + + + + + + + + + +

+Variables

char trap_help_spec = 0
 
char trap_ifc_type_supported []
 
trap_ctx_priv_ttrap_glob_ctx = NULL
 
int trap_last_error = TRAP_E_OK
 Code of last error (one of the codes above) More...
 
const char * trap_last_error_msg = NULL
 Human-readable message about last error. More...
 
char error_msg_buffer [MAX_ERROR_MSG_BUFF_SIZE]
 
char ** environ
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ _GNU_SOURCE

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+ +

Definition at line 48 of file trap.c.

+ +
+
+ +

◆ ifcdir2str

+ +
+
+ + + + + + + + +
#define ifcdir2str( type)   (((type) == TRAPIFC_OUTPUT) ? "Output" : "Input")
+
+

String representation of interface direction (Input/Output)

+ +

Definition at line 130 of file trap.c.

+ +
+
+ +

◆ SEND_DATA

+ +
+
+ + + + + + + +
#define SEND_DATA()
+
+Value:
do { \
int res = trap_ctx_send((trap_ctx_t *) trap_glob_ctx, ifcidx, data, size); \
if (res != TRAP_E_NOT_INITIALIZED) { \
trap_last_error_msg = trap_glob_ctx->trap_last_error_msg; \
trap_last_error = trap_glob_ctx->trap_last_error; \
} \
return res; \
} while (0);
#define trap_ctx_t
Definition: trap.h:59
+
int trap_ctx_send(trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
Send data via output interface.
Definition: trap.c:1448
+ +
uint8_t data[0]
+
trap_ctx_priv_t * trap_glob_ctx
Definition: trap.c:120
+
const char * trap_last_error_msg
+
#define TRAP_E_NOT_INITIALIZED
TRAP library not initilized.
Definition: trap.h:103
+
+

Definition at line 609 of file trap.c.

+ +
+
+ +

◆ X [1/4]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define X( param,
 text,
 align,
 cut 
)
+
+Value:
do { \
written = printf(param); \
if (written < align_def) { \
printf("%*s", align - written, " "); \
} \
print_aligned(text, align, cut); \
puts(""); \
} while (0)
+
+
+ +

◆ X [2/4]

+ +
+
+ + + + + + + + +
#define X( val)
+
+Value:
do { \
ifc->datatimeout = val; \
ifc->datatimeout_fixed = 1; \
} while (0)
+
+
+ +

◆ X [3/4]

+ +
+
+ + + + + + + + +
#define X( val)
+
+Value:
do { \
ifc->datatimeout = val; \
ifc->datatimeout_fixed = 1; \
} while (0)
+
+
+ +

◆ X [4/4]

+ +
+
+ + + + + + + + +
#define X( val)
+
+Value:
do { \
ifc->bufferswitch = val; \
ifc->bufferswitch_fixed = 1; \
} while (0)
+
+
+

Function Documentation

+ +

◆ __attribute__()

+ +
+
+ + + + + + + + +
const char trap_version [] __attribute__ ((used) )
+
+

Version of libtrap

+

Used from config.h that is generated by the configure script.

+

Git revision of libtrap

+

Used from config.h that is generated by the configure script.

+ +
+
+ +

◆ get_module_name()

+ +
+
+ + + + + + + + +
char* get_module_name (void )
+
+

Get name of this process/module.

+
Returns
Allocated string. If it is not possible to get the name, "module" is returned.
+ +

Definition at line 852 of file trap.c.

+ +
+
+ +

◆ get_param_by_delimiter()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
char * get_param_by_delimiter (const char * source,
char ** dest,
const char delimiter 
)
+
+inlinestatic
+
+ +

Definition at line 1185 of file trap.c.

+ +
+
+ +

◆ get_terminal_width()

+ +
+
+ + + + + +
+ + + + + + + +
static uint16_t get_terminal_width ()
+
+static
+
+

Get size of terminal.

+
Returns
Returns columns of terminal.
+ +

Definition at line 833 of file trap.c.

+ +
+
+ +

◆ input_ifc_negotiation()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int input_ifc_negotiation (void * ifc_priv_data,
char ifc_type 
)
+
+

Function handles input interface negotiation (receives hello message from output interface with its data format and data specifier and compares it with its own data format and data specifier). Hello message contains message header (data format and data specifier size) and data specifier.

+
Parameters
+ + + +
[in,out]ifc_priv_dataPointer to input interface private structure.
[in]ifc_typeType of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
+
+
+
Returns
NEG_RES_FAILED if receiving the data from output interface fails, NEG_RES_FMT_UNKNOWN if the output interface has not specified data format, NEG_RES_FMT_SUBSET if the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier, NEG_RES_CONT if the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation), NEG_RES_FMT_MISMATCH if the data format or data specifier of input and output interfaces does not match.
+

Receive hello msg header with data_type and data_fmt_spec_size
+
+
+
+ Compare data_type
+
+
+ Receive data_fmt_spec
+
+ Compare data_fmt_spec
+ Save senders data_type and data_fmt_spec

+ +

Definition at line 2995 of file trap.c.

+ +
+
+ +

◆ output_ifc_negotiation()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int output_ifc_negotiation (void * ifc_priv_data,
char ifc_type,
uint32_t client_idx 
)
+
+

Function handles output interface negotiation (sends hello message to input interface with its data format and data specifier). Hello message contains message header (data format and data specifier size) and data specifier.

+
Parameters
+ + + + +
[in]ifc_priv_dataPointer to output interface private structure.
[in]ifc_typeType of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
[in]client_idxIndex of new connected client.
+
+
+
Returns
NEG_RES_FAILED if sending the data to input interface fails, NEG_RES_FMT_UNKNOWN if the output interface has not specified data format, NEG_RES_OK signaling success (hello message successfully sent to input interface).
+

In case of file output interface, return NEG_RES_FMT_UNKNOWN In case of tcpip or unix output interface, send hello message header with format unknown value and return NEG_RES_FMT_UNKNOWN

+ +

Definition at line 2833 of file trap.c.

+ +
+
+ +

◆ print_aligned()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void print_aligned (const char * s,
uint16_t align,
uint16_t cut 
)
+
+static
+
+

Print helper for formatting text of help.

+
Parameters
+ + + + +
[in]sString to print (e.g. description).
[in]alignThe number of spaces that should be add after line-break.
[in]cutApproximate (minimal) length of string that is printed on the line. Line-break is added if needed, after the current word.
+
+
+ +

Definition at line 723 of file trap.c.

+ +
+
+ +

◆ print_aligned_multiline()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void print_aligned_multiline (const char * s,
uint16_t align,
uint16_t cut 
)
+
+static
+
+

Print helper for formatting multiline text of help.

+

Multiline text means that the string contains '
+'. print_aligned() is used for line breaking.

+
Parameters
+ + + + +
[in]sString to print (e.g. description).
[in]alignThe number of spaces that should be add after line-break.
[in]cutApproximate (minimal) length of string that is printed on the line. Line-break is added if needed, after the current word.
+
+
+ +

Definition at line 788 of file trap.c.

+ +
+
+ +

◆ trap_check_global_vars()

+ +
+
+ + + + + + + + +
void trap_check_global_vars (void )
+
+

Look for environment variables and change the change the related global variables.

+ +

Definition at line 138 of file trap.c.

+ +
+
+ +

◆ trap_convert_module_info_to_json()

+ +
+
+ + + + + + + + +
void trap_convert_module_info_to_json (const trap_module_info_t * info)
+
+ +

Definition at line 688 of file trap.c.

+ +
+
+ +

◆ trap_create_module_info()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trap_module_info_t* trap_create_module_info (const char * mname,
const char * mdesc,
int8_t i_ifcs,
int8_t o_ifcs,
uint16_t param_count 
)
+
+ +

Definition at line 184 of file trap.c.

+ +
+
+ +

◆ trap_free_global_vars()

+ +
+
+ + + + + + + + +
void trap_free_global_vars (void )
+
+ +

Definition at line 171 of file trap.c.

+ +
+
+ +

◆ trap_get_internal_buffer()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void trap_get_internal_buffer (trap_ctx_priv_tctx,
uint16_t ifc_idx,
const void ** data,
uint32_t * size 
)
+
+ +

Get pointer to data stored in buffer (with headers) and mark buffer as clean.

+ +

Definition at line 599 of file trap.c.

+ +
+
+ +

◆ trap_json_print_string()

+ +
+
+ + + + + + + + +
void trap_json_print_string (char * str)
+
+ +

Definition at line 670 of file trap.c.

+ +
+
+ +

◆ trap_update_module_param()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_update_module_param (trap_module_info_t * m,
uint16_t param_id,
char shortopt,
const char * longopt,
const char * desc,
int req_arg,
const char * arg_type 
)
+
+ +

Definition at line 203 of file trap.c.

+ +
+
+

Variable Documentation

+ +

◆ environ

+ +
+
+ + + + +
char** environ
+
+ +
+
+ +

◆ error_msg_buffer

+ +
+
+ + + + +
char error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
+
+ +

Definition at line 127 of file trap.c.

+ +
+
+ +

◆ trap_help_spec

+ +
+
+ + + + +
char trap_help_spec = 0
+
+

Print Trap IFC help in trap_print_help() if non-zero.

+ +

Definition at line 102 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap_8c__incl.map b/doc/libtrap-devel/trap_8c__incl.map new file mode 100644 index 00000000..b7e207e3 --- /dev/null +++ b/doc/libtrap-devel/trap_8c__incl.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/doc/libtrap-devel/trap_8c__incl.md5 b/doc/libtrap-devel/trap_8c__incl.md5 new file mode 100644 index 00000000..a69a36c3 --- /dev/null +++ b/doc/libtrap-devel/trap_8c__incl.md5 @@ -0,0 +1 @@ +4b7746e07d63ebdda437ca2c3ebfad8b \ No newline at end of file diff --git a/doc/libtrap-devel/trap_8c__incl.png b/doc/libtrap-devel/trap_8c__incl.png new file mode 100644 index 00000000..74a32f73 Binary files /dev/null and b/doc/libtrap-devel/trap_8c__incl.png differ diff --git a/doc/libtrap-devel/trap_8c_source.html b/doc/libtrap-devel/trap_8c_source.html new file mode 100644 index 00000000..95bd8760 --- /dev/null +++ b/doc/libtrap-devel/trap_8c_source.html @@ -0,0 +1,359 @@ + + + + + + + +Libtrap: Internal development docs: src/trap.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap.c
3  * \brief TRAP library base.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkat@cesnet.cz>
6  * \author Jan Neuzil <neuzija1@fit.cvut.cz>
7  * \author Marek Svepes <svepemar@fit.cvut.cz>
8  * \author Tomas Jansky <janskto1@fit.cvut.cz>
9  * \author Jaroslav Hlavac <hlavaj20@fit.cvut.cz>
10  * \date 2013 - 2017
11  */
12 /*
13  * Copyright (C) 2013-2017 CESNET
14  *
15  * LICENSE TERMS
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in
24  * the documentation and/or other materials provided with the
25  * distribution.
26  * 3. Neither the name of the Company nor the names of its contributors
27  * may be used to endorse or promote products derived from this
28  * software without specific prior written permission.
29  *
30  * ALTERNATIVELY, provided that this notice is retained in full, this
31  * product may be distributed under the terms of the GNU General Public
32  * License (GPL) version 2 or later, in which case the provisions
33  * of the GPL apply INSTEAD OF those given above.
34  *
35  * This software is provided ``as is'', and any express or implied
36  * warranties, including, but not limited to, the implied warranties of
37  * merchantability and fitness for a particular purpose are disclaimed.
38  * In no event shall the company or contributors be liable for any
39  * direct, indirect, incidental, special, exemplary, or consequential
40  * damages (including, but not limited to, procurement of substitute
41  * goods or services; loss of use, data, or profits; or business
42  * interruption) however caused and on any theory of liability, whether
43  * in contract, strict liability, or tort (including negligence or
44  * otherwise) arising in any way out of the use of this software, even
45  * if advised of the possibility of such damage.
46  *
47  */
48 #define _GNU_SOURCE
49 #include <config.h>
50 #include <ctype.h>
51 #include <stdint.h>
52 #include <stdlib.h>
53 #include <stdarg.h>
54 #include <stdio.h>
55 #include <getopt.h>
56 #include <pthread.h>
57 #include <signal.h>
58 #include <semaphore.h>
59 #include <unistd.h>
60 #include <errno.h>
61 #include <sys/socket.h>
62 #include <arpa/inet.h>
63 #include <sys/ioctl.h>
64 #include <stdint.h>
65 #include <inttypes.h>
66 #include <assert.h>
67 #include <poll.h>
68 
69 #include "../include/libtrap/trap.h"
70 #include "trap_internal.h"
71 #include "trap_error.h"
72 #include "trap_ifc.h"
73 #include "ifc_dummy.h"
74 #include "ifc_tcpip.h"
75 #include "ifc_tcpip_internal.h"
76 #include "ifc_file.h"
77 
78 #if HAVE_OPENSSL
79 # include "ifc_tls.h"
80 # include "ifc_tls_internal.h"
81 # include <openssl/ssl.h>
82 # include <openssl/err.h>
83 #endif
84 
85 /**
86  * Version of libtrap
87  *
88  * Used from config.h that is generated by the configure script.
89  */
90 const char trap_version[] __attribute__((used)) = PACKAGE_VERSION;
91 
92 /**
93  * Git revision of libtrap
94  *
95  * Used from config.h that is generated by the configure script.
96  */
97 const char trap_git_version[] __attribute__((used)) = GIT_VERSION;
98 
99 /**
100  * Print Trap IFC help in trap_print_help() if non-zero.
101  */
102 char trap_help_spec = 0;
103 
104 /**
105  * NULL terminated array of supported IFC types.
106  */
111 #if HAVE_OPENSSL
113 #endif
117  0
118 };
119 
121 
122 /* for backwards compatibility */
124 /* for backwards compatibility */
125 const char *trap_last_error_msg = NULL;
126 
128 
129 /** String representation of interface direction (Input/Output) */
130 #define ifcdir2str(type) (((type) == TRAPIFC_OUTPUT) ? "Output" : "Input")
131 
132 static inline char *get_param_by_delimiter(const char *source, char **dest, const char delimiter);
133 void *service_thread_routine(void *arg);
134 
135 /**
136  * Look for environment variables and change the change the related global variables.
137  */
139 {
140  int size;
141  /* According to man, getenv is not secured in some cases.
142  * 1) effective ID does not match real ID */
143  if ((getuid() != geteuid()) || (getgid() != getegid())) {
144  return;
145  }
146  /* 2) effective capability bit was set on the executable file.
147  * TODO
148  */
149 
150  /* 3) process has a nonempty permitted capability set.
151  * TODO
152  */
153 
154  /*
155  * TRAP_SOCKET_DIR env.var. to redefine path to sockets,
156  * trap_default_socket_path_format is set.
157  */
158  const char *e = getenv("TRAP_SOCKET_DIR");
159  if (e != NULL) {
160  size = snprintf(NULL, 0, "%s%s", e, DEFAULT_SOCKET_FORMAT);
161  trap_default_socket_path_format = malloc(size + 1);
163  }
164 
165 #if HAVE_OPENSSL
166  SSL_load_error_strings();
167  OpenSSL_add_ssl_algorithms();
168 #endif
169 }
170 
172 {
176  }
177 
178 #if HAVE_OPENSSL
179  EVP_cleanup();
180  ERR_free_strings();
181 #endif
182 }
183 
184 trap_module_info_t *trap_create_module_info(const char *mname, const char *mdesc, int8_t i_ifcs, int8_t o_ifcs, uint16_t param_count)
185 {
186  trap_module_info_t *m = NULL;
187 
188  m = calloc(1, sizeof(trap_module_info_t));
189  if (m != NULL) {
190  m->params = calloc(param_count + 1, sizeof(trap_module_info_parameter_t *));
191  if (m->params == NULL) {
192  free(m);
193  return NULL;
194  }
195  }
196 
197  ALLOCATE_BASIC_INFO_2(m, mname, mdesc, i_ifcs, o_ifcs);
198 
199  /* allocated module_info on success, NULL on error */
200  return m;
201 }
202 
203 int trap_update_module_param(trap_module_info_t *m, uint16_t param_id, char shortopt, const char *longopt, const char *desc, int req_arg, const char *arg_type)
204 {
205  ALLOCATE_PARAM_ITEMS_2(m, param_id, shortopt, longopt, desc, req_arg, arg_type)
206  return 0;
207 }
208 
209 ///////////////////////////////////////////////////////////////////////////////
210 
211 /**
212  * \defgroup buffering Buffering sublayer
213  * @{
214  */
215 
216 /**
217  * \brief Check content of buffer, iterate over message headers
218  * \param [in] buffer start of buffer
219  * \param [in] buffer_size size of buffer
220  * \return 0 on success, number of errors otherwise
221  */
222 int trap_check_buffer_content(void *buffer, uint32_t buffer_size)
223 {
224  uint32_t offset, check_mess_counter = 0;
225  uint16_t *check_mess_header;
226  int errors = 0;
227  void *check_mess_pointer;
228  for (offset = 0, check_mess_header = check_mess_pointer = buffer;
229  ((offset < buffer_size) && (offset < TRAP_IFC_MESSAGEQ_SIZE));) {
230  check_mess_counter++;
231  /* go to next size, skip header + payload */
232  offset += sizeof(*check_mess_header) + (*check_mess_header);
233  check_mess_pointer += sizeof(*check_mess_header) + (*check_mess_header);
234  check_mess_header = (uint16_t *) check_mess_pointer;
235  }
236  if (offset != buffer_size) {
237  VERBOSE(CL_ERROR, "Not enough data or some headers are malformed.");
238  errors++;
239  return errors;
240  }
241  return errors;
242 }
243 
244 /**
245  * Read data from buffer or receive data into buffer if buffer is empty
246  *
247  * \param[in,out] ctx pointer to the private libtrap context data (trap_ctx_init())
248  * \param[in] ifc_idx index of input interface
249  * \param[out] data pointer to received message
250  * \param[out] size size of message
251  * \param[in] timeout TRAP_WAIT | TRAP_NO_WAIT | timeout
252  */
253 static inline int trap_read_from_buffer(trap_ctx_priv_t *ctx, uint32_t ifc_idx, const void **data, uint16_t *size, int timeout)
254 {
255  int result = TRAP_E_TIMEOUT;
256  trap_input_ifc_t *ifc = &ctx->in_ifc_list[ifc_idx];
257 
258  pthread_mutex_lock(&ifc->ifc_mtx);
259  /* Receive new buffer from the input interface if the buffer is empty. */
260  if (ifc->buffer_unread_bytes == 0) {
261  uint32_t buffer_size_tmp = 0;
262 
263  ifc->buffer_pointer = ifc->buffer;
264  result = ifc->recv(ifc->priv, ifc->buffer, &buffer_size_tmp, timeout);
265  DEBUG_BUF(VERBOSE(CL_VERBOSE_LIBRARY, "Received new buffer with size: %" PRIu32 ".", buffer_size_tmp));
266  if (result == TRAP_E_OK) {
267  ifc->buffer_unread_bytes = buffer_size_tmp;
268  __sync_fetch_and_add(&ctx->counter_recv_buffer[ifc_idx], 1);
269 
270 #ifdef BUFFERING_CHECK_HEADERS
271  if (trap_check_buffer_content(ifc->buffer, buffer_size_tmp) != 0) {
272  VERBOSE(CL_ERROR, "Buffer is not valid.");
273  }
274 #endif
275  } else {
276  goto exit;
277  }
278  }
279 
280  if (ifc->buffer_unread_bytes > 0) {
281  /* Get message from buffer. */
282  (*size) = ntohs(*((uint16_t *) ifc->buffer_pointer));
283  (*data) = (ifc->buffer_pointer + sizeof(*size));
284 
285  uint32_t msg_size = (*size) + sizeof(*size);
286  DEBUG_BUF(VERBOSE(CL_VERBOSE_LIBRARY, "Read: %" PRIu64 " header bytes, %" PRIu16 " data bytes. Remaining bytes: %" PRIu32 "", sizeof(*size), *size, ifc->buffer_unread_bytes - msg_size));
287 
288  /* Check whether the buffer data were not malformed. */
289  if (ifc->buffer_unread_bytes < msg_size) {
290  ifc->buffer_unread_bytes = 0;
291  ifc->buffer_pointer = ifc->buffer;
292  VERBOSE(CL_WARNING, "Attempt to read: %" PRIu64 " header bytes, %" PRIu16 " data bytes. However, only %" PRIu32 " bytes remain.", sizeof(*size), *size, ifc->buffer_unread_bytes);
293  } else {
294  /* Move to the next message. */
295  ifc->buffer_unread_bytes -= msg_size;
296  ifc->buffer_pointer += msg_size;
297  }
298 
299  result = TRAP_E_OK;
300  } else {
301  (*size) = 0;
302  }
303 exit:
304  if (result == TRAP_E_OK) {
305  __sync_fetch_and_add(&ctx->counter_recv_message[ifc_idx], 1);
306  if (ifc->client_state == FMT_CHANGED) {
307  ifc->client_state = FMT_OK;
308  result = TRAP_E_FORMAT_CHANGED;
309  }
310  }
311  pthread_mutex_unlock(&ifc->ifc_mtx);
312 
313  return result;
314 }
315 
316 /**
317  * @}
318  */
319 
320 /** Set section for trap_print_help()
321  *
322  * \param [in] level 0 for default info about module, 1 for info about IFC specifier
323  */
324 void trap_set_help_section(int level)
325 {
326  trap_help_spec = level;
327 }
328 
329 /** Initialization function.
330  * Create and initialize all interfaces. This function parses command-line
331  * arguments; it extracts arguments it needs to set up interfaces and returns
332  * the rest (argc and argv are modified).
333  * @param[in,out] argc Pointer to number of command-line arguments.
334  * @param[in,out] argv Command-line arguments.
335  * @param[out] ifc_spec Structure with specification of interface types and
336  * their parameters.
337  * @return Error code (0 on success)
338  */
339 int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
340 {
341  uint32_t i, j, ifc_count = 0;
342  char *ifc_spec_str = NULL;
343  char *ifc_type = NULL;
344  char *p;
345  int rv = TRAP_E_OK;
346 
347  if (ifc_spec == NULL) {
348  VERBOSE(CL_ERROR, "Bad pointer 'ifc_spec' passed to trap_parse_params().");
349  return TRAP_E_BAD_FPARAMS;
350  }
351 
352  /* initialization of ifc_spec */
353  memset(ifc_spec, 0, sizeof(trap_ifc_spec_t));
354 
355  // Look for -h (or --help) parameter
356  for (i = 0; i < *argc; i++) {
357  if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
358  if (i + 1 < *argc && ((strcmp(argv[i + 1], "trap") == 0) || (strcmp(argv[i + 1], "1") == 0))) {
359  trap_help_spec = 1;
360  }
361  // Remove parameter from argv and break
362  for (j = i; j + 1 < *argc; j++) {
363  argv[j] = argv[j + 1];
364  }
365  *argc -= 1;
366  return TRAP_E_HELP;
367  }
368  }
369 
370  // Extract -i parameter (interface specifier)
371  for (i = 0; i < *argc-1; i++) {
372  if (argv[i] && strcmp(argv[i], "-i") == 0) {
373  ifc_spec_str = argv[i+1];
374  // Remove parameters from argv
375  for (j = i; j + 2 < *argc; j++) {
376  argv[j] = argv[j + 2];
377  }
378  *argc -= 2;
379  break;
380  }
381  }
382  if (ifc_spec_str == NULL) {
383  //return trap_errorf(ctx, TRAP_E_BADPARAMS, "Interface specifier (option -i) not found.");
385  trap_last_error_msg = "Interface specifier (option -i) not found.";
386  return TRAP_E_BADPARAMS;
387  }
388 
389  // Extract verbose level parameter (-v, -vv, -vvv)
390  for (i = 0; i < *argc; i++) {
391  // If param matches -v, -vv or -vvv, set verbosity level
392  if (strcmp(argv[i], "-v") == 0) {
394  } else if (strcmp(argv[i], "-vv") == 0) {
396  } else if (strcmp(argv[i], "-vvv") == 0) {
398  } else {
399  continue;
400  }
401  // Remove parameter from argv and break
402  for (j = i; j + 1 < *argc; j++) {
403  argv[j] = argv[j + 1];
404  }
405  *argc -= 1;
406  break;
407  }
408 
409  /* count the number of IFC parameters, the format is:
410  * type1:param1:param1_2,type2:,type3:param3 */
411  p = ifc_spec_str;
412  while (p && *p != '\0') {
413  p = strchr(p, TRAP_IFC_DELIMITER);
414  if (p != NULL && *p == TRAP_IFC_DELIMITER) {
415  p++;
416  }
417  ifc_count++;
418  }
419 
420  ifc_spec->types = calloc(ifc_count + 1, sizeof(*ifc_spec->types));
421  if (ifc_spec->types == NULL) {
422  return TRAP_E_MEMORY;
423  }
424  ifc_spec->params = calloc(ifc_count, sizeof(char *));
425  if (ifc_spec->params == NULL) {
426  free(ifc_spec->types);
427  ifc_spec->types = NULL;
428  return TRAP_E_MEMORY;
429  }
430 
431  p = ifc_spec_str;
432  for (i = 0; i < ifc_count; i++) {
433  /* set IFC type and skip to params */
434  if (p != NULL) {
435  ifc_spec->types[i] = p[0];
436  if (strlen(p) >= 2 && p[1] == TRAP_IFC_PARAM_DELIMITER) {
437  /* there is a param string to parse */
438  p += 2;
439  p = get_param_by_delimiter(p, &ifc_spec->params[i], TRAP_IFC_DELIMITER);
440  } else {
441  /* param was not passed, set an empty one */
442  ifc_spec->params[i] = strdup("");
443  }
444  } else {
445  /* unexpected error, p shouldn't be NULL */
446  VERBOSE(CL_ERROR, "Bad IFC_SPEC '%s'. See -h trap for help.", ifc_spec_str);
447  ifc_spec->params[i] = strdup("");
448  }
449  if (ifc_spec->params[i] == NULL) {
450  VERBOSE(CL_ERROR, "Allocation failed.");
451  rv = TRAP_E_MEMORY;
452  goto clean_on_fail;
453  }
454  }
455 
456  /* check for unsupported IFCs */
457  for (i = 0; ifc_spec->types[i] != 0; ++i) {
458  for (ifc_type = trap_ifc_type_supported; *ifc_type != 0; ++ifc_type) {
459  if (*ifc_type == ifc_spec->types[i]) {
460  break;
461  }
462  }
463  if (*ifc_type == 0) {
464  /* not found */
465  VERBOSE(CL_ERROR, "Unsupported IFC type '%c'.", ifc_spec->types[i]);
466  rv = TRAP_E_BADPARAMS;
467  goto clean_on_fail;
468  }
469  }
470 
473  return TRAP_E_OK;
474 
475 clean_on_fail:
476  for (i = 0; i < ifc_count; i++) {
477  /* set IFC type and skip to params */
478  if (ifc_spec->params[i] != NULL) {
479  free(ifc_spec->params[i]);
480  ifc_spec->params[i] = NULL;
481  }
482  }
483  if (ifc_spec->types != NULL) {
484  free(ifc_spec->types);
485  }
486  if (ifc_spec->params) {
487  free(ifc_spec->params);
488  }
489  memset(ifc_spec, 0, sizeof(trap_ifc_spec_t));
490  return rv;
491 }
492 
493 /** Destructor of trap_ifc_spec_t structure.
494  * @param[in] ifc_spec trap_ifc_spec_t structure to clear.
495  * @return Error code (0 on success)
496  */
498 {
499  int i;
500  if (ifc_spec.types == NULL) {
502  }
503  if (ifc_spec.params != NULL) {
504  for (i = 0; i < strlen(ifc_spec.types); i++) {
505  if (ifc_spec.params[i] != NULL) {
506  free(ifc_spec.params[i]);
507  ifc_spec.params[i] = NULL;
508  }
509  }
510  free(ifc_spec.params);
511  ifc_spec.params = NULL;
512  }
513  free(ifc_spec.types);
515 }
516 
517 void trap_free_ctx_t(trap_ctx_priv_t **ctx);
518 
519 /** Initialization function.
520  * Create and initialize all interfaces.
521  * @param[in] module_info Pointer to struct containing info about the module.
522  * @param[in] ifc_spec Structure with specification of interface types and
523  * their parameters.
524  * @return Error code (0 on success)
525  */
526 int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
527 {
528  int le;
529  if ((trap_glob_ctx != NULL) && (trap_glob_ctx->initialized != 0)) {
531  }
532  trap_glob_ctx = trap_ctx_init(module_info, ifc_spec);
533  if (trap_glob_ctx == NULL) {
534  return TRAP_E_MEMORY;
535  }
539 
540  trap_finalize();
542 
543  /* restore error message that was lost by finalize&free */
545  trap_last_error = le;
546  return trap_last_error;
547  }
549 }
550 
551 
552 /** Function to terminate module's operation.
553  * This function stops all read/write operations on all interfaces.
554  * Any waiting in trap_recv() and trap_send()_data is interrupted and these
555  * functions return immediately with TRAP_E_TERMINATED.
556  * Any call of trap_recv() or trap_send() after call of this function
557  * returns TRAP_E_TERMINATED.
558  *
559  * This function is used to terminate module's operation (asynchronously), e.g.
560  * in SIGTERM handler.
561  * @return Always TRAP_E_OK (0).
562  */
564 {
566  if (trap_glob_ctx != NULL) {
569  } else {
570  trap_last_error_msg = "No allocated global context.";
571  trap_last_error = ret;
572  }
573  return ret;
574 }
575 
576 
577 
579 {
580  int ret;
582  if (ret != TRAP_E_OK) {
583  if (trap_glob_ctx != NULL) {
586  } else {
587  trap_last_error_msg = "No allocated global context.";
588  trap_last_error = ret;
589  }
590  }
591  return ret;
592 }
593 
594 
595 /**
596  * \brief Get pointer to data stored in buffer (with headers) and mark buffer as clean.
597  *
598  */
599 void trap_get_internal_buffer(trap_ctx_priv_t *ctx, uint16_t ifc_idx, const void **data, uint32_t *size)
600 {
601  (*data) = ctx->in_ifc_list[ifc_idx].buffer;
602  (*size) = ctx->in_ifc_list[ifc_idx].buffer_unread_bytes;
603 
604  /* mark internal buffer as free for next reading */
605  ctx->in_ifc_list[ifc_idx].buffer_pointer = ctx->in_ifc_list[ifc_idx].buffer;
606  ctx->in_ifc_list[ifc_idx].buffer_unread_bytes = 0;
607 }
608 
609 #define SEND_DATA() do { \
610  int res = trap_ctx_send((trap_ctx_t *) trap_glob_ctx, ifcidx, data, size); \
611  if (res != TRAP_E_NOT_INITIALIZED) { \
612  trap_last_error_msg = trap_glob_ctx->trap_last_error_msg; \
613  trap_last_error = trap_glob_ctx->trap_last_error; \
614  } \
615  return res; \
616 } while (0);
617 
618 int trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout)
619 {
620  trap_glob_ctx->out_ifc_list[ifcidx].datatimeout = timeout;
621  SEND_DATA()
622 }
623 
624 int trap_send(uint32_t ifcidx, const void *data, uint16_t size)
625 {
626  SEND_DATA()
627 }
628 
629 #undef SEND_DATA
630 
631 int trap_recv(uint32_t ifcidx, const void **data, uint16_t *size)
632 {
633  int res;
634  res = trap_ctx_recv((trap_ctx_t *) trap_glob_ctx, ifcidx, data, size);
635  if (res != TRAP_E_NOT_INITIALIZED) {
638  }
639  return res;
640 }
641 
642 
643 /** Set verbosity level.
644  * Verbosity levels are:
645  * - -3 - errors
646  * - -2 - warnings
647  * - -1 - notices (default)
648  * - 0 - verbose
649  * - 1 - more verbose
650  * - 2 - even more verbose
651  *
652  * @param[in] level Desired level of verbosity.
653  */
654 void trap_set_verbose_level(int level)
655 {
656  trap_verbose = level;
657 }
658 
659 /** Get verbosity level.
660  * See trap_set_verbose_level for list of levels.
661  * @return Verbosity level currently set in the library.
662  */
664 {
665  return trap_verbose;
666 }
667 
668 extern char **environ;
669 
670 void trap_json_print_string(char *str)
671 {
672  printf("\"");
673  if (str != NULL) {
674  while (*str != 0) {
675  if (*str == '\n') {
676  printf("\\n");
677  } else if (*str == '\t') {
678  printf(" ");
679  } else {
680  printf("%c", *str);
681  }
682  str++;
683  }
684  }
685  printf("\"");
686 }
687 
688 void trap_convert_module_info_to_json(const trap_module_info_t *info)
689 {
690  int i = 0;
691 
692  printf("{\"name\":");
693  trap_json_print_string(info->name);
694  printf(",\"description\":");
695  trap_json_print_string(info->description);
696  printf(",\"num_ifc_in\":%u,\"num_ifc_out\":%u,\"params\":[",
697  info->num_ifc_in, info->num_ifc_out);
698 
699  while (info->params[i] != NULL) {
700  if (i != 0) {
701  printf(",");
702  }
703  printf("{\"short_opt\":\"%c\",\"long_opt\":", info->params[i]->short_opt);
704  trap_json_print_string(info->params[i]->long_opt);
705  printf(",\"description\":");
706  trap_json_print_string(info->params[i]->description);
707  printf(",\"argument_type\":");
708  trap_json_print_string(info->params[i]->argument_type);
709  printf(",\"mandatory_argument\": %d}", info->params[i]->param_required_argument);
710  i++;
711  }
712  printf("]}\n");
713 }
714 
715 /**
716  * Print helper for formatting text of help.
717  *
718  * \param[in] s String to print (e.g. description).
719  * \param[in] align The number of spaces that should be add after line-break.
720  * \param[in] cut Approximate (minimal) length of string that is printed on the line.
721  * Line-break is added if needed, after the current word.
722  */
723 static void print_aligned(const char *s, uint16_t align, uint16_t cut)
724 {
725  int32_t tmp = 0, rest, written;
726  const char *p = s;
727 
728  rest = strlen(s);
729  if (rest < cut) {
730  printf("%s\n", s);
731  } else {
732  written = 0;
733  while (rest > 0) {
734  /* print alignment spaces */
735  if (p != s) {
736  printf("%*s", align, " ");
737  }
738  /* skip leading spaces of text */
739  while ((*p == ' ' || *p == '\t') && *p != 0) {
740  p++;
741  rest--;
742  }
743  /* find word boundary */
744  if (rest > cut) {
745  for (tmp = cut; tmp > 0; tmp--) {
746  switch (p[tmp]) {
747  case '.':
748  case ',':
749  case ';':
750  /* let this character on the end of line */
751  tmp += 1;
752  goto write;
753  case ' ':
754  case '\t':
755  case '\n':
756  goto write;
757  default:
758  break;
759  }
760  }
761  } else {
762  tmp = cut;
763  }
764 write:
765  if (tmp == 0) {
766  /* failed to find word separator and it is useless
767  * to write 0 chars -> write the whole line */
768  tmp = cut;
769  }
770  written = printf("%.*s\n", tmp, p);
771  rest -= written;
772  p += written - 1;
773  }
774  }
775 }
776 
777 /**
778  * Print helper for formatting multiline text of help.
779  *
780  * Multiline text means that the string contains '\n'.
781  * print_aligned() is used for line breaking.
782  *
783  * \param[in] s String to print (e.g. description).
784  * \param[in] align The number of spaces that should be add after line-break.
785  * \param[in] cut Approximate (minimal) length of string that is printed on the line.
786  * Line-break is added if needed, after the current word.
787  */
788 static void print_aligned_multiline(const char *s, uint16_t align, uint16_t cut)
789 {
790  const char *eol = NULL, *sol = s;
791  int bufsize = 512, linewidth;
792  char *buffer = calloc(1, bufsize);
793  if (buffer == NULL) {
794  VERBOSE(CL_ERROR, "Failed to allocate buffer for printing.");
795  goto failed;
796  }
797  do {
798  eol = strchr(sol, '\n');
799  if (eol == NULL) {
800  /* end of text */
801  linewidth = strlen(sol);
802  } else {
803  linewidth = eol - sol;
804  }
805 
806  if (linewidth >= bufsize) {
807  buffer = realloc(buffer, linewidth + 1);
808  bufsize = linewidth + 1;
809  if (buffer == NULL) {
810  VERBOSE(CL_ERROR, "Failed to allocate buffer for printing.");
811  goto failed;
812  }
813  }
814  strncpy(buffer, sol, linewidth);
815  if (buffer[linewidth - 1] == '\n') {
816  buffer[linewidth - 1] = 0;
817  } else {
818  buffer[linewidth] = 0;
819  }
820  print_aligned(buffer, 0, cut);
821  sol = eol + 1;
822  } while (eol != NULL);
823 
824 failed:
825  free(buffer);
826 }
827 
828 /**
829  * Get size of terminal.
830  *
831  * \return Returns columns of terminal.
832  */
833 static uint16_t get_terminal_width()
834 {
835  struct winsize ws;
836  if (ioctl(1, TIOCGWINSZ, &ws) == 0) {
837  if (ws.ws_col > 0) {
838  return ws.ws_col - 1;
839  } else {
840  return 0;
841  }
842  }
843  return 0;
844 }
845 
846 /**
847  * Get name of this process/module.
848  *
849  * \return Allocated string. If it is not possible to get the name,
850  * "module" is returned.
851  */
852 char *get_module_name(void)
853 {
854  size_t bufsize = 1024, rv;
855  char buffer[bufsize], *p, *ret;
856  FILE *f = fopen("/proc/self/cmdline", "r");
857  if (f == NULL) {
858  /* unknown name */
859  return strdup("module");
860  }
861  rv = fread(buffer, 1, bufsize - 1, f);
862  buffer[rv] = 0;
863  if (rv > 0) {
864  p = buffer;
865  /* skip to the next argument if this one matches regex /^python[23]?/ */
866  ret = strstr(p, "python");
867  if (ret != NULL && ((ret[6] == 0) || (ret[6] == '2') || (ret[6] == '3'))) {
868  p = strchr(p, 0);
869  p += 1;
870  }
871  ret = strrchr(p, '/');
872  if (ret == NULL) {
873  /* '/' was not found, module_name does not contain path */
874  ret = strdup(p);
875  } else {
876  /* skip found '/' */
877  p = ret + 1;
878  /* skip "lt-" prefix of libtool */
879  if (p[0] == 'l' && p[1] == 't' && p[2] == '-') {
880  p += 3;
881  }
882  /* return the result */
883  ret = strdup(p);
884  }
885  } else {
886  /* unknown name */
887  ret = strdup("module");
888  }
889  fclose(f);
890  return ret;
891 }
892 
893 /** Print common TRAP help message.
894  * The help message contains information from module_info and describes common
895  * TRAP command-line parameters.
896  * @param[in] module_info Pointer to struct containing info about the module.
897  */
898 void trap_print_help(const trap_module_info_t *module_info)
899 {
900  char *pager = NULL, *output_format = NULL;
901  const char *temp_env;
902  int pager_fds[2];
903  uint32_t i, written = 0, tmp = 0, cols;
904  pid_t p;
905  uint8_t adit_param = 0, opt_param = 0;
906  uint16_t align_def = 0, align_opt = 0;
907 
908  /* Decide which format of output will be used according to the environment variable */
909  temp_env = getenv("LIBTRAP_OUTPUT_FORMAT");
910  if (temp_env != NULL) {
911  output_format = strdup(temp_env);
912  }
913  if (output_format != NULL) {
914  if (strcmp(output_format, "json") == 0) {
916  free(output_format);
917  return;
918  }
919  }
920  /* output format is useless by now */
921  free(output_format);
922 
923  cols = get_terminal_width();
924  if (cols == 0) {
926  }
927 
928  temp_env = getenv("PAGER");
929  if (temp_env != NULL) {
930  pager = strdup(temp_env);
931  }
932 
933  if ((pager == NULL) || (strcmp(pager, "") == 0)) {
934  goto output;
935  }
936 
937  if (pipe(pager_fds) < 0) {
938  fprintf(stderr, "pipe() failed.");
939  goto output;
940  }
941 
942  p = fork();
943  if (p < 0) {
944  fprintf(stderr, "fork() failed.");
945  goto output;
946  } else if (p == 0) {
947  /* child - pager */
948  close(pager_fds[0]); /* close unused read end!!! important */
949  /* set write end of pipe as stdout for this child process */
950  dup2(pager_fds[1], STDOUT_FILENO);
951  close(pager_fds[1]); /* important */
952  goto output;
953  } else {
954  /* parent */
955  char *args[] = {pager, NULL};
956  close(pager_fds[1]); /* close unused write end!!! important */
957  /* set read end of pipe as stdin for this process */
958  dup2(pager_fds[0], STDIN_FILENO);
959  close(pager_fds[0]); /* already redirected to stdin */
960  execvp(args[0], args);
961  free(pager);
962  perror("exec failed");
963  exit(EXIT_FAILURE);
964  }
965  return;
966 output:
967  /* pager is useless by now */
968  free(pager);
969  printf("TRAP module, libtrap version: %s %s\n", trap_version, trap_git_version);
970  puts("===========================================");
971  if (trap_help_spec == 0) {
972  printf("Name: %s\n", module_info->name);
973  if (module_info->num_ifc_in == -1) {
974  printf("Inputs: variable\n");
975  } else {
976  printf("Inputs: %u\n", (module_info->num_ifc_in));
977  }
978  if (module_info->num_ifc_out == -1) {
979  printf("Outputs: variable\n");
980  } else {
981  printf("Outputs: %u\n", module_info->num_ifc_out);
982  }
983  printf("Description:\n ");
984  print_aligned(module_info->description, 2, cols - 2);
985 
986 
987  /* print basic usage with module name */
988  char *module_name = get_module_name();
989  printf("\nUsage: %s [COMMON]... ", module_name);
990  free(module_name);
991 
992  if (module_info->params != NULL) {
993  i = 0;
994  while (module_info->params[i] != NULL) {
995  if (module_info->params[i]->short_opt == '-') {
996  adit_param = 1;
997  } else if ((module_info->params[i]->short_opt >= 'a' && module_info->params[i]->short_opt <= 'z')
998  || (module_info->params[i]->short_opt >= 'A' && module_info->params[i]->short_opt <= 'Z')) {
999  opt_param = 1;
1000  }
1001  i++;
1002  }
1003  }
1004 
1005  if (opt_param == 1) {
1006  printf("[OPTIONS]... ");
1007  }
1008  if (adit_param == 1) {
1009  printf("[ADDITIONAL]... ");
1010  }
1011  printf("\n");
1012 
1013  align_def = strlen("LIBTRAP_OUTPUT_FORMAT") + 4;
1014  align_opt = 0;
1015 
1016  if (opt_param == 1) {
1017  for (i = 0; module_info->params[i] != NULL; i++) {
1018  if (module_info->params[i]->argument_type == NULL) {
1019  continue;
1020  }
1021  if (HAVE_GETOPT_LONG && module_info->params[i]->long_opt != NULL) {
1022  tmp = strlen(module_info->params[i]->long_opt) + strlen(module_info->params[i]->argument_type);
1023  } else {
1024  tmp = strlen(module_info->params[i]->argument_type);
1025  }
1026  if (tmp > align_opt) {
1027  align_opt = tmp;
1028  }
1029  }
1030  /* add additional chars as a space: */
1031  align_opt += 14;
1032 
1033  if (align_opt > align_def) {
1034  align_def = align_opt;
1035  }
1036 
1037  printf("\nParameters of module [OPTIONS]:\n-------------------------------\n");
1038 
1039  i = 0;
1040  while (module_info->params[i] != NULL) {
1041  /* Position parameters (params without option, instead of "-o arg" it is only "arg") are specified with '-' in short-opt */
1042  if (module_info->params[i]->short_opt == '-') {
1043  i++;
1044  continue;
1045  } else if (HAVE_GETOPT_LONG) {
1046  if (isprint(module_info->params[i]->short_opt)) {
1047  written = printf(" -%c --%s ", module_info->params[i]->short_opt,
1048  module_info->params[i]->long_opt);
1049  } else {
1050  written = printf(" --%s ", module_info->params[i]->long_opt);
1051  }
1052  } else {
1053  written = printf(" -%c ", module_info->params[i]->short_opt);
1054  }
1055  switch (module_info->params[i]->param_required_argument) {
1056  case required_argument:
1057  written += printf("<%s>", module_info->params[i]->argument_type);
1058  break;
1059  case optional_argument:
1060  written += printf("[%s]", module_info->params[i]->argument_type);
1061  break;
1062  case no_argument:
1063  written += printf(" ");
1064  break;
1065  }
1066  if (written < align_def) {
1067  printf("%*s", align_def - written, " ");
1068  }
1069 
1070  print_aligned(module_info->params[i]->description, align_def, cols - align_def);
1071  /* empty line after param */
1072  puts("");
1073 
1074  i++;
1075  }
1076  }
1077 
1078  /* If the module has some position parameters, their section is printed */
1079  if (adit_param == 1) {
1080  printf("\nAdditional parameters of module [ADDITIONAL]:\n---------------------------------------------\n");
1081 
1082  i = 0;
1083  while (module_info->params[i] != NULL) {
1084  if (module_info->params[i]->short_opt == '-') {
1085  printf(" %s", module_info->params[i]->description);
1086  if (module_info->params[i]->param_required_argument == required_argument) {
1087  printf(" (data type: <%s>)", module_info->params[i]->argument_type);
1088  }
1089  printf("\n\n");
1090  }
1091  i++;
1092  }
1093  }
1094 
1095  printf("\nCommon TRAP parameters [COMMON]:\n--------------------------------\n");
1096 
1097 #define X(param, text, align, cut) do { \
1098  written = printf(param); \
1099  if (written < align_def) { \
1100  printf("%*s", align - written, " "); \
1101  } \
1102  print_aligned(text, align, cut); \
1103  puts(""); \
1104 } while (0)
1105 
1106  X(" -h [trap,1]",
1107  "If no argument, print this message. If \"trap\" or 1 is given, print "
1108  "TRAP help.",
1109  align_def, cols - align_def);
1110 
1111  X(" -i IFC_SPEC",
1112  "Specification of interface types and their parameters, "
1113  "see \"-h trap\" (mandatory parameter).",
1114  align_def, cols - align_def);
1115 
1116  X(" -v", "Be verbose.", align_def, cols - align_def);
1117  X(" -vv", "Be more verbose.", align_def, cols - align_def);
1118  X(" -vvv", "Be even more verbose.", align_def, cols - align_def);
1119 
1120  puts("\nEnvironment variables that affects output:\n------------------------------------------");
1121  X(" LIBTRAP_OUTPUT_FORMAT", "If set to \"json\", information about module is printed in JSON format.",
1122  align_def, cols - align_def);
1123  X(" PAGER", "Show the help output in the set PAGER.",
1124  align_def, cols - align_def);
1125  X(" TRAP_SOCKET_DIR", "Change path to socket directory (default: " DEFAULTSOCKETDIR ").",
1126  align_def, cols - align_def);
1127 
1128 #undef X
1129  } else if (trap_help_spec != 0) {
1131  }
1132 }
1133 
1134 /** Print help about interface specifier.
1135  * Prints help message about format of interface specifier and description of
1136  * all available interface types.
1137  */
1139 {
1140  extern const char *trap_help_ifcspec;
1141  uint32_t cols = get_terminal_width();
1142  if (cols == 0) {
1144  }
1145 
1147 }
1148 
1149 ////////////////////////////
1150 
1151 /**
1152  * \brief Splitter of *params* string.
1153  * Cut the first param, copy it into *dest* and returns pointer to the start of following
1154  * parameter.
1155  * \param[in] source source string, typically *params*
1156  * \param[out] dest destination string, target of first parameter copying
1157  * \param[in] delimiter separator of values in *params*
1158  * \return Pointer to the start of following parameter (char after delimiter). \note If NULL, no other parameter is present or error during allocation occured.
1159  */
1160 char *trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
1161 {
1162  char *param_end = NULL;
1163  unsigned int param_size = 0;
1164 
1165  if (source == NULL) {
1166  return NULL;
1167  }
1168 
1169  param_end = strchr(source, delimiter);
1170  if (param_end == NULL) {
1171  /* no delimiter found, copy the whole source */
1172  *dest = strdup(source);
1173  return NULL;
1174  }
1175 
1176  param_size = param_end - source;
1177  *dest = (char *) calloc(1, param_size + 1);
1178  if (*dest == NULL) {
1179  return (NULL);
1180  }
1181  strncpy(*dest, source, param_size);
1182  return param_end + 1;
1183 }
1184 
1185 inline char *get_param_by_delimiter(const char *source, char **dest, const char delimiter)
1186 {
1187  return trap_get_param_by_delimiter(source, dest, delimiter);
1188 }
1189 
1190 void trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk)
1191 {
1192  if (tmnblk == NULL) {
1193  /* we do not need tmnblk */
1194  return;
1195  }
1196  /* tmnblk is used for timed wait on semaphore, this needs absolute time... */
1197  if (clock_gettime(CLOCK_REALTIME, tmnblk) == -1) {
1198  /* handle error */
1199  tmnblk->tv_sec = 0;
1200  tmnblk->tv_nsec = 0;
1201  }
1202 
1203  if (tm->tv_usec != 0) {
1204  tmnblk->tv_nsec = (long) tm->tv_usec * 1000;
1205  } else {
1206  tmnblk->tv_nsec = 0;
1207  }
1208  tmnblk->tv_sec += (time_t) (tm->tv_sec + (tm->tv_usec / 1000000));
1209 }
1210 
1211 void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
1212 {
1213  if ((timeout == TRAP_NO_WAIT) || (timeout == TRAP_HALFWAIT)) {
1214  tm->tv_sec = 0;
1215  tm->tv_usec = 0;
1216  } else if (timeout > TRAP_HALFWAIT) {
1217  if (timeout == TRAP_WAIT) {
1218  tm->tv_sec = 0;
1219  tm->tv_usec = 0;
1220  } else {
1221  tm->tv_sec = timeout / 1000000;
1222  tm->tv_usec = timeout % 1000000;
1223  }
1224  } else {
1225  VERBOSE(CL_ERROR, "Setting timeout to %d failed", timeout);
1226  return;
1227  }
1228  trap_set_abs_timespec(tm, tmnblk);
1229 }
1230 
1231 int trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request, ... /* arg */)
1232 {
1233  va_list ap;
1234  int res;
1235  va_start(ap, request);
1236  res = trap_ctx_vifcctl(trap_glob_ctx, type, ifcidx, request, ap);
1237  va_end(ap);
1238  return res;
1239 }
1240 
1241 void trap_send_flush(uint32_t ifc)
1242 {
1244 }
1245 
1246 /**
1247  * \addtogroup contextapi Context API
1248  * @{
1249  */
1250 
1252 {
1253  trap_ctx_priv_t *ctx = calloc(1, sizeof(trap_ctx_priv_t));
1254  /* space for vars init with non-zero values */
1255  return ctx;
1256 }
1257 
1259 {
1260  int i;
1261  trap_ctx_priv_t *c;
1262 
1263  if (ctx == NULL) {
1264  return;
1265  }
1266  c = (*ctx);
1267  if (c == NULL) {
1268  return;
1269  }
1270 
1271  /* free allocated counters */
1272  free(c->counter_autoflush);
1273  c->counter_autoflush = NULL;
1274  free(c->counter_send_buffer);
1275  c->counter_send_buffer = NULL;
1276  free(c->counter_recv_message);
1277  c->counter_recv_message = NULL;
1278  free(c->counter_send_message);
1279  c->counter_send_message = NULL;
1280  free(c->counter_recv_buffer);
1281  c->counter_recv_buffer = NULL;
1282  free(c->counter_dropped_message);
1283  c->counter_dropped_message = NULL;
1284  free(c->counter_recv_delay_last);
1285  c->counter_recv_delay_last = NULL;
1286  free(c->counter_recv_delay_total);
1287  c->counter_recv_delay_total = NULL;
1288  free(c->recv_delay_timestamp);
1289  c->recv_delay_timestamp = NULL;
1290 
1291  pthread_mutex_destroy(&c->error_mtx);
1292 
1293  // Destroy all interfaces
1294  if ((c->num_ifc_in > 0) && (c->in_ifc_list != NULL)) {
1295  for (i = 0; i < c->num_ifc_in; i++) {
1296  if (c->in_ifc_list[i].buffer != NULL) {
1297  free(c->in_ifc_list[i].buffer);
1298  c->in_ifc_list[i].buffer = NULL;
1299  }
1300  if (c->in_ifc_list[i].data_fmt_spec != NULL) {
1301  free(c->in_ifc_list[i].data_fmt_spec);
1302  c->in_ifc_list[i].data_fmt_spec = NULL;
1303  }
1304  if (c->in_ifc_list[i].req_data_fmt_spec != NULL) {
1305  free(c->in_ifc_list[i].req_data_fmt_spec);
1306  c->in_ifc_list[i].req_data_fmt_spec = NULL;
1307  }
1308  if (c->in_ifc_list[i].destroy != NULL) {
1309  c->in_ifc_list[i].destroy(c->in_ifc_list[i].priv);
1310  }
1311  pthread_mutex_destroy(&c->in_ifc_list[i].ifc_mtx);
1312  }
1313  free(c->in_ifc_list);
1314  }
1315 
1316  if ((c->num_ifc_out > 0) && (c->out_ifc_list != NULL)) {
1317  for (i = 0; i < c->num_ifc_out; i++) {
1318  if (c->out_ifc_list[i].destroy != NULL) {
1319  c->out_ifc_list[i].destroy(c->out_ifc_list[i].priv);
1320  }
1321  if (c->out_ifc_list[i].data_fmt_spec != NULL) {
1322  free(c->out_ifc_list[i].data_fmt_spec);
1323  c->out_ifc_list[i].data_fmt_spec = NULL;
1324  }
1325  pthread_mutex_destroy(&c->out_ifc_list[i].ifc_mtx);
1326  }
1327  free(c->out_ifc_list);
1328  c->out_ifc_list = NULL;
1329  free(c->ifc_autoflush_timeout);
1330  c->ifc_autoflush_timeout = NULL;
1331  }
1332 
1333  if (c->service_ifc_name != NULL) {
1334  free(c->service_ifc_name);
1335  c->service_ifc_name = NULL;
1336  }
1337 
1338  free(c);
1339  (*ctx) = NULL;
1340 }
1341 
1343 {
1344  int i;
1345  trap_ctx_priv_t *c = (trap_ctx_priv_t *) ctx;
1346  if (c == NULL || c->terminated) {
1347  return TRAP_E_OK;
1348  }
1349 
1350  c->terminated = 1;
1351 
1352  for (i = 0; i < c->num_ifc_in; i++) {
1353  if (c->in_ifc_list[i].terminate != NULL) {
1354  c->in_ifc_list[i].terminate(c->in_ifc_list[i].priv);
1355  } else {
1356  return trap_errorf(c, TRAP_E_MEMORY, "IFC was not initialized.");
1357  }
1358  }
1359  for (i = 0; i < c->num_ifc_out; i++) {
1360  if (c->out_ifc_list[i].terminate != NULL) {
1361  c->out_ifc_list[i].terminate(c->out_ifc_list[i].priv);
1362  } else {
1363  return trap_errorf(c, TRAP_E_MEMORY, "IFC was not initialized.");
1364  }
1365  }
1366 
1367  return trap_error(ctx, TRAP_E_OK);
1368 }
1369 
1370 static inline uint64_t get_cur_timestamp()
1371 {
1372  struct timespec spec_time;
1373 
1374  clock_gettime(CLOCK_MONOTONIC, &spec_time);
1375  /* time in microseconds seconds -> secs * microsends + nanoseconds */
1376  return spec_time.tv_sec * 1000000 + (spec_time.tv_nsec / 1000);
1377 }
1378 
1379 int trap_ctx_recv(trap_ctx_t *ctx, uint32_t ifcidx, const void **data, uint16_t *size)
1380 {
1381  int ret_val = 0;
1382  trap_ctx_priv_t *c = (trap_ctx_priv_t *) ctx;
1383  if (c == NULL || c->initialized == 0) {
1384  return TRAP_E_NOT_INITIALIZED;
1385  }
1386 
1387  uint64_t delay = get_cur_timestamp() - c->recv_delay_timestamp[ifcidx];
1388  c->counter_recv_delay_last[ifcidx] = delay;
1389  c->counter_recv_delay_total[ifcidx] += delay;
1390 
1391  if (c->terminated) {
1392  return trap_error(c, TRAP_E_TERMINATED);
1393  }
1394 
1395  if (ifcidx >= c->num_ifc_in) {
1396  return trap_errorf(c, TRAP_E_NOT_SELECTED, "No input ifc to get data from...");
1397  }
1398 
1399  ret_val = trap_read_from_buffer(c, ifcidx, data, size, c->in_ifc_list[ifcidx].datatimeout);
1400 
1401  c->recv_delay_timestamp[ifcidx] = get_cur_timestamp();
1402  return trap_error(ctx, ret_val);
1403 }
1404 
1405 /** Cleanup function.
1406  * Disconnect all interfaces and do all necessary cleanup.
1407  * @return Error code
1408  */
1410 {
1411  int i;
1412  if ((ctx == NULL) || (*ctx == NULL)) {
1413  return TRAP_E_NOT_INITIALIZED;
1414  }
1415  trap_ctx_priv_t *c = *((trap_ctx_priv_t **)ctx);
1416  if (c == NULL) {
1417  return TRAP_E_NOT_INITIALIZED;
1418  }
1419  if (c->initialized == 0) {
1420  free(c);
1421  (*ctx) = NULL;
1422  return TRAP_E_NOT_INITIALIZED;
1423  }
1424 
1425  /* force flush of buffer for every output ifc */
1426  for (i = 0; i < c->num_ifc_out; i++) {
1429  trap_ctx_send_flush((trap_ctx_t *) c, i);
1430  }
1431 
1432  /* check if libtrap is terminated and terminate if not */
1433  if (c->terminated == 0) {
1434  trap_ctx_terminate(c);
1435  }
1436 
1437  if (c->service_thread_initialized == 1) {
1438  pthread_join(c->service_thread, NULL);
1439  }
1440  trap_free_ctx_t(&c);
1441  (*ctx) = NULL;
1442 
1444 
1445  return TRAP_E_OK;
1446 }
1447 
1448 int trap_ctx_send(trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
1449 {
1450  int ret_val = TRAP_E_OK;
1451  trap_ctx_priv_t *c = (trap_ctx_priv_t *) ctx;
1452  if (c == NULL || c->initialized == 0) {
1453  return TRAP_E_NOT_INITIALIZED;
1454  }
1455  trap_output_ifc_t* ifc_ptr = &c->out_ifc_list[ifc];
1456 
1457  if (c->terminated) {
1458  return trap_error(c, TRAP_E_TERMINATED);
1459  }
1460 
1461  if (ifc >= c->num_ifc_out) {
1462  return trap_error(c, TRAP_E_BAD_IFC_INDEX);
1463  }
1464 
1465  ret_val = ifc_ptr->send(ifc_ptr->priv, data, size, ifc_ptr->datatimeout);
1466 
1467  if (ret_val == TRAP_E_OK) {
1468  __sync_add_and_fetch(&c->counter_send_message[ifc], 1);
1469  } else {
1470  __sync_add_and_fetch(&c->counter_dropped_message[ifc], 1);
1471  }
1472  return trap_error(ctx, ret_val);
1473 }
1474 
1475 /**
1476  * Remove setter starting from params string.
1477  *
1478  * \param[in,out] params String with parameters of IFC.
1479  * \param[in] setter Pointer to the start of setter that should be removed.
1480  * It ends by TRAP_IFC_PARAM_DELIMITER or zero-byte in the string.
1481  */
1482 static inline void remove_setter_from_param(char *params, char *setter)
1483 {
1484  char *strval = strchr(setter, TRAP_IFC_PARAM_DELIMITER);
1485  if (strval == NULL) {
1486  if (params < setter) {
1487  *(setter - 1) = 0;
1488  } else {
1489  *setter = 0;
1490  }
1491  } else {
1492  for (strval++; *strval != 0; setter++, strval++) {
1493  *setter = *strval;
1494  }
1495  *setter = 0;
1496  }
1497 }
1498 
1499 /**
1500  * Find setters in IFC parameters and set values if needed.
1501  *
1502  * \param[in,out] ifc Pointer to IFC structure from the array in context.
1503  * \param[in,out] params String passed as argument of -i, found setters are
1504  * removed after their processing.
1505  */
1506 static inline void handle_inifc_setters(trap_input_ifc_t *ifc, char *params)
1507 {
1508  char *strval, *p;
1509 
1510  /* look for timeout setter and set the datatimeout if found */
1511  p = strstr(params, "timeout=");
1512  if (p != NULL) {
1513 
1514 #define X(val) do { \
1515  ifc->datatimeout = val; \
1516  ifc->datatimeout_fixed = 1; \
1517 } while (0)
1518  strval = p + sizeof("timeout=") - 1;
1519  if (strncmp(strval, "WAIT", 4) == 0) {
1520  X(TRAP_WAIT);
1521  } else if (strncmp(strval, "NO_WAIT", 7) == 0) {
1522  X(TRAP_NO_WAIT);
1523  } else {
1524  if (sscanf(strval, "%"SCNi32, &ifc->datatimeout) == 1) {
1525  ifc->datatimeout_fixed = 1;
1526  }
1527  }
1528 #undef X
1529  /* clean the parameter because it was processed */
1530  remove_setter_from_param(params, p);
1531  }
1532 }
1533 
1534 /**
1535  * Switch of supported IFC types, place to call input IFC constructor.
1536  *
1537  * \param[in,out] ctx pointer to context
1538  * \param[in] ifc_spec IFC specifiers
1539  * \param[in] idx index into IFC array
1540  * \return EXIT_SUCCESS on success, EXIT_FAILURE on error.
1541  */
1542 static inline int trapifc_in_construct(trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
1543 {
1544  int ret = TRAP_E_OK;
1545  /* Common setters - this should be done before the constructor */
1546  handle_inifc_setters(&ctx->in_ifc_list[idx], ifc_spec->params[idx]);
1547 
1548  switch (ifc_spec->types[idx]) {
1550  /* if (create_generator_ifc("\x10||==::test::==||", &ctx->in_ifc_list[idx]) != TRAP_E_OK) */
1551  if ((ret = create_generator_ifc(ctx, ifc_spec->params[idx], &ctx->in_ifc_list[idx])) != TRAP_E_OK) {
1552  VERBOSE(CL_ERROR, "Initialization of GENERATOR input interface no. %i failed.", idx);
1553  goto error;
1554  }
1555  break;
1556  case TRAP_IFC_TYPE_TCPIP:
1557  if ((ret = create_tcpip_receiver_ifc(ctx, ifc_spec->params[idx], &ctx->in_ifc_list[idx], idx, TRAP_IFC_TCPIP)) != TRAP_E_OK) {
1558  VERBOSE(CL_ERROR, "Initialization of TCPIP input interface no. %i failed.", idx);
1559  goto error;
1560  }
1561  break;
1562 #if HAVE_OPENSSL
1563  case TRAP_IFC_TYPE_TLS:
1564  if ((ret = create_tls_receiver_ifc(ctx, ifc_spec->params[idx], &ctx->in_ifc_list[idx], idx)) != TRAP_E_OK) {
1565  VERBOSE(CL_ERROR, "Initialization of TLS input interface no. %i failed.", idx);
1566  goto error;
1567  }
1568  break;
1569 #endif
1570  case TRAP_IFC_TYPE_UNIX:
1571  if ((ret = create_tcpip_receiver_ifc(ctx, ifc_spec->params[idx], &ctx->in_ifc_list[idx], idx, TRAP_IFC_TCPIP_UNIX)) != TRAP_E_OK) {
1572  VERBOSE(CL_ERROR, "Initialization of UNIX input interface no. %i failed.", idx);
1573  goto error;
1574  }
1575  break;
1576  case TRAP_IFC_TYPE_FILE:
1577  if ((ret = create_file_recv_ifc(ctx, ifc_spec->params[idx], &ctx->in_ifc_list[idx], idx)) != TRAP_E_OK) {
1578  VERBOSE(CL_ERROR, "Initialization of FILE input interface no. %i failed.", idx);
1579  goto error;
1580  }
1581  break;
1582  default:
1583  VERBOSE(CL_ERROR, "Unknown input interface type '%c'.", ifc_spec->types[idx]);
1584  ret = TRAP_E_BADPARAMS;
1585  goto error;
1586  }
1587  return EXIT_SUCCESS;
1588 error:
1589  trap_error(ctx, ret);
1590  return EXIT_FAILURE;
1591 }
1592 
1593 /**
1594  * Find setters in IFC parameters and set values if needed.
1595  *
1596  * \param[in,out] ifc Pointer to IFC structure from the array in context.
1597  * \param[in,out] params String passed as argument of -i, found setters are
1598  * removed after their processing.
1599  */
1600 static inline void handle_outifc_setters(trap_output_ifc_t *ifc, char *params)
1601 {
1602  char *strval, *p;
1603 
1604  /* look for timeout setter and set the datatimeout if found */
1605  p = strstr(params, "timeout=");
1606  if (p != NULL) {
1607 
1608 #define X(val) do { \
1609  ifc->datatimeout = val; \
1610  ifc->datatimeout_fixed = 1; \
1611 } while (0)
1612  strval = p + sizeof("timeout=") - 1;
1613  if (strncmp(strval, "WAIT", 4) == 0) {
1614  X(TRAP_WAIT);
1615  } else if (strncmp(strval, "NO_WAIT", 7) == 0) {
1616  X(TRAP_NO_WAIT);
1617  } else if (strncmp(strval, "HALF_WAIT", 9) == 0) {
1618  X(TRAP_HALFWAIT);
1619  } else {
1620  if (sscanf(strval, "%"SCNi32, &ifc->datatimeout) == 1) {
1621  ifc->datatimeout_fixed = 1;
1622  }
1623  }
1624 #undef X
1625  /* clean the parameter because it was processed */
1626  remove_setter_from_param(params, p);
1627  }
1628 
1629  /* look for bufferswitch setter and set it if found */
1630  p = strstr(params, "buffer=");
1631  if (p != NULL) {
1632 
1633 #define X(val) do { \
1634  ifc->bufferswitch = val; \
1635  ifc->bufferswitch_fixed = 1; \
1636 } while (0)
1637  char *strval = p + sizeof("buffer=") - 1;
1638  if (strncmp(strval, "on", 2) == 0) {
1639  X(1);
1640  } else if (strncmp(strval, "off", 3) == 0) {
1641  X(0);
1642  } else {
1643  VERBOSE(CL_ERROR, "Unknown value for setter \"buffer\".");
1644  }
1645 #undef X
1646  /* clean the parameter because it was processed */
1647  remove_setter_from_param(params, p);
1648  }
1649 
1650  /* look for autoflush setter and set the it if found */
1651  p = strstr(params, "autoflush=");
1652  if (p != NULL) {
1653  strval = p + sizeof("autoflush=") - 1;
1654  if (strncmp(strval, "off", 3) == 0) {
1655  ifc->timeout = TRAP_NO_AUTO_FLUSH;
1656  ifc->timeout_fixed = 1;
1657  } else {
1658  if (sscanf(strval, "%"SCNi64, &ifc->timeout) == 1) {
1659  ifc->timeout_fixed = 1;
1660  }
1661  }
1662  /* clean the parameter because it was processed */
1663  remove_setter_from_param(params, p);
1664  }
1665 }
1666 
1667 /**
1668  * Switch of supported IFC types, place to call output IFC constructor.
1669  *
1670  * \param[in,out] ctx pointer to context
1671  * \param[in] ifc_spec IFC specifiers
1672  * \param[in] idx index into IFC array
1673  * \return EXIT_SUCCESS on success, EXIT_FAILURE on error.
1674  */
1675 static inline int trapifc_out_construct(trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
1676 {
1677  int ret = TRAP_E_OK;
1678  /* Common setters - this should be done before the constructor */
1680  ifc_spec->params[ctx->num_ifc_in + idx]);
1681 
1682  /* call correct constructor of interface */
1683  switch (ifc_spec->types[ctx->num_ifc_in + idx]) {
1685  if ((ret = create_blackhole_ifc(ctx, NULL, &ctx->out_ifc_list[idx])) != TRAP_E_OK) {
1686  VERBOSE(CL_ERROR, "Initialization of BLACKHOLE output interface no. %i failed.", idx);
1687  goto error;
1688  }
1689  break;
1690  case TRAP_IFC_TYPE_TCPIP:
1691  if ((ret = create_tcpip_sender_ifc(ctx, ifc_spec->params[ctx->num_ifc_in + idx],
1692  &ctx->out_ifc_list[idx], idx, TRAP_IFC_TCPIP)) != TRAP_E_OK) {
1693  VERBOSE(CL_ERROR, "Initialization of TCPIP output interface no. %i failed.", idx);
1694  goto error;
1695  }
1696  break;
1697 #if HAVE_OPENSSL
1698  case TRAP_IFC_TYPE_TLS:
1699  if ((ret = create_tls_sender_ifc(ctx, ifc_spec->params[ctx->num_ifc_in + idx], &ctx->out_ifc_list[idx], idx)) != TRAP_E_OK) {
1700  VERBOSE(CL_ERROR, "Initialization of TLS output interface no. %i failed.", idx);
1702  goto error;
1703  }
1704  break;
1705 #endif
1706  case TRAP_IFC_TYPE_UNIX:
1707  if ((ret = create_tcpip_sender_ifc(ctx, ifc_spec->params[ctx->num_ifc_in + idx],
1708  &ctx->out_ifc_list[idx], idx, TRAP_IFC_TCPIP_UNIX)) != TRAP_E_OK) {
1709  VERBOSE(CL_ERROR, "Initialization of UNIX output interface no. %i failed.", idx);
1710  goto error;
1711  }
1712  break;
1713  case TRAP_IFC_TYPE_FILE:
1714  if ((ret = create_file_send_ifc(ctx, ifc_spec->params[ctx->num_ifc_in + idx], &ctx->out_ifc_list[idx], idx)) != TRAP_E_OK) {
1715  VERBOSE(CL_ERROR, "Initialization of FILE output interface no. %i failed.", idx);
1716  goto error;
1717  }
1718  break;
1719  default:
1720  VERBOSE(CL_ERROR, "Unknown output interface type '%c'.", ifc_spec->types[ctx->num_ifc_in + idx]);
1721  ret = TRAP_E_BADPARAMS;
1722  goto error;
1723  }
1724 
1725  return EXIT_SUCCESS;
1726 error:
1727  trap_error(ctx, ret);
1728  return EXIT_FAILURE;
1729 }
1730 
1731 trap_ctx_t *trap_ctx_init3(const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifc_name)
1732 {
1733  trap_ctx_t *res = NULL;
1734  trap_module_info_t module_info;
1735  trap_ifc_spec_t ifcs;
1736  int argc = 2;
1737 
1738  char *argv[2] = {"-i", (char *) ifc_spec};
1739 
1740  /* Prepare module info */
1741  if (name != NULL) {
1742  module_info.name = strdup(name);
1743  } else {
1744  module_info.name = strdup("nemea-module");
1745  }
1746  if (description != NULL) {
1747  module_info.description = strdup(description);
1748  } else {
1749  module_info.description = strdup("");
1750  }
1751  module_info.num_ifc_in = i_ifcs;
1752  module_info.num_ifc_out = o_ifcs;
1753 
1754  if (module_info.name == NULL || module_info.description == NULL) {
1755  VERBOSE(CL_ERROR, "Not enough memory.");
1756  if (module_info.name != NULL) {
1757  free(module_info.name);
1758  }
1759  if (module_info.description != NULL) {
1760  free(module_info.description);
1761  }
1762 
1763  return NULL;
1764  }
1765 
1766  /* Prepare ifcs (trap_ifc_spec_t) */
1767  int rv = trap_parse_params(&argc, argv, &ifcs);
1768  if (rv != TRAP_E_OK) {
1769  fprintf(stderr, "ERROR in parsing of parameters for TRAP: %s\n", trap_last_error_msg);
1770  return NULL;
1771  }
1772 
1773  res = trap_ctx_init2(&module_info, ifcs, service_ifc_name);
1774 
1775  free(module_info.name);
1776  free(module_info.description);
1777  trap_free_ifc_spec(ifcs);
1778 
1779  return res;
1780 }
1781 
1782 /**
1783  *
1784  * \return context, NULL when allocation failed.
1785  */
1786 trap_ctx_t *trap_ctx_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
1787 {
1788  // service_sock_spec size is length of "service_PID" where PID is max 10 chars (8 + 10 + 1 zero terminating)
1789  char service_sock_spec[19];
1790  trap_ctx_t *res = NULL;
1791 
1792  if (snprintf(service_sock_spec, 19, "service_%d", getpid()) < 1) {
1793  VERBOSE(CL_ERROR, "Could not create service socket specifier in service routine.");
1794  return NULL;
1795  }
1796 
1797  res = trap_ctx_init2(module_info, ifc_spec, service_sock_spec);
1798 
1799  return res;
1800 }
1801 
1802 trap_ctx_t *trap_ctx_init2(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifc_name)
1803 {
1804  int i;
1805  if ((ifc_spec.types == NULL) || (ifc_spec.params == NULL)) {
1806  return NULL;
1807  }
1809  if (ctx == NULL) {
1810  return NULL;
1811  }
1812  /* count number of interfaces */
1813  if (module_info->num_ifc_in < 0 && module_info->num_ifc_out < 0) {
1814  trap_free_ctx_t(&ctx);
1815  return NULL;
1816  } else if (module_info->num_ifc_in < 0) {
1817  module_info->num_ifc_in = strlen(ifc_spec.types) - module_info->num_ifc_out;
1818  } else if (module_info->num_ifc_out < 0) {
1819  module_info->num_ifc_out = strlen(ifc_spec.types) - module_info->num_ifc_in;
1820  }
1821 
1823  if (pthread_mutex_init(&ctx->error_mtx, NULL) != 0) {
1824  free(ctx);
1825  return NULL;
1826  }
1827 
1828  trap_error(ctx, TRAP_E_OK); // set "no error"
1829 
1830  // Check whether parameters matches module's numbers of interfaces
1831  ctx->num_ifc_in = module_info->num_ifc_in;
1832  ctx->num_ifc_out = module_info->num_ifc_out;
1833 
1834  int strlen_ifc_types = strlen(ifc_spec.types);
1835 
1836  if (strlen_ifc_types != (ctx->num_ifc_in + ctx->num_ifc_out)) {
1837  trap_errorf(ctx, TRAP_E_BADPARAMS, "Bad number of IFCs in IFC_SPEC.");
1838  VERBOSE(CL_ERROR, "Got %d IFCs via -i, expected %d input and %d output IFCs.",
1839  strlen_ifc_types, ctx->num_ifc_in, ctx->num_ifc_out);
1840  return ctx;
1841  }
1842 
1843  ctx->counter_send_message = (uint64_t *) calloc(ctx->num_ifc_out, sizeof(uint64_t));
1844  ctx->counter_recv_message = (uint64_t *) calloc(ctx->num_ifc_in, sizeof(uint64_t));
1845  ctx->counter_send_buffer = (uint64_t *) calloc(ctx->num_ifc_out, sizeof(uint64_t));
1846  ctx->counter_autoflush = (uint64_t *) calloc(ctx->num_ifc_out, sizeof(uint64_t));
1847  ctx->counter_recv_buffer = (uint64_t *) calloc(ctx->num_ifc_in, sizeof(uint64_t));
1848  ctx->counter_dropped_message = (uint64_t *) calloc(ctx->num_ifc_out, sizeof(uint64_t));
1849  ctx->counter_recv_delay_last = (uint64_t *) calloc(ctx->num_ifc_in, sizeof(uint64_t));
1850  ctx->counter_recv_delay_total = (uint64_t *) calloc(ctx->num_ifc_in, sizeof(uint64_t));
1851  ctx->recv_delay_timestamp = (uint64_t *) calloc(ctx->num_ifc_in, sizeof(uint64_t));
1852 
1853  ctx->terminated = 0;
1854 
1855  // Create input interfaces
1856  if (ctx->num_ifc_in > 0) {
1857  ctx->in_ifc_list = (trap_input_ifc_t *) calloc(ctx->num_ifc_in, sizeof(trap_input_ifc_t));
1858  if (!ctx->in_ifc_list) {
1859  trap_error(ctx, TRAP_E_MEMORY);
1860  goto alloc_counter_failed;
1861  }
1862 
1863  /* set default value of datatimeout */
1864  for (i=0; i<ctx->num_ifc_in; ++i) {
1865  ctx->in_ifc_list[i].datatimeout = TRAP_WAIT;
1867 
1869  ctx->in_ifc_list[i].data_fmt_spec = NULL;
1871  ctx->in_ifc_list[i].req_data_fmt_spec = NULL;
1872 
1873  /* allocate extra bytes for TCPIP IFC checksum */
1874  ctx->in_ifc_list[i].buffer = (void *) calloc(1, TRAP_IFC_MESSAGEQ_SIZE + 1);
1875  if (ctx->in_ifc_list[i].buffer == NULL) {
1876  trap_errorf(ctx, TRAP_E_MEMORY, "Not enough memory for input ifc buffer.");
1877  goto freein_on_failed;
1878  }
1879  ctx->in_ifc_list[i].buffer_unread_bytes = 0;
1880  ctx->in_ifc_list[i].buffer_pointer = ctx->in_ifc_list[i].buffer;
1881  ctx->in_ifc_list[i].ifc_type = ifc_spec.types[i];
1883 
1884  /* call input IFC constructor */
1885  if (trapifc_in_construct(ctx, &ifc_spec, i) == EXIT_FAILURE) {
1886  goto freein_on_failed;
1887  }
1888  }
1889 
1890  }
1891 
1892  // Create output interfaces
1893  if (ctx->num_ifc_out > 0) {
1894  ctx->out_ifc_list = (trap_output_ifc_t *) calloc(ctx->num_ifc_out, sizeof(trap_output_ifc_t));
1895  if (ctx->out_ifc_list == NULL) {
1896  trap_error(ctx, TRAP_E_MEMORY);
1897  goto freeall_on_failed;
1898  }
1899  /* set default value of datatimeout */
1900  for (i=0; i<ctx->num_ifc_out; ++i) {
1902  }
1903  }
1904 
1905  for (i = 0; i < ctx->num_ifc_out; i++) {
1907  ctx->out_ifc_list[i].data_fmt_spec = NULL;
1908 
1909  if (pthread_mutex_init(&ctx->out_ifc_list[i].ifc_mtx, NULL) != 0) {
1910  goto freein_on_failed;
1911  }
1913  ctx->out_ifc_list[i].bufferswitch = 1;
1914  ctx->out_ifc_list[i].ifc_type = ifc_spec.types[ctx->num_ifc_in + i];
1915 
1916  /* call output IFC constructor */
1917  if (trapifc_out_construct(ctx, &ifc_spec, i) == EXIT_FAILURE) {
1918  goto freeall_on_failed;
1919  }
1920 
1921  }
1922 
1923  /*
1924  * Set the name of service IFC, which is passed in context to service thread.
1925  * Service thread creates service IFC (UNIX IFC) with the given name and handles client
1926  * requests in the loop.
1927  */
1928  if (service_ifc_name != NULL) {
1929  ctx->service_ifc_name = strdup(service_ifc_name);
1930  } else {
1931  ctx->service_ifc_name = NULL;
1932  }
1933 
1934  if (pthread_create(&ctx->service_thread, NULL, service_thread_routine, (void *) ctx) == 0) {
1935  ctx->service_thread_initialized = 1;
1936  } else {
1937  ctx->service_thread_initialized = 0;
1938  VERBOSE(CL_VERBOSE_LIBRARY, "pthread_create() error: could not create service thread.");
1939  }
1940 
1941  ctx->initialized = 1;
1942  return ctx;
1943 
1944 freeall_on_failed:
1945  if (ctx->out_ifc_list != NULL) {
1946  for (i=0; i<ctx->num_ifc_out; ++i) {
1947  pthread_mutex_destroy(&ctx->out_ifc_list[i].ifc_mtx);
1948  if (ctx->out_ifc_list[i].destroy != NULL && ctx->out_ifc_list[i].priv != NULL) {
1949  ctx->out_ifc_list[i].destroy(ctx->out_ifc_list[i].priv);
1950  }
1951  }
1952 
1953  free(ctx->out_ifc_list);
1954  ctx->out_ifc_list = NULL;
1955  }
1956 freein_on_failed:
1957  if (ctx->in_ifc_list != NULL) {
1958  for (i=0; i<ctx->num_ifc_in; ++i) {
1959  pthread_mutex_destroy(&ctx->in_ifc_list[i].ifc_mtx);
1960  if (ctx->in_ifc_list[i].destroy != NULL && ctx->in_ifc_list[i].priv != NULL) {
1961  ctx->in_ifc_list[i].destroy(ctx->in_ifc_list[i].priv);
1962  }
1963 
1964  if (ctx->in_ifc_list[i].buffer != NULL) {
1965  free(ctx->in_ifc_list[i].buffer);
1966  ctx->in_ifc_list[i].buffer = NULL;
1967  }
1968  }
1969  }
1970  ctx->terminated = 1;
1971 
1972  if (ctx->in_ifc_list) {
1973  free(ctx->in_ifc_list);
1974  ctx->in_ifc_list = NULL;
1975  }
1976 alloc_counter_failed:
1977  if (ctx->counter_send_message) {
1978  free(ctx->counter_send_message);
1979  ctx->counter_send_message = NULL;
1980  }
1981  if (ctx->counter_recv_message) {
1982  free(ctx->counter_recv_message);
1983  ctx->counter_recv_message = NULL;
1984  }
1985  if (ctx->counter_send_buffer) {
1986  free(ctx->counter_send_buffer);
1987  ctx->counter_send_buffer = NULL;
1988  }
1989  if (ctx->counter_autoflush) {
1990  free(ctx->counter_autoflush);
1991  ctx->counter_autoflush = NULL;
1992  }
1993  if (ctx->counter_recv_buffer) {
1994  free(ctx->counter_recv_buffer);
1995  ctx->counter_recv_buffer = NULL;
1996  }
1997  if (ctx->counter_dropped_message) {
1998  free(ctx->counter_dropped_message);
1999  ctx->counter_dropped_message = NULL;
2000  }
2001  if (ctx->counter_recv_delay_last) {
2002  free(ctx->counter_recv_delay_last);
2003  ctx->counter_recv_delay_last = NULL;
2004  }
2005  if (ctx->counter_recv_delay_total) {
2006  free(ctx->counter_recv_delay_total);
2007  ctx->counter_recv_delay_total = NULL;
2008  }
2009  if (ctx->recv_delay_timestamp) {
2010  free(ctx->recv_delay_timestamp);
2011  ctx->recv_delay_timestamp = NULL;
2012  }
2013 
2015 
2016  return ctx;
2017 }
2018 
2019 int trap_ctx_ifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, ... /* arg */)
2020 {
2021  va_list ap;
2022  int res;
2023  if (ctx == NULL) {
2024  return TRAP_E_NOT_INITIALIZED;
2025  }
2026  va_start(ap, request);
2027  res = trap_ctx_vifcctl(ctx, type, ifcidx, request, ap);
2028  va_end(ap);
2029  return trap_error(ctx, res);
2030 }
2031 
2032 int trap_ctx_vifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
2033 {
2034  char en_dis_switch = 0;
2035  uint64_t timeout = 0;
2036  int32_t datatimeout;
2037  trap_ctx_priv_t *c = ctx;
2038 
2039  if ((ifcidx >= c->num_ifc_out) && (ifcidx >= c->num_ifc_in)) {
2040  /* error - wrong interface index, because it should be less than number of input or output interfaces */
2041  VERBOSE(CL_ERROR, "Index of non-existing interface.");
2042  return trap_error(ctx, TRAP_E_BADPARAMS);
2043  }
2044 
2045  if (c->terminated) {
2046  return trap_error(ctx, TRAP_E_TERMINATED);
2047  }
2048 
2049  switch (request) {
2051  timeout = va_arg(ap, uint64_t);
2052  VERBOSE(CL_VERBOSE_BASIC, "%s ifc %d: Setting autoflush timeout to %lu.",
2053  ifcdir2str(type), (int)ifcidx, timeout);
2054  if (type == TRAPIFC_OUTPUT) {
2055  if (c->out_ifc_list[ifcidx].timeout_fixed == 0) {
2056  __sync_bool_compare_and_swap(&c->out_ifc_list[ifcidx].timeout, c->out_ifc_list[ifcidx].timeout, timeout);
2057  __sync_fetch_and_add(&c->ifc_change, 1);
2058  }
2059  }
2060  break;
2061  case TRAPCTL_BUFFERSWITCH:
2062  en_dis_switch = (char) va_arg(ap, int);
2063  VERBOSE(CL_VERBOSE_BASIC, "%s ifc %d: Set buffer switch to %s.",
2064  ifcdir2str(type), (int)ifcidx, ((int) en_dis_switch ? "ON" : "OFF"));
2065  if (type == TRAPIFC_OUTPUT) {
2066  if (c->out_ifc_list[ifcidx].bufferswitch_fixed == 0) {
2067  __sync_bool_compare_and_swap(&c->out_ifc_list[ifcidx].bufferswitch, c->out_ifc_list[ifcidx].bufferswitch, en_dis_switch);
2068  __sync_fetch_and_add(&c->ifc_change, 1);
2069  }
2070  }
2071  break;
2072  case TRAPCTL_SETTIMEOUT:
2073  datatimeout = (int32_t) va_arg(ap, int32_t);
2074  VERBOSE(CL_VERBOSE_BASIC, "%s ifc %d: Setting timeout to %d.",
2075  ifcdir2str(type), (int)ifcidx, datatimeout);
2076  if (type == TRAPIFC_OUTPUT) {
2077  if (ifcidx < c->num_ifc_out) {
2078  if (c->out_ifc_list[ifcidx].datatimeout_fixed == 0) {
2079  __sync_bool_compare_and_swap(&c->out_ifc_list[ifcidx].datatimeout, c->out_ifc_list[ifcidx].datatimeout, datatimeout);
2080  }
2081  } else {
2082  VERBOSE(CL_ERROR, "There is no output IFC with this index. Bad index passed.");
2083  }
2084  } else if (type == TRAPIFC_INPUT) {
2085  if (ifcidx < c->num_ifc_in) {
2086  if (c->in_ifc_list[ifcidx].datatimeout_fixed == 0) {
2087  __sync_bool_compare_and_swap(&c->in_ifc_list[ifcidx].datatimeout, c->in_ifc_list[ifcidx].datatimeout, datatimeout);
2088  }
2089  } else {
2090  VERBOSE(CL_ERROR, "There is no input IFC with this index. Bad index passed.");
2091  }
2092  }
2093  break;
2094 
2095  default:
2096  VERBOSE(CL_ERROR, "Unknown type of request.");
2097  }
2098 
2099  return trap_error(ctx, TRAP_E_OK);;
2100 }
2101 
2103 {
2104  trap_ctx_priv_t *c = ctx;
2105  return c->trap_last_error;
2106 }
2107 
2109 {
2110  /* TODO: this is dangerous... the value in buffer can be changing constantly. */
2111  trap_ctx_priv_t *c = ctx;
2112  return c->trap_last_error_msg;
2113 }
2114 
2115 void trap_ctx_send_flush(trap_ctx_t *ctx, uint32_t ifc)
2116 {
2117  trap_ctx_priv_t *c = ctx;
2118 
2119  if (c == NULL || c->initialized == 0) {
2120  return;
2121  }
2122 
2123  c->out_ifc_list[ifc].flush(c->out_ifc_list[ifc].priv);
2124 }
2125 
2126 /**
2127  * @}
2128  */
2129 
2130 /**
2131  * \addtogroup supervisor Supervisor monitoring feature
2132  * @{
2133  */
2134 
2135 /* Structure used as a header sent before data in json format in service interface */
2136 typedef struct msg_header_s {
2137  uint8_t com;
2138  uint32_t data_size;
2139 } msg_header_t;
2140 
2141 int service_get_data(int sock_d, uint32_t size, void **data)
2142 {
2143  int num_of_timeouts = 0;
2144  int total_receved = 0;
2145  int last_receved = 0;
2146 
2147  while (total_receved < size) {
2148  last_receved = recv(sock_d, (*data) + total_receved, size - total_receved, MSG_DONTWAIT);
2149  if (last_receved == 0) {
2150  return -1;
2151  } else if (last_receved == -1) {
2152  if (errno == EAGAIN || errno == EWOULDBLOCK) {
2153  num_of_timeouts++;
2154  if (num_of_timeouts >= 3) {
2155  return -1;
2156  } else {
2157  usleep(25000);
2158  continue;
2159  }
2160  }
2161  return -1;
2162  }
2163  total_receved += last_receved;
2164  }
2165  return TRAP_E_OK;
2166 }
2167 
2168 int service_send_data(int sock_d, uint32_t size, void **data)
2169 {
2170  int num_of_timeouts = 0, total_sent = 0, last_sent = 0;
2171 
2172  while (total_sent < size) {
2173  last_sent = send(sock_d, (*data) + total_sent, size - total_sent, MSG_DONTWAIT);
2174  if (last_sent == -1) {
2175  if (errno == EAGAIN || errno == EWOULDBLOCK) {
2176  num_of_timeouts++;
2177  if (num_of_timeouts >= 3) {
2178  return -1;
2179  } else {
2180  usleep(25000);
2181  continue;
2182  }
2183  }
2184  return -1;
2185  }
2186  total_sent += last_sent;
2187  }
2188  return TRAP_E_OK;
2189 }
2190 
2191 
2193 {
2194  uint32_t x = 0;
2195  char *ifc_id = NULL;
2196  char none_ifc_id[] = "none";
2197 
2198  json_t *in_ifc_cnts = NULL;
2199  json_t *out_ifc_cnts = NULL;
2200  json_t *client_stats_arr;
2201 
2202  uint32_t in_cnt = (ctx->num_ifc_in > 0) ? ctx->num_ifc_in : 0;
2203  uint32_t out_cnt = (ctx->num_ifc_out > 0) ? ctx->num_ifc_out : 0;
2204 
2205  json_t *in_ifces_arr = json_array();
2206  if (in_ifces_arr == NULL) {
2207  VERBOSE(CL_ERROR, "Service thread - could not create json array while creating json string with counters.");
2208  goto clean_up;
2209  }
2210  json_t *out_ifces_arr = json_array();
2211  if (out_ifces_arr == NULL) {
2212  VERBOSE(CL_ERROR, "Service thread - could not create json array while creating json string with counters.");
2213  goto clean_up;
2214  }
2215 
2216  json_t *result_json = NULL;
2217 
2218  for (x = 0; x < in_cnt; x++) {
2219  ifc_id = ctx->in_ifc_list[x].get_id(ctx->in_ifc_list[x].priv);
2220  if (ifc_id == NULL) {
2221  ifc_id = none_ifc_id;
2222  }
2223  in_ifc_cnts = json_pack("{sisssisIsIsIsI}",
2224  "ifc_state", ctx->in_ifc_list[x].is_conn(ctx->in_ifc_list[x].priv),
2225  "ifc_id", ifc_id, "ifc_type", (int) (ctx->in_ifc_list[x].ifc_type),
2226  "messages", __sync_fetch_and_add(&ctx->counter_recv_message[x], 0),
2227  "buffers", __sync_fetch_and_add(&ctx->counter_recv_buffer[x], 0),
2228  "delay_last", __sync_fetch_and_add(&ctx->counter_recv_delay_last[x], 0),
2229  "delay_total", (long)(__sync_fetch_and_add(&ctx->counter_recv_delay_total[x], 0)) / 1000000); // round to whole seconds
2230  if (json_array_append_new(in_ifces_arr, in_ifc_cnts) == -1) {
2231  VERBOSE(CL_ERROR, "Service thread - could not append new item to out_ifces_arr while creating json string with counters..\n");
2232  goto clean_up;
2233  }
2234  }
2235 
2236  for (x = 0; x < out_cnt; x++) {
2237  ifc_id = ctx->out_ifc_list[x].get_id(ctx->out_ifc_list[x].priv);
2238  if (ifc_id == NULL) {
2239  ifc_id = none_ifc_id;
2240  }
2241 
2242  client_stats_arr = json_array();
2243  if (client_stats_arr == NULL) {
2244  VERBOSE(CL_ERROR, "Service thread - could not create json array with client statistics\n");
2245  goto clean_up;
2246  }
2247 
2248  if (ctx->out_ifc_list[x].get_client_stats_json(ctx->out_ifc_list[x].priv, client_stats_arr) == 0) {
2249  VERBOSE(CL_ERROR, "Service thread - could not create json array with client statistics\n");
2250  goto clean_up;
2251  }
2252 
2253  out_ifc_cnts = json_pack("{sosisssisIsIsIsI}",
2254  "client_stats_arr", client_stats_arr,
2255  "num_clients", ctx->out_ifc_list[x].get_client_count(ctx->out_ifc_list[x].priv),
2256  "ifc_id", ifc_id, "ifc_type", (int) (ctx->out_ifc_list[x].ifc_type),
2257  "sent-messages", __sync_fetch_and_add(&ctx->counter_send_message[x], 0),
2258  "dropped-messages", __sync_fetch_and_add(&ctx->counter_dropped_message[x], 0),
2259  "buffers", __sync_fetch_and_add(&ctx->counter_send_buffer[x], 0),
2260  "autoflushes", __sync_fetch_and_add(&ctx->counter_autoflush[x],0));
2261  if (json_array_append_new(out_ifces_arr, out_ifc_cnts) == -1) {
2262  VERBOSE(CL_ERROR, "Service thread - could not append new item to out_ifces_arr while creating json string with counters..\n");
2263  goto clean_up;
2264  }
2265  }
2266 
2267  result_json = json_pack("{sisisoso}", "in_cnt", in_cnt, "out_cnt", out_cnt, "in", in_ifces_arr, "out", out_ifces_arr);
2268  if (result_json == NULL) {
2269  VERBOSE(CL_ERROR, "Service thread - could not create final json object while creating json string with counters.");
2270  goto clean_up;
2271  }
2272 
2273  *data = json_dumps(result_json, 0);
2274  json_decref(result_json);
2275  if (*data == NULL) {
2276  return -1;
2277  }
2278  return 0;
2279 
2280 
2281 clean_up:
2282  *data = NULL;
2283  return -1;
2284 }
2285 
2286 /**
2287  * Service IFC thread function.
2288  *
2289  * This function is run in separate thread. It waits for incoming
2290  * connections e.g. from supervisor. Service IFC can send IFC counters
2291  * declared in #trap_ctx_priv_s
2292  * \param[in] arg Pointer to the private libtrap context data (#trap_ctx_init()).
2293  */
2294 void *service_thread_routine(void *arg)
2295 {
2296  struct timespec ts = {.tv_sec = 0, .tv_nsec = 100000000};
2297  msg_header_t *header = (msg_header_t *) calloc(1, sizeof(msg_header_t));
2298  char *json_data = NULL;
2299  int ret_val, supervisor_sd;
2300  trap_output_ifc_t *service_ifc = NULL;
2301  tcpip_sender_private_t *priv;
2302  int i, j; /* loop vars */
2303  struct client_s *cl;
2304  struct pollfd *pfds = NULL;
2305  int pfds_size;
2306 
2307  trap_ctx_priv_t *g_ctx = (trap_ctx_priv_t *) arg;
2308 
2309  if (g_ctx->service_ifc_name == NULL) {
2310  VERBOSE(CL_VERBOSE_OFF, "Service socket will not be created, its name is not specified.");
2311  goto exit_service_thread;
2312  }
2313 
2314  service_ifc = (trap_output_ifc_t *) calloc(1, sizeof(trap_output_ifc_t));
2315  if (service_ifc == NULL) {
2316  VERBOSE(CL_ERROR, "Error: allocation of service IFC failed.");
2317  goto exit_service_thread;
2318  }
2319 
2320  /* service port does not create thread for accepting clients */
2321  if (create_tcpip_sender_ifc(NULL, g_ctx->service_ifc_name, service_ifc, 0, TRAP_IFC_TCPIP_SERVICE) != TRAP_E_OK) {
2322  VERBOSE(CL_ERROR,"Error while creating service IFC.");
2323  free(service_ifc);
2324  service_ifc = NULL;
2325  goto exit_service_thread;
2326  }
2327 
2328  priv = (tcpip_sender_private_t *) service_ifc->priv;
2329  pfds = calloc(priv->clients_arr_size + 1, sizeof(*pfds));
2330  if (pfds == NULL) {
2331  VERBOSE(CL_ERROR, "Error: allocation of pfds failed.");
2332  goto exit_service_thread;
2333  }
2334  while (1) {
2335  if (g_ctx->terminated) {
2336  break;
2337  }
2338 
2339  /* prepare file descriptor set */
2340  pfds_size = 0;
2341  pfds[pfds_size++] = (struct pollfd) {.fd = priv->server_sd, .events = POLLIN};
2342  for (i=0; i<priv->clients_arr_size; ++i) {
2343  cl = &priv->clients[i];
2344  if (cl->sd > 0) {
2345  pfds[pfds_size++] = (struct pollfd) {.fd = cl->sd, .events = POLLIN};
2346  }
2347  }
2348  fflush(stdout);
2349 
2350  ret_val = ppoll(pfds, pfds_size, &ts, NULL);
2351  if (ret_val == -1) {
2352  if (errno == EINTR) {
2353  /* received interrupt, go to next terminated condition */
2354  continue;
2355  }
2356  VERBOSE(CL_ERROR, "Select() failed in service thread.");
2357  break;
2358  } else if (ret_val == 0) {
2359  // timeout
2360  continue;
2361  } else {
2362  /* handle all read events - requests / new client */
2363  for (i = j = 0; i < priv->clients_arr_size; ++i) {
2364  cl = &priv->clients[i];
2365  if (cl->sd > -1 && pfds[++j].revents & POLLIN) {
2366  supervisor_sd = cl->sd;
2367  ret_val = service_get_data(supervisor_sd, sizeof(msg_header_t), (void **) &header);
2368 
2369  if (ret_val == -1) {
2370  /* disconnected client */
2371  close(cl->sd);
2372  cl->sd = -1;
2373  continue;
2374  } else if (ret_val == 0) {
2375  if (header->com == SERVICE_GET_COM) {
2376  if (encode_cnts_to_json(&json_data, g_ctx) != 0) {
2377  VERBOSE(CL_VERBOSE_LIBRARY, "[ERROR] Service could not encode counters to json.")
2378  close(cl->sd);
2379  cl->sd = -1;
2380  continue;
2381  } else {
2382  // Set reply header before send
2383  header->com = SERVICE_OK_REPLY;
2384  header->data_size = strlen(json_data) + 1;
2385  if (service_send_data(supervisor_sd, sizeof(msg_header_t), (void **) &header) != TRAP_E_OK) {
2386  VERBOSE(CL_VERBOSE_LIBRARY, "[ERROR] Service could not send data header.")
2387  close(cl->sd);
2388  cl->sd = -1;
2389  free(json_data);
2390  json_data = NULL;
2391  continue;
2392  }
2393  if (service_send_data(supervisor_sd, header->data_size, (void **) &json_data) != TRAP_E_OK) {
2394  VERBOSE(CL_VERBOSE_LIBRARY, "[ERROR] Service could not send data.")
2395  close(cl->sd);
2396  cl->sd = -1;
2397  free(json_data);
2398  json_data = NULL;
2399  continue;
2400  }
2401 
2402  free(json_data);
2403  json_data = NULL;
2404  }
2405  } else {
2406  // Received unknown request -> disconnect client
2407  VERBOSE(CL_VERBOSE_LIBRARY, "[ERROR] Service thread received unknown request.")
2408  close(cl->sd);
2409  cl->sd = -1;
2410  continue;
2411  }
2412  }
2413  }
2414  }
2415  if (pfds[0].revents & POLL_IN) {
2416  /* accept new client */
2417  for (i=0; i<priv->clients_arr_size; ++i) {
2418  cl = &priv->clients[i];
2419  if (cl->sd == -1) {
2420  cl->sd = accept(priv->server_sd, NULL, NULL);
2421  goto accept_success;
2422  }
2423  }
2424  /* not enough space, go away */
2425  int accept_retval = accept(priv->server_sd, NULL, NULL);
2426  if (accept_retval >= 0) {
2427  close(accept_retval);
2428  }
2429 accept_success:
2430  continue;
2431  }
2432  }
2433  }
2434 
2435  /* disconnect rest clients */
2436  for (i=0; i<priv->clients_arr_size; ++i) {
2437  cl = &priv->clients[i];
2438  if (cl->sd > -1) {
2439  close(cl->sd);
2440  cl->sd = -1;
2441  }
2442  }
2443 
2444 exit_service_thread:
2445  if (json_data != NULL) {
2446  free(json_data);
2447  json_data = NULL;
2448  }
2449  free(header);
2450  if (service_ifc != NULL) {
2451  service_ifc->terminate(service_ifc->priv);
2452  service_ifc->destroy(service_ifc->priv);
2453  free(service_ifc);
2454  }
2455  if (pfds != NULL) {
2456  free(pfds);
2457  }
2458  pthread_exit(NULL);
2459 }
2460 
2461 /**
2462  * \brief Create dump files.
2463  *
2464  * Create dump files for debug as follows:
2465  * trap-i[number]-config.txt Output interface configuration.
2466  * trap-i[number]-buffer.dat Output interface buffer
2467  * trap-o[number]-config.txt Input interface configuration.
2468  * trap-o[number]-buffer.dat Input interface buffer
2469  *
2470  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
2471  * \param[in] path Output directory, if NULL use current working directory.
2472  */
2473 void trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path)
2474 {
2475  const char *td = "./";
2476  uint32_t i;
2477 
2478  if (path != NULL) {
2479  td = path;
2480  }
2481 
2482  trap_ctx_priv_t *c = ctx;
2483  if (c == NULL || c->initialized == 0) {
2484  VERBOSE(CL_ERROR, "Not initialized libtrap context, skipping...");
2485  return;
2486  }
2487  for (i = 0; i < c->num_ifc_in; i++) {
2488  c->in_ifc_list[i].create_dump(c->in_ifc_list[i].priv, i, td);
2489  }
2490  for (i = 0; i < c->num_ifc_out; i++) {
2491  c->out_ifc_list[i].create_dump(c->out_ifc_list[i].priv, i, td);
2492  }
2493 }
2494 
2495 int trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx)
2496 {
2497  trap_ctx_priv_t *c = ctx;
2498  if (c == NULL || c->initialized == 0 || ifcidx > c->num_ifc_out) {
2499  return -1;
2500  }
2501  return c->out_ifc_list[ifcidx].get_client_count(c->out_ifc_list[ifcidx].priv);
2502 }
2503 
2504 /**
2505  * @}
2506  */
2507 
2508 /**
2509  * \addtogroup contextapi
2510  * @{
2511  */
2512 /**
2513  * \addtogroup trap_mess_fmt
2514  * @{
2515  */
2516 void trap_ctx_vset_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
2517 {
2518  trap_output_ifc_t *ifc;
2519  trap_ctx_priv_t *c = ctx;
2520  char *data_fmt_spec = (char *) va_arg(ap, char *);
2521 
2522  if ((c == NULL) || (data_type == TRAP_FMT_UNKNOWN) || (out_ifc_idx >= c->num_ifc_out)) {
2523  VERBOSE(CL_ERROR, "%s: Uninitialized libtrap context or bad parameters.", __func__);
2524  return;
2525  }
2526 
2527  ifc = &c->out_ifc_list[out_ifc_idx];
2528  /* If the data type is already set, disconnect all connected clients to this output interface (auto-negotiation will be performed again to get new data format and data spec) */
2529  pthread_mutex_lock(&ifc->ifc_mtx);
2530  if (ifc->data_type != TRAP_FMT_UNKNOWN) {
2531  VERBOSE(CL_VERBOSE_LIBRARY, "Data format setter: not initial setting of data_type -> disconnect all clients of the output interface %d.", out_ifc_idx);
2532  if (ifc->disconn_clients != NULL) {
2533  ifc->disconn_clients(ifc->priv);
2534  }
2535  }
2536  ifc->data_type = data_type;
2537  if (data_type != TRAP_FMT_RAW) {
2538  if (ifc->data_fmt_spec != NULL) {
2539  free(ifc->data_fmt_spec);
2540  ifc->data_fmt_spec = NULL;
2541  }
2542  if (data_fmt_spec == NULL) {
2543  ifc->data_fmt_spec = NULL;
2544  } else {
2545  ifc->data_fmt_spec = strdup(data_fmt_spec);
2546  }
2547  }
2548  pthread_mutex_unlock(&ifc->ifc_mtx);
2549 }
2550 
2551 void trap_ctx_set_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, ...)
2552 {
2553  va_list ap;
2554 
2555  if (ctx == NULL) {
2556  VERBOSE(CL_ERROR, "%s: Uninitialized libtrap context.", __func__);
2557  return;
2558  }
2559 
2560  va_start(ap, data_type);
2561  trap_ctx_vset_data_fmt(ctx, out_ifc_idx, data_type, ap);
2562  va_end(ap);
2563 }
2564 
2565 int trap_ctx_vset_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
2566 {
2567  trap_input_ifc_t *ifc;
2568  trap_ctx_priv_t *c = ctx;
2569  char *req_data_fmt_spec = (char *) va_arg(ap, char *);
2570 
2571  if (c == NULL) {
2572  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2573  }
2574 
2575  if (data_type == TRAP_FMT_UNKNOWN) {
2576  return trap_error(ctx, TRAP_E_BADPARAMS);
2577  }
2578 
2579  if (in_ifc_idx >= c->num_ifc_in) {
2580  return trap_error(ctx, TRAP_E_BAD_IFC_INDEX);
2581  }
2582 
2583  ifc = &c->in_ifc_list[in_ifc_idx];
2584  pthread_mutex_lock(&ifc->ifc_mtx);
2585  ifc->req_data_type = data_type;
2586  if (data_type != TRAP_FMT_RAW) {
2587  if (ifc->req_data_fmt_spec != NULL) {
2588  free(ifc->req_data_fmt_spec);
2589  ifc->req_data_fmt_spec = NULL;
2590  }
2591  if (req_data_fmt_spec == NULL) {
2592  ifc->req_data_fmt_spec = NULL;
2593  } else {
2594  ifc->req_data_fmt_spec = strdup(req_data_fmt_spec);
2595  }
2596  }
2597  pthread_mutex_unlock(&ifc->ifc_mtx);
2598 
2599  return trap_error(ctx, TRAP_E_OK);
2600 }
2601 
2602 int trap_ctx_set_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, ...)
2603 {
2604  va_list ap;
2605  int res;
2606 
2607  if (ctx == NULL) {
2608  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2609  }
2610 
2611  va_start(ap, data_type);
2612  res = trap_ctx_vset_required_fmt(ctx, in_ifc_idx, data_type, ap);
2613  va_end(ap);
2614  return trap_error(ctx, res);
2615 }
2616 
2617 int trap_ctx_get_data_fmt(trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
2618 {
2619  trap_input_ifc_t *inifc;
2620  trap_output_ifc_t *outifc;
2621  trap_ctx_priv_t *c = ctx;
2622 
2623  if (ctx == NULL) {
2624  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2625  }
2626 
2627  if (ifc_dir == TRAPIFC_INPUT) {
2628  if (ifc_idx >= c->num_ifc_in) {
2629  return trap_error(ctx, TRAP_E_BAD_IFC_INDEX);
2630  }
2631 
2632  inifc = &c->in_ifc_list[ifc_idx];
2633 
2634  pthread_mutex_lock(&inifc->ifc_mtx);
2635  if (inifc->data_type == TRAP_FMT_UNKNOWN) {
2636  pthread_mutex_unlock(&inifc->ifc_mtx);
2637  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2638  }
2639 
2640  if (inifc->client_state == FMT_OK || inifc->client_state == FMT_CHANGED) {
2641  (*data_type) = inifc->data_type;
2642  if (inifc->data_type != TRAP_FMT_RAW) {
2643  /* TODO: Should probably do copy. */
2644  (*spec) = inifc->data_fmt_spec;
2645  } else {
2646  (*spec) = NULL;
2647  }
2648  } else {
2649  pthread_mutex_unlock(&inifc->ifc_mtx);
2650  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2651  }
2652  pthread_mutex_unlock(&inifc->ifc_mtx);
2653  } else {
2654  /* TRAPIFC_OUTPUT */
2655  if (ifc_idx >= c->num_ifc_out) {
2656  return trap_error(ctx, TRAP_E_BAD_IFC_INDEX);
2657  }
2658 
2659  outifc = &c->out_ifc_list[ifc_idx];
2660 
2661  pthread_mutex_lock(&outifc->ifc_mtx);
2662  if (outifc->data_type == TRAP_FMT_UNKNOWN) {
2663  pthread_mutex_unlock(&outifc->ifc_mtx);
2664  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2665  }
2666 
2667  (*data_type) = outifc->data_type;
2668  if (*data_type != TRAP_FMT_RAW) {
2669  /* TODO: Should probably do copy. */
2670  (*spec) = outifc->data_fmt_spec;
2671  } else {
2672  (*spec) = NULL;
2673  }
2674  pthread_mutex_unlock(&outifc->ifc_mtx);
2675  }
2676  return trap_error(ctx, TRAP_E_OK);
2677 }
2678 /**
2679  * @}
2680  *//* trap_mess_fmt */
2681 /**
2682  * @}
2683  */
2684 
2685 /**
2686  * \addtogroup simpleapi
2687  * @{
2688  */
2689 /**
2690  * \addtogroup trap_mess_fmt
2691  * @{
2692  */
2693 void trap_set_data_fmt(uint32_t out_ifc_idx, uint8_t data_type, ...)
2694 {
2695  va_list ap;
2696 
2697  va_start(ap, data_type);
2698  trap_ctx_vset_data_fmt(trap_glob_ctx, out_ifc_idx, data_type, ap);
2699  va_end(ap);
2700 }
2701 
2702 int trap_set_required_fmt(uint32_t in_ifc_idx, uint8_t data_type, ...)
2703 {
2704  va_list ap;
2705  int res;
2706 
2707  va_start(ap, data_type);
2708  res = trap_ctx_vset_required_fmt(trap_glob_ctx, in_ifc_idx, data_type, ap);
2709  va_end(ap);
2710 
2711  return res;
2712 }
2713 
2714 int trap_get_data_fmt(uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
2715 {
2716  return trap_ctx_get_data_fmt(trap_glob_ctx, ifc_dir, in_ifc_idx, data_type, spec);
2717 }
2718 
2719 int trap_ctx_get_in_ifc_state(trap_ctx_t *ctx, uint32_t ifc_idx)
2720 {
2721  if (ctx == NULL) {
2722  return trap_error(ctx, TRAP_E_NOT_INITIALIZED);
2723  }
2724 
2725  trap_ctx_priv_t *c = (trap_ctx_priv_t *) ctx;
2726 
2727  if (ifc_idx >= c->num_ifc_in) {
2728  return trap_error(ctx, TRAP_E_BAD_IFC_INDEX);
2729  }
2730 
2731  return __sync_fetch_and_add(&c->in_ifc_list[ifc_idx].client_state, 0);
2732 }
2733 
2734 int trap_get_in_ifc_state(uint32_t ifc_idx)
2735 {
2736  return trap_ctx_get_in_ifc_state(trap_glob_ctx, ifc_idx);
2737 }
2738 
2739 const char *trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type)
2740 {
2741  int length_type_2 = 0, length_name_2 = 0;
2742  const char *source_cpy;
2743  source_cpy = source;
2744  while (*source != 0 && *source != ' ') {
2745  length_type_2++;
2746  source ++;
2747  }
2748  *type = source_cpy;
2749  *length_type = length_type_2;
2750  source ++;
2751  //get name
2752  source_cpy = source;
2753  while (*source != 0 && *source != ',') {
2754  length_name_2++;
2755  source ++;
2756  }
2757  *length_name = length_name_2;
2758  *name = source_cpy;
2759  if (*source == ',') {
2760  source ++;
2761  }
2762  return source;
2763 }
2764 
2765 int trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
2766 {
2767  if (sender_ifc_data_fmt == NULL && receiver_ifc_data_fmt != NULL) {
2768  return TRAP_E_FIELDS_MISMATCH;
2769  } else if (sender_ifc_data_fmt != NULL && receiver_ifc_data_fmt == NULL) {
2770  return TRAP_E_FIELDS_SUBSET;
2771  } else if (sender_ifc_data_fmt == NULL && receiver_ifc_data_fmt == NULL) {
2772  return TRAP_E_OK;
2773  }
2774 
2775  const char *receiver_move,
2776  *sender_move,
2777  *field_name_receiver,
2778  *field_name_sender,
2779  *field_type_receiver,
2780  *field_type_sender;
2781  int field_name_receiver_length = 0,
2782  field_name_sender_length = 0,
2783  field_type_receiver_length = 0,
2784  field_type_sender_length = 0;
2785  int compare_str = 0;
2786  receiver_move = receiver_ifc_data_fmt;
2787  sender_move = sender_ifc_data_fmt;
2788  // go through all fields of receiver and search for each one in set of sender's fields
2789  while (*receiver_move != 0) {
2790  // get a receiver's field
2791  receiver_move = trap_get_type_and_name_from_string(receiver_move, &field_name_receiver,
2792  &field_type_receiver, &field_name_receiver_length, &field_type_receiver_length);
2793  compare_str = 0;
2794  while (*sender_move != 0 && !compare_str) {
2795  // search the field in set of sender's fields
2796  sender_move = trap_get_type_and_name_from_string(sender_move, &field_name_sender,
2797  &field_type_sender, &field_name_sender_length, &field_type_sender_length);
2798  compare_str = (field_name_sender_length == field_name_receiver_length &&
2799  field_type_sender_length == field_type_receiver_length &&
2800  memcmp(field_name_sender, field_name_receiver, field_name_receiver_length) == 0 &&
2801  memcmp(field_type_sender, field_type_receiver, field_type_receiver_length) == 0);
2802  }
2803  if (!compare_str) {
2804  VERBOSE(CL_ERROR, "TRAP Negotiation failed: required field `%.*s %.*s` not offered by sender.\nReceived specifier: %s",
2805  field_type_receiver_length, field_type_receiver,
2806  field_name_receiver_length, field_name_receiver,
2807  sender_ifc_data_fmt);
2808  return TRAP_E_FIELDS_MISMATCH; // one of receiver fields not found
2809  }
2810  // reset pointer to beginning of sender's set of fields
2811  sender_move = sender_ifc_data_fmt;
2812  }
2813  if (strlen(sender_ifc_data_fmt) > strlen(receiver_ifc_data_fmt)) {
2814  // receivers fmt spec is subset of senders fmt spec
2815  return TRAP_E_FIELDS_SUBSET;
2816  }
2817  return TRAP_E_OK;
2818 }
2819 
2821 {
2822  return (trap_ctx_t *) trap_glob_ctx;
2823 }
2824 
2825 /**
2826  * @}
2827  *//* trap_mess_fmt */
2828 /**
2829  * @}
2830  */
2831 
2832 
2833 int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
2834 {
2835  VERBOSE(CL_VERBOSE_LIBRARY, "--- Output IFC negotiation ---");
2836 
2837  hello_msg_header_t *hello_msg_header = NULL;
2838  uint32_t size_of_buffer = sizeof(hello_msg_header_t);
2839  char *buffer = (char *) calloc(size_of_buffer, sizeof(char));
2840  char *p = NULL;
2841  uint32_t size = 0;
2842  int ret_val = 0;
2843  int neg_result = NEG_RES_OK;
2844  int compare = 0;
2845  int sock_d = 0;
2846  file_private_t *file_ifc_priv = NULL;
2847  tcpip_sender_private_t *tcp_ifc_priv = NULL;
2848 #if HAVE_OPENSSL
2849  tls_sender_private_t *tls_ifc_priv = NULL;
2850 #endif
2851  uint8_t data_type = TRAP_FMT_UNKNOWN;
2852  char *data_fmt_spec = NULL;
2853  uint32_t ifc_idx = 0;
2854 
2855  // Decide which structure can be used for interfaces private data
2856  if (ifc_type == TRAP_IFC_TYPE_FILE) {
2857  file_ifc_priv = (file_private_t *) ifc_priv_data;
2858  data_type = file_ifc_priv->ctx->out_ifc_list[file_ifc_priv->ifc_idx].data_type;
2859  data_fmt_spec = file_ifc_priv->ctx->out_ifc_list[file_ifc_priv->ifc_idx].data_fmt_spec;
2860  ifc_idx = file_ifc_priv->ifc_idx;
2861 #if HAVE_OPENSSL
2862  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
2863  tls_ifc_priv = (tls_sender_private_t *) ifc_priv_data;
2864  data_type = tls_ifc_priv->ctx->out_ifc_list[tls_ifc_priv->ifc_idx].data_type;
2865  data_fmt_spec = tls_ifc_priv->ctx->out_ifc_list[tls_ifc_priv->ifc_idx].data_fmt_spec;
2866  ifc_idx = tls_ifc_priv->ifc_idx;
2867 #endif
2868  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
2869  tcp_ifc_priv = (tcpip_sender_private_t *) ifc_priv_data;
2870  data_type = tcp_ifc_priv->ctx->out_ifc_list[tcp_ifc_priv->ifc_idx].data_type;
2871  data_fmt_spec = tcp_ifc_priv->ctx->out_ifc_list[tcp_ifc_priv->ifc_idx].data_fmt_spec;
2872  ifc_idx = tcp_ifc_priv->ifc_idx;
2873  sock_d = tcp_ifc_priv->clients[client_idx].sd;
2874  } else {
2875  neg_result = NEG_RES_FAILED;
2876  goto out_neg_exit;
2877  }
2878 
2879  // Prepare hello_msg header with output interfaces data_type and data_fmt_spec size
2880  hello_msg_header = calloc(1, sizeof(hello_msg_header_t));
2881  // Check whether the output interfaces data format and data specifier are set correctly. If not, negotiation will fail.
2882  if (((data_type == TRAP_FMT_UNIREC || data_type == TRAP_FMT_JSON) && data_fmt_spec == NULL) || data_type == TRAP_FMT_UNKNOWN) {
2883  /**
2884  * In case of file output interface, return NEG_RES_FMT_UNKNOWN
2885  * In case of tcpip or unix output interface, send hello message header with format unknown value and return NEG_RES_FMT_UNKNOWN
2886  */
2887  VERBOSE(CL_VERBOSE_LIBRARY, "Output interface negotiation - the data format or specifier of the output interface %d are not set correctly.", ifc_idx);
2888  neg_result = NEG_RES_FMT_UNKNOWN;
2889  if (ifc_type == TRAP_IFC_TYPE_FILE) {
2890  goto out_neg_exit;
2891  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_TLS || ifc_type == TRAP_IFC_TYPE_UNIX) {
2892  VERBOSE(CL_VERBOSE_LIBRARY, "Output interface negotiation - gonna send header with TRAP_FMT_UNKNOWN.");
2893  hello_msg_header->data_type = TRAP_FMT_UNKNOWN;
2894  hello_msg_header->data_fmt_spec_size = 0;
2895  }
2896  } else {
2897  hello_msg_header->data_type = data_type;
2898  if (data_type == TRAP_FMT_RAW) {
2899  hello_msg_header->data_fmt_spec_size = 0;
2900  } else {
2901  hello_msg_header->data_fmt_spec_size = strlen(data_fmt_spec);
2902  }
2903  }
2904 
2905  hello_msg_header_t tmp = *hello_msg_header;
2906  tmp.data_fmt_spec_size = htonl(hello_msg_header->data_fmt_spec_size);
2907 
2908  memcpy(buffer, &tmp, sizeof(hello_msg_header_t));
2909  size = sizeof(hello_msg_header_t);
2910  p = buffer;
2911 
2912  VERBOSE(CL_VERBOSE_LIBRARY, "Step 1: sending hello msg header... ");
2913  if (ifc_type == TRAP_IFC_TYPE_FILE) {
2914  ret_val = fwrite((void *) p, sizeof(char), size, file_ifc_priv->fd);
2915  compare = size;
2916 #if HAVE_OPENSSL
2917  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
2918  ret_val = SSL_write(tls_ifc_priv->clients[client_idx].ssl, p, size);
2919  if (ret_val > 0) {
2920  compare = ret_val;
2921  } else {
2922  compare = ret_val + 1;
2923  }
2924 #endif
2925  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
2926  ret_val = service_send_data(sock_d, size, (void **)&p);
2927  compare = TRAP_E_OK;
2928  }
2929  if (ret_val != compare) {
2930  // Could not send hello message header
2931  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR");
2932  neg_result = NEG_RES_FAILED;
2933  goto out_neg_exit;
2934  } else {
2935  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
2936  }
2937 
2938  // Data format specifier is sent only if the data format is set to JSON or UNIREC
2939  if ((data_type == TRAP_FMT_UNIREC || data_type == TRAP_FMT_JSON) && data_fmt_spec != NULL) {
2940  VERBOSE(CL_VERBOSE_LIBRARY, "Step 2: sending data_fmt_spec... ");
2941  if (hello_msg_header->data_fmt_spec_size == 0) { // JSON can have empty string as format specifier
2942  VERBOSE(CL_VERBOSE_LIBRARY, "SKIPPED because data_fmt_spec_size is 0.");
2943  goto out_neg_exit;
2944  }
2945  memset(buffer, 0, sizeof(hello_msg_header_t));
2946  if ((strlen(data_fmt_spec) + 1) > size_of_buffer) {
2947  buffer = (char *) realloc(buffer, (strlen(data_fmt_spec) + 1) * sizeof(char));
2948  memset(buffer + size_of_buffer, 0, ((strlen(data_fmt_spec) + 1) - size_of_buffer) * sizeof(char));
2949  size_of_buffer = (strlen(data_fmt_spec) + 1);
2950  }
2951  sprintf(buffer,"%s",data_fmt_spec);
2952  size = hello_msg_header->data_fmt_spec_size;
2953  p = buffer;
2954 
2955  if (ifc_type == TRAP_IFC_TYPE_FILE) {
2956  ret_val = fwrite((void *) p, sizeof(char), size, file_ifc_priv->fd);
2957  compare = size;
2958 #if HAVE_OPENSSL
2959  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
2960  ret_val = SSL_write(tls_ifc_priv->clients[client_idx].ssl, p, size);
2961  if (ret_val > 0) {
2962  compare = ret_val;
2963  } else {
2964  compare = ret_val + 1;
2965  }
2966 #endif
2967  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
2968  ret_val = service_send_data(sock_d, size, (void **)&p);
2969  compare = TRAP_E_OK;
2970  }
2971  if (ret_val != compare) {
2972  // Could not send output interface data specifier
2973  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR");
2974  neg_result = NEG_RES_FAILED;
2975  goto out_neg_exit;
2976  } else {
2977  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
2978  }
2979  }
2980 
2981 out_neg_exit:
2982  if (buffer != NULL) {
2983  free(buffer);
2984  buffer = NULL;
2985  }
2986  if (hello_msg_header != NULL) {
2987  free (hello_msg_header);
2988  hello_msg_header = NULL;
2989  }
2990 
2991  return neg_result;
2992 }
2993 
2994 
2995 int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
2996 {
2997  VERBOSE(CL_VERBOSE_LIBRARY, "--- Input IFC negotiation ---");
2998 
2999  uint32_t size = 0;
3000  hello_msg_header_t *hello_msg_header = calloc(1, sizeof(hello_msg_header_t));
3001  int ret_val = 0;
3002  void *p_p = NULL;
3003  int neg_result = 0;
3004  int compare = 0;
3005 
3006  file_private_t *file_ifc_priv = NULL;
3007 #if HAVE_OPENSSL
3008  tls_receiver_private_t *tls_ifc_priv = NULL;
3009 #endif
3010  tcpip_receiver_private_t *tcp_ifc_priv = NULL;
3011  uint8_t req_data_type = TRAP_FMT_UNKNOWN;
3012  char *req_data_fmt_spec = NULL;
3013  char *current_data_fmt_spec = NULL;
3014  char *recv_data_fmt_spec = NULL;
3015 
3016  // Decide which structure can be used for interfaces private data
3017  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3018  file_ifc_priv = (file_private_t *) ifc_priv_data;
3019  req_data_type = file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].req_data_type;
3020  req_data_fmt_spec = file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].req_data_fmt_spec;
3021  current_data_fmt_spec = file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].data_fmt_spec;
3022 #if HAVE_OPENSSL
3023  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3024  tls_ifc_priv = (tls_receiver_private_t *) ifc_priv_data;
3025  req_data_type = tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].req_data_type;
3026  req_data_fmt_spec = tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].req_data_fmt_spec;
3027  current_data_fmt_spec = tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].data_fmt_spec;
3028 #endif
3029  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3030  tcp_ifc_priv = (tcpip_receiver_private_t *) ifc_priv_data;
3031  req_data_type = tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].req_data_type;
3032  req_data_fmt_spec = tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].req_data_fmt_spec;
3033  current_data_fmt_spec = tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].data_fmt_spec;
3034  } else {
3035  neg_result = NEG_RES_FAILED;
3036  goto in_neg_exit;
3037  }
3038 
3039 
3040  /** Receive hello msg header with data_type and data_fmt_spec_size */
3041  VERBOSE(CL_VERBOSE_LIBRARY, "Step 1: reading hello msg header... ");
3042  size = sizeof(hello_msg_header_t);
3043  p_p = (void *) hello_msg_header;
3044 
3045  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3046  ret_val = fread(p_p, sizeof(char), size, file_ifc_priv->fd);
3047  compare = size;
3048  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3049  ret_val = service_get_data(tcp_ifc_priv->sd, size, &p_p);
3050  compare = TRAP_E_OK;
3051 #if HAVE_OPENSSL
3052  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3053  do {
3054  ret_val = SSL_read(tls_ifc_priv->ssl, p_p, size);
3055  if (ret_val > 0) {
3056  compare = ret_val;
3057  } else if (ret_val == -1) {
3058  ret_val = SSL_get_error(tls_ifc_priv->ssl, ret_val);
3059  if (ret_val == SSL_ERROR_WANT_READ) {
3060  ret_val = -1;
3061  }
3062  } else {
3063  compare = ret_val + 1;
3064  }
3065  } while (ret_val == -1);
3066 #endif
3067  }
3068  if (ret_val != compare) {
3069  // Could not receive hello message header
3070  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR");
3071  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3072  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3073  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3074  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3075 #if HAVE_OPENSSL
3076  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3077  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3078 #endif
3079  }
3080  neg_result = NEG_RES_FAILED;
3081  goto in_neg_exit;
3082  } else {
3083  hello_msg_header->data_fmt_spec_size = ntohl(hello_msg_header->data_fmt_spec_size);
3084 
3085  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
3086  VERBOSE(CL_VERBOSE_LIBRARY, "sender's data_type: %"PRIu8, hello_msg_header->data_type);
3087  VERBOSE(CL_VERBOSE_LIBRARY, "sender's data_fmt_spec_size: %"PRIu32, hello_msg_header->data_fmt_spec_size);
3088  VERBOSE(CL_VERBOSE_LIBRARY, "receiver's data_type: %"PRIu8, req_data_type);
3089  }
3090 
3091 
3092  /** Compare data_type */
3093  // What if input interface has no specified data format or data specifier? TODO!!!
3094  VERBOSE(CL_VERBOSE_LIBRARY, "Step 2: data types comparison... ");
3095  if (hello_msg_header->data_type == TRAP_FMT_UNKNOWN) {
3096  // Received unknown data type in hello message header from senders interface
3097  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR - sender's output interface has unknown data format");
3098  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3099  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3100  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3101  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3102 #if HAVE_OPENSSL
3103  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3104  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3105 #endif
3106  }
3107  neg_result = NEG_RES_FMT_UNKNOWN;
3108  goto in_neg_exit;
3109  } else if (hello_msg_header->data_type != req_data_type) {
3110  // Senders and receivers interface data types are not the same
3111  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR - mismatch of sender's output and receiver's input interface data types");
3112  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3113  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3114  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3115  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3116 #if HAVE_OPENSSL
3117  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3118  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3119 #endif
3120  }
3121  neg_result = NEG_RES_FMT_MISMATCH;
3122  goto in_neg_exit;
3123  } else if (req_data_type == TRAP_FMT_RAW) {
3124  // Both interfaces (senders output and receivers input) have RAW data format -> receive message with the data right after negotiation
3125  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3126  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_OK;
3127  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3128  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_OK;
3129 #if HAVE_OPENSSL
3130  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3131  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_OK;
3132 #endif
3133  }
3134  neg_result = NEG_RES_CONT;
3135  } else {
3136  // Both interfaces (senders output and receivers input) have UNIREC or JSON data format, that's OK
3137  // If type is UNIREC, check data format specifier size (JSON can have empty specifier, but UNIREC don't)
3138  if (hello_msg_header->data_type == TRAP_FMT_UNIREC && hello_msg_header->data_fmt_spec_size <= 0) {
3139  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR - received zero size of UNIREC data format specifier.");
3140  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3141  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3142  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3143  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3144 #if HAVE_OPENSSL
3145  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3146  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3147 #endif
3148  }
3149  neg_result = NEG_RES_FMT_MISMATCH;
3150  goto in_neg_exit;
3151  }
3152  }
3153  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
3154 
3155 
3156  /** Receive data_fmt_spec */
3157  // data_fmt_spec is received only in case of UNIREC and JSON data formats
3158  if (hello_msg_header->data_type == TRAP_FMT_UNIREC || hello_msg_header->data_type == TRAP_FMT_JSON) {
3159  VERBOSE(CL_VERBOSE_LIBRARY, "Step 3: receiving sender's data_fmt_spec... ");
3160  size = hello_msg_header->data_fmt_spec_size;
3161  recv_data_fmt_spec = calloc(size+1, sizeof(char));
3162  p_p = (void *) recv_data_fmt_spec;
3163 
3164  if (hello_msg_header->data_fmt_spec_size > 0) {
3165  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3166  ret_val = fread(p_p, sizeof(char), size, file_ifc_priv->fd);
3167  compare = size;
3168  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3169  ret_val = service_get_data(tcp_ifc_priv->sd, size, &p_p);
3170  compare = TRAP_E_OK;
3171 #if HAVE_OPENSSL
3172  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3173  ret_val = SSL_read(tls_ifc_priv->ssl, p_p, size);
3174  if (ret_val > 0) {
3175  compare = ret_val;
3176  } else {
3177  compare = ret_val + 1;
3178  }
3179 #endif
3180  }
3181 
3182  if (ret_val != compare) {
3183  // Could not receive data formate specifier
3184  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR");
3185  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3186  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3187  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3188  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3189 #if HAVE_OPENSSL
3190  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3191  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_WAITING;
3192 #endif
3193  }
3194  neg_result = NEG_RES_FAILED;
3195  free(recv_data_fmt_spec);
3196  recv_data_fmt_spec = NULL;
3197  goto in_neg_exit;
3198  } else {
3199  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
3200  }
3201  } else { // data_fmt_spec_size == 0
3202  *(char*)p_p = 0; // set to empty string
3203  VERBOSE(CL_VERBOSE_LIBRARY, "SKIPPED because data_fmt_spec_size is 0.");
3204  }
3205  VERBOSE(CL_VERBOSE_LIBRARY, "sender's data_fmt_spec: \"%s\"", recv_data_fmt_spec);
3206  VERBOSE(CL_VERBOSE_LIBRARY, "receiver's data_fmt_spec: \"%s\"", req_data_fmt_spec);
3207 
3208 
3209  /**Compare data_fmt_spec */
3210  VERBOSE(CL_VERBOSE_LIBRARY, "Step 4: comparing senders data_fmt_spec and receivers required data_fmt_spec... ");
3211  if (hello_msg_header->data_type == TRAP_FMT_UNIREC) {
3212  ret_val = trap_ctx_cmp_data_fmt(recv_data_fmt_spec, req_data_fmt_spec);
3213  } else {
3214  // For JSON, misamtch occurs if recevier's format is non-empty and formats are different
3215  ret_val = (req_data_fmt_spec == NULL || req_data_fmt_spec[0] == 0 ||
3216  /*recv_data_fmt_spec == NULL || recv_data_fmt_spec[0] == 0 ||*/ // Uncomment this to enable sender's empty format to match anything
3217  strcmp(req_data_fmt_spec, recv_data_fmt_spec) == 0
3219  }
3220  if (ret_val == TRAP_E_FIELDS_MISMATCH) {
3221  // senders and receivers ifc data_fmt_specs are not same
3222  VERBOSE(CL_VERBOSE_LIBRARY, "ERROR");
3223  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3224  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3225  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3226  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3227 #if HAVE_OPENSSL
3228  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3229  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_MISMATCH;
3230 #endif
3231  }
3232  neg_result = NEG_RES_FMT_MISMATCH;
3233  free(recv_data_fmt_spec);
3234  recv_data_fmt_spec = NULL;
3235  goto in_neg_exit;
3236  } else if (ret_val == TRAP_E_FIELDS_SUBSET) {
3237  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
3238  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3239  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3240  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3241  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3242 #if HAVE_OPENSSL
3243  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3244  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3245 #endif
3246  }
3247  neg_result = NEG_RES_RECEIVER_FMT_SUBSET;
3248  } else {
3249  VERBOSE(CL_VERBOSE_LIBRARY, "OK");
3250  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3251  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_OK;
3252  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3253  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_OK;
3254 #if HAVE_OPENSSL
3255  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3256  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_OK;
3257 #endif
3258  }
3259  neg_result = NEG_RES_CONT;
3260  if (current_data_fmt_spec != NULL) {
3261  VERBOSE(CL_VERBOSE_LIBRARY, "Step 5: comparing old and new sender's data_fmt_spec (not first negotiation)... ");
3262  VERBOSE(CL_VERBOSE_LIBRARY, "old data_fmt_spec: \"%s\"", current_data_fmt_spec);
3263  VERBOSE(CL_VERBOSE_LIBRARY, "new data_fmt_spec: \"%s\"", recv_data_fmt_spec);
3264  if (hello_msg_header->data_type == TRAP_FMT_UNIREC) {
3265  ret_val = trap_ctx_cmp_data_fmt(current_data_fmt_spec, recv_data_fmt_spec);
3266  } else {
3267  ret_val = (strcmp(current_data_fmt_spec, recv_data_fmt_spec) != 0 ? 1 /* CHANGE */ : TRAP_E_OK);
3268  }
3269  if (ret_val != TRAP_E_OK) {
3270  VERBOSE(CL_VERBOSE_LIBRARY, "CHANGE");
3271  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3272  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3273  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3274  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3275 #if HAVE_OPENSSL
3276  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3277  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state = FMT_CHANGED;
3278 #endif
3279  }
3280  if (hello_msg_header->data_type == TRAP_FMT_UNIREC) {
3281  neg_result = NEG_RES_SENDER_FMT_SUBSET;
3282  } else {
3283  neg_result = NEG_RES_FMT_CHANGED;
3284  }
3285  } else {
3286  VERBOSE(CL_VERBOSE_LIBRARY, "SAME");
3287  }
3288  }
3289  }
3290  }
3291 
3292  /** Save senders data_type and data_fmt_spec */
3293  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3294  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].data_type = hello_msg_header->data_type;
3295  if (file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].data_fmt_spec != NULL) {
3296  free(file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].data_fmt_spec);
3297  }
3298  file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].data_fmt_spec = recv_data_fmt_spec;
3299  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3300  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].data_type = hello_msg_header->data_type;
3301  if (tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].data_fmt_spec != NULL) {
3302  free(tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].data_fmt_spec);
3303  }
3304  tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].data_fmt_spec = recv_data_fmt_spec;
3305 #if HAVE_OPENSSL
3306  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3307  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].data_type = hello_msg_header->data_type;
3308  if (tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].data_fmt_spec != NULL) {
3309  free(tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].data_fmt_spec);
3310  }
3311  tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].data_fmt_spec = recv_data_fmt_spec;
3312 #endif
3313  }
3314 
3315 in_neg_exit:
3316  if (ifc_type == TRAP_IFC_TYPE_FILE) {
3317  VERBOSE(CL_VERBOSE_LIBRARY, "input ifc state after connecting: %d", file_ifc_priv->ctx->in_ifc_list[file_ifc_priv->ifc_idx].client_state);
3318  } else if (ifc_type == TRAP_IFC_TYPE_TCPIP || ifc_type == TRAP_IFC_TYPE_UNIX) {
3319  VERBOSE(CL_VERBOSE_LIBRARY, "input ifc state after connecting: %d", tcp_ifc_priv->ctx->in_ifc_list[tcp_ifc_priv->ifc_idx].client_state);
3320 #if HAVE_OPENSSL
3321  } else if (ifc_type == TRAP_IFC_TYPE_TLS) {
3322  VERBOSE(CL_VERBOSE_LIBRARY, "input ifc state after connecting: %d", tls_ifc_priv->ctx->in_ifc_list[tls_ifc_priv->ifc_idx].client_state);
3323 #endif
3324  }
3325 
3326  if (hello_msg_header != NULL) {
3327  free(hello_msg_header);
3328  hello_msg_header = NULL;
3329  }
3330 
3331  return neg_result;
3332 }
3333 
3334 // Local variables:
3335 // c-basic-offset: 3
3336 // End:
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+
uint8_t com
Definition: trap.c:2137
+
void trap_free_ctx_t(trap_ctx_priv_t **ctx)
Definition: trap.c:1258
+
int trap_get_data_fmt(uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
Definition: trap.c:2714
+
Set interface timeout (int32_t): in microseconds for non-blocking mode; timeout can be also: TRAP_WAI...
Definition: trap.h:201
+ +
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+ +
int trap_ctx_get_in_ifc_state(trap_ctx_t *ctx, uint32_t ifc_idx)
Definition: trap.c:2719
+
int trap_ctx_set_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2602
+ +
int create_tls_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tls.c:738
+
#define MAX_ERROR_MSG_BUFF_SIZE
Definition: trap_internal.h:57
+
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
Definition: trap.c:1160
+
#define TRAP_IFC_TIMEOUT
size of default timeout on output interfaces in microseconds
+
char * data_fmt_spec
Definition: trap_ifc.h:218
+
int trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
Definition: trap.c:2765
+
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
#define NEG_RES_SENDER_FMT_SUBSET
If the data format of input and output interfaces is the same and new data specifier of the output in...
Definition: trap_internal.h:76
+
trap_ctx_t * trap_ctx_init3(const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifc_name)
Initialize and return the context of libtrap.
Definition: trap.c:1731
+ +
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+ +
char * req_data_fmt_spec
Definition: trap_ifc.h:231
+ + +
#define trap_ctx_t
Definition: trap.h:59
+
#define TRAP_IFC_PARAM_DELIMITER
Definition: trap.h:165
+
int create_tcpip_receiver_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of input TCP/IP IFC module. This function is called by TRAP library to initialize one inp...
Definition: ifc_tcpip.c:636
+ +
const char trap_version[]
+
#define TRAP_E_FORMAT_CHANGED
Returned by trap_recv when format or format spec of the receivers interface has been changed...
Definition: trap.h:100
+
#define TRAP_NO_WAIT
Definition: trap.h:119
+
int trap_last_error
Code of last error (one of the codes above)
Definition: trap.c:123
+
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:246
+
char * trap_default_socket_path_format
+
#define X(param, text, align, cut)
+
char * get_module_name(void)
Definition: trap.c:852
+
static void print_aligned_multiline(const char *s, uint16_t align, uint16_t cut)
Definition: trap.c:788
+
static void remove_setter_from_param(char *params, char *setter)
Definition: trap.c:1482
+
char trap_help_spec
Definition: trap.c:102
+
#define NEG_RES_FAILED
If receiving the data from output interface fails or sending the data to input interface fails...
Definition: trap_internal.h:84
+
ifc_autoflush_t * ifc_autoflush_timeout
+
struct msg_header_s msg_header_t
+
void trap_json_print_string(char *str)
Definition: trap.c:670
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
volatile int ifc_change
+
#define TRAP_E_BAD_IFC_INDEX
Interface index out of range.
Definition: trap.h:91
+
uint32_t ifc_idx
Definition: ifc_file.h:80
+
trap_ctx_priv_t * ctx
Definition: ifc_file.h:66
+
Set timeout of automatic buffer flushing for interface, expects uint64_t argument with number of micr...
Definition: trap.h:199
+
void trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1190
+
int service_send_data(int sock_d, uint32_t size, void **data)
Definition: trap.c:2168
+
void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1211
+ +
const char * trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type)
Definition: trap.c:2739
+
static uint16_t get_terminal_width()
Definition: trap.c:833
+
void trap_convert_module_info_to_json(const trap_module_info_t *info)
Definition: trap.c:688
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
uint32_t num_ifc_in
+
#define TRAP_E_FIELDS_MISMATCH
Returned when receiver fields are not subset of sender fields.
Definition: trap.h:98
+
int trap_ctx_vifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
Control TRAP interface.
Definition: trap.c:2032
+ +
Structure for TLS IFC private information.
+
#define TRAP_IFC_TYPE_BLACKHOLE
trap_ifc_dummy blackhole (output)
Definition: trap.h:172
+
const char * trap_ctx_get_last_error_msg(trap_ctx_t *ctx)
Get last (error) message from libtrap context.
Definition: trap.c:2108
+
#define TRAP_E_HELP
Returned by parse_parameters when help is requested.
Definition: trap.h:97
+
char * buffer_pointer
Internal pointer to current message in buffer.
Definition: trap_ifc.h:189
+
TRAP file interfaces.
+
TRAP TCP/IP interfaces private structures.
+
static void handle_outifc_setters(trap_output_ifc_t *ifc, char *params)
Definition: trap.c:1600
+
int trap_ctx_send(trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
Send data via output interface.
Definition: trap.c:1448
+
int trap_update_module_param(trap_module_info_t *m, uint16_t param_id, char shortopt, const char *longopt, const char *desc, int req_arg, const char *arg_type)
Definition: trap.c:203
+
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
Definition: trap.c:2833
+
trap_ctx_priv_t * ctx
+
int trap_get_in_ifc_state(uint32_t ifc_idx)
Definition: trap.c:2734
+
void trap_set_help_section(int level)
Definition: trap.c:324
+
#define UNIX_PATH_FILENAME_FORMAT
Definition: ifc_tcpip.h:64
+
static int trap_read_from_buffer(trap_ctx_priv_t *ctx, uint32_t ifc_idx, const void **data, uint16_t *size, int timeout)
Definition: trap.c:253
+
const char * default_err_msg[256]
Definition: trap_error.c:49
+ + +
static int trapifc_in_construct(trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
Definition: trap.c:1542
+ +
use UNIX socket as a service interface
Definition: ifc_tcpip.h:73
+
char error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
Definition: trap.c:127
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+ +
volatile int terminated
+
int create_blackhole_ifc(trap_ctx_priv_t *ctx, char *params, trap_output_ifc_t *ifc)
Definition: ifc_dummy.c:227
+
void trap_check_global_vars(void)
Definition: trap.c:138
+
uint64_t * counter_dropped_message
+ +
trap_ctx_priv_t * trap_create_ctx_t()
Definition: trap.c:1251
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
static int trapifc_out_construct(trap_ctx_priv_t *ctx, trap_ifc_spec_t *ifc_spec, int idx)
Definition: trap.c:1675
+ +
int create_file_send_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Allocate and initiate file output interface. This function is called by TRAP library to initialize on...
Definition: ifc_file.c:765
+
#define TRAP_HALFWAIT
Definition: trap.h:130
+ +
char ifc_type
Type of interface.
Definition: trap_ifc.h:249
+
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:193
+
#define NEG_RES_FMT_CHANGED
If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) ...
Definition: trap_internal.h:78
+
char * data_fmt_spec
Definition: trap_ifc.h:277
+
void trap_get_internal_buffer(trap_ctx_priv_t *ctx, uint16_t ifc_idx, const void **data, uint32_t *size)
Get pointer to data stored in buffer (with headers) and mark buffer as clean.
Definition: trap.c:599
+
#define VERBOSE(level, format, args...)
+
TRAP TCP/IP interfaces private structures.
+
int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
Definition: trap.c:526
+ +
uint32_t num_ifc_out
+ +
void trap_ctx_vset_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
Definition: trap.c:2516
+
trap_ctx_priv_t * ctx
+
#define DEFAULT_MAX_TERMINAL_WIDTH
Definition: trap_internal.h:62
+
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
Definition: trap_error.h:92
+
int service_get_data(int sock_d, uint32_t size, void **data)
Definition: trap.c:2141
+ +
int trap_finalize()
Definition: trap.c:578
+
uint8_t data[0]
+
trap_in_ifc_state_t client_state
Definition: trap_ifc.h:205
+ +
int trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...)
Control TRAP interface.
Definition: trap.c:1231
+
int create_tls_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tls.c:1883
+
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
#define NEG_RES_CONT
If the data format and data specifier of input and output interface are the same (input interface can...
Definition: trap_internal.h:74
+
void trap_ctx_send_flush(trap_ctx_t *ctx, uint32_t ifc)
Force flush of buffer.
Definition: trap.c:2115
+
uint8_t req_data_type
Definition: trap_ifc.h:223
+
#define TRAP_IFC_TYPE_GENERATOR
trap_ifc_dummy generator (input)
Definition: trap.h:171
+
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
Definition: trap_ifc.h:237
+
int trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx)
Get number of connected clients.
Definition: trap.c:2495
+
void trap_send_flush(uint32_t ifc)
Force flush of buffer.
Definition: trap.c:1241
+
pthread_t service_thread
+
int service_thread_initialized
+
char datatimeout_fixed
Definition: trap_ifc.h:269
+ +
Structure for TCP/IP IFC private information.
+
interface acts as source of data for module
Definition: trap.h:184
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+
int trap_ctx_ifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
Control TRAP interface.
Definition: trap.c:2019
+
#define TRAP_E_BAD_FPARAMS
Bad parameters of function.
Definition: trap.h:92
+
use UNIX socket for local communication
Definition: ifc_tcpip.h:72
+ + +
#define TRAP_E_INITIALIZED
TRAP library already initilized.
Definition: trap.h:89
+
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
Definition: trap_ifc.h:250
+
uint64_t * counter_recv_message
+ +
#define TRAP_IFC_TYPE_TCPIP
trap_ifc_tcpip (input&output part)
Definition: trap.h:173
+
int trap_ctx_finalize(trap_ctx_t **ctx)
Terminate libtrap context and free resources.
Definition: trap.c:1409
+
int trap_ctx_recv(trap_ctx_t *ctx, uint32_t ifcidx, const void **data, uint16_t *size)
Read data from input interface.
Definition: trap.c:1379
+ +
static void handle_inifc_setters(trap_input_ifc_t *ifc, char *params)
Definition: trap.c:1506
+
Structure for TCP/IP IFC client information.
+
use TCP/IP connection
Definition: ifc_tcpip.h:71
+
int trap_ctx_vset_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
Definition: trap.c:2565
+
pthread_mutex_t error_mtx
+
int create_file_recv_ifc(trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
Allocate and initiate file input interface. This function is called by TRAP library to initialize one...
Definition: ifc_file.c:432
+
TRAP TCP/IP interfaces.
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
int32_t datatimeout
Timeout for *_send() calls.
Definition: trap_ifc.h:248
+
uint8_t data_type
Definition: trap_ifc.h:282
+ +
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+
#define SERVICE_GET_COM
Signaling a request for module statistics (interfaces stats - received messages and buffers...
Definition: trap_internal.h:65
+
int32_t datatimeout
Timeout for *_recv() calls.
Definition: trap_ifc.h:191
+ +
char bufferswitch_fixed
Definition: trap_ifc.h:262
+ +
int trap_ctx_get_last_error(trap_ctx_t *ctx)
Get last result code from libtrap context.
Definition: trap.c:2102
+
trap_ctx_priv_t * trap_glob_ctx
Definition: trap.c:120
+
trap_module_info_t * trap_create_module_info(const char *mname, const char *mdesc, int8_t i_ifcs, int8_t o_ifcs, uint16_t param_count)
Definition: trap.c:184
+
#define TRAP_IFC_DELIMITER
Definition: trap.h:160
+
#define NEG_RES_FMT_UNKNOWN
If the output interface has not specified data format.
Definition: trap_internal.h:85
+
uint32_t buffer_unread_bytes
Number of unread bytes in buffer.
Definition: trap_ifc.h:190
+
#define TRAP_IFC_TYPE_TLS
trap_ifc_tls (input&output part)
Definition: trap.h:174
+ +
int trap_ctx_get_data_fmt(trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
Definition: trap.c:2617
+
int trap_get_verbose_level()
Definition: trap.c:663
+ +
const char * trap_last_error_msg
+
void trap_set_verbose_level(int level)
Definition: trap.c:654
+
trap_ctx_t * trap_ctx_init2(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifc_name)
Initialize and return the context of libtrap.
Definition: trap.c:1802
+
const char * trap_help_ifcspec
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
uint64_t * recv_delay_timestamp
+
void * trap_get_global_ctx()
Definition: trap.c:2820
+
#define NEG_RES_FMT_MISMATCH
If the data format or data specifier of input and output interfaces does not match.
Definition: trap_internal.h:77
+
char * service_ifc_name
+
int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
Definition: trap.c:339
+
int trap_free_ifc_spec(trap_ifc_spec_t ifc_spec)
Definition: trap.c:497
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
Enable/disable buffering - could be dangerous on input interface!!! expects char argument with value ...
Definition: trap.h:200
+
int trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout)
Definition: trap.c:618
+
uint64_t * counter_recv_delay_total
+
char datatimeout_fixed
Definition: trap_ifc.h:200
+
char * buffer
Internal pointer to buffer for messages.
Definition: trap_ifc.h:188
+
int64_t timeout
Internal structure to send partial data after timeout (autoflush).
Definition: trap_ifc.h:247
+
int trap_verbose
Definition: trap_internal.c:57
+
Error handling for TRAP.
+
struct hello_msg_header_s hello_msg_header_t
+
#define TRAP_E_MEMORY
Memory allocation error.
Definition: trap.h:104
+ +
#define NEG_RES_OK
Signaling success (hello message successfully sent to input interface)
Definition: trap_internal.h:81
+
char ifc_type
Type of interface.
Definition: trap_ifc.h:192
+
void trap_free_global_vars(void)
Definition: trap.c:171
+
int trap_ctx_terminate(trap_ctx_t *ctx)
Terminate libtrap context.
Definition: trap.c:1342
+
int encode_cnts_to_json(char **data, trap_ctx_priv_t *ctx)
Definition: trap.c:2192
+
void trap_set_data_fmt(uint32_t out_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2693
+
uint32_t data_size
Definition: trap.c:2138
+ +
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+
int create_tcpip_sender_ifc(trap_ctx_priv_t *ctx, const char *params, trap_output_ifc_t *ifc, uint32_t idx, enum tcpip_ifc_sockettype type)
Constructor of output TCP/IP IFC module. This function is called by TRAP library to initialize one ou...
Definition: ifc_tcpip.c:1730
+
void trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path)
Create dump files.
Definition: trap.c:2473
+
uint64_t * counter_recv_buffer
+
int trap_terminate()
Definition: trap.c:563
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+ +
int trap_recv(uint32_t ifcidx, const void **data, uint16_t *size)
Receive data from input interface.
Definition: trap.c:631
+ +
int trap_set_required_fmt(uint32_t in_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2702
+
uint64_t * counter_recv_delay_last
+
#define ifcdir2str(type)
Definition: trap.c:130
+ +
char ** environ
+
static int trap_error(trap_ctx_priv_t *ctx, int err_num)
Definition: trap_error.h:63
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
TRAP dummy interfaces (generator and blackhole)
+
#define DEFAULT_SOCKET_FORMAT
Definition: ifc_tcpip.h:55
+
char ** params
Definition: trap.h:215
+
uint64_t * counter_autoflush
+
#define NEG_RES_RECEIVER_FMT_SUBSET
If the data format of input and output interfaces is the same and data specifier of the input interfa...
Definition: trap_internal.h:75
+
Definition: trap.h:247
+
int create_generator_ifc(trap_ctx_priv_t *ctx, char *params, trap_input_ifc_t *ifc)
Definition: ifc_dummy.c:113
+ +
#define TRAP_E_NOT_SELECTED
Interface was not selected reading/writing.
Definition: trap.h:95
+
#define TRAP_IFC_TYPE_UNIX
trap_ifc_tcpip via UNIX socket(input&output part)
Definition: trap.h:175
+
static uint64_t get_cur_timestamp()
Definition: trap.c:1370
+ +
void trap_print_help(const trap_module_info_t *module_info)
Definition: trap.c:898
+
trap_ctx_t * trap_ctx_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
Initialize and return the context of libtrap.
Definition: trap.c:1786
+
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
#define TRAP_IFC_TYPE_FILE
trap_ifc_file (input&output part)
Definition: trap.h:177
+
char * types
Definition: trap.h:214
+
uint32_t data_fmt_spec_size
+
#define SEND_DATA()
Definition: trap.c:609
+
#define TRAP_NO_AUTO_FLUSH
value to disable autoflushing on output interface
Definition: trap.h:134
+
#define TRAP_WAIT
Definition: trap.h:124
+
static void print_aligned(const char *s, uint16_t align, uint16_t cut)
Definition: trap.c:723
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
uint64_t * counter_send_buffer
+
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
Definition: trap.c:2995
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
#define TRAP_E_NOT_INITIALIZED
TRAP library not initilized.
Definition: trap.h:103
+
void trap_ctx_set_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2551
+
int trap_check_buffer_content(void *buffer, uint32_t buffer_size)
Check content of buffer, iterate over message headers.
Definition: trap.c:222
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
trap_output_ifc_t * out_ifc_list
+
static char * get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Definition: trap.c:1185
+ +
FILE * fd
Definition: ifc_file.h:67
+
Interface of TRAP interfaces.
+
#define TRAP_E_FIELDS_SUBSET
Returned when receivers fields are subset of senders fields and both sets are not identical...
Definition: trap.h:99
+
uint64_t * counter_send_message
+ +
const char trap_git_version[]
+
uint8_t data_type
Definition: trap_ifc.h:210
+
#define SERVICE_OK_REPLY
A value used as a reply signaling success.
Definition: trap_internal.h:67
+
const char trap_version [] __attribute__((used))
+
trap_input_ifc_t * in_ifc_list
+
void * service_thread_routine(void *arg)
Definition: trap.c:2294
+
#define TRAP_E_BADPARAMS
Bad parameters passed to interface initializer.
Definition: trap.h:90
+
#define DEBUG_BUF(X)
+
void trap_print_ifc_spec_help()
Definition: trap.c:1138
+
interface is used for sending data out of module
Definition: trap.h:185
+
#define TRAP_IFC_MESSAGEQ_SIZE
size of message queue used for buffering
Definition: trap.h:206
+
#define TRAP_IFC_TYPE_SERVICE
service ifc
Definition: trap.h:176
+
int trap_send(uint32_t ifcidx, const void *data, uint16_t size)
Send data via output interface.
Definition: trap.c:624
+
char trap_ifc_type_supported[]
Definition: trap.c:107
+
+ + + + diff --git a/doc/libtrap-devel/trap_8h.html b/doc/libtrap-devel/trap_8h.html new file mode 100644 index 00000000..b275c2ce --- /dev/null +++ b/doc/libtrap-devel/trap_8h.html @@ -0,0 +1,543 @@ + + + + + + + +Libtrap: Internal development docs: include/libtrap/trap.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap.h File Reference
+
+
+ +

Interface of TRAP library. +More...

+
#include <stdint.h>
+#include <stdarg.h>
+#include "trap_module_info.h"
+#include "jansson.h"
+
+Include dependency graph for trap.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

struct  trap_ifc_spec_s
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define trap_ctx_t   void
 
#define TRAP_E_OK   0
 Success, no error. More...
 
#define TRAP_E_TIMEOUT   1
 Read or write operation timeout. More...
 
#define TRAP_E_INITIALIZED   10
 TRAP library already initilized. More...
 
#define TRAP_E_BADPARAMS   11
 Bad parameters passed to interface initializer. More...
 
#define TRAP_E_BAD_IFC_INDEX   12
 Interface index out of range. More...
 
#define TRAP_E_BAD_FPARAMS   13
 Bad parameters of function. More...
 
#define TRAP_E_IO_ERROR   14
 IO Error. More...
 
#define TRAP_E_TERMINATED   15
 Interface was terminated during reading/writing. More...
 
#define TRAP_E_NOT_SELECTED   16
 Interface was not selected reading/writing. More...
 
#define TRAP_E_BAD_CERT   17
 Wrong certificate given to TLS interface. More...
 
#define TRAP_E_HELP   20
 Returned by parse_parameters when help is requested. More...
 
#define TRAP_E_FIELDS_MISMATCH   21
 Returned when receiver fields are not subset of sender fields. More...
 
#define TRAP_E_FIELDS_SUBSET   22
 Returned when receivers fields are subset of senders fields and both sets are not identical. More...
 
#define TRAP_E_FORMAT_CHANGED   23
 Returned by trap_recv when format or format spec of the receivers interface has been changed. More...
 
#define TRAP_E_FORMAT_MISMATCH   24
 Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match. More...
 
#define TRAP_E_NEGOTIATION_FAILED   25
 Returned by trap_recv when negotiation of the output and input interfaces failed. More...
 
#define TRAP_E_NOT_INITIALIZED   254
 TRAP library not initilized. More...
 
#define TRAP_E_MEMORY   255
 Memory allocation error. More...
 
#define TRAP_NO_WAIT   0
 
#define TRAP_WAIT   -1
 
#define TRAP_HALFWAIT   -2
 
#define TRAP_TIMEOUT_STR(t)   (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
 
#define TRAP_NO_AUTO_FLUSH   (-1l)
 value to disable autoflushing on output interface More...
 
#define TRAP_IFC_DELIMITER   ','
 
#define TRAP_IFC_PARAM_DELIMITER   ':'
 
#define TRAP_IFC_TYPE_GENERATOR   'g'
 trap_ifc_dummy generator (input) More...
 
#define TRAP_IFC_TYPE_BLACKHOLE   'b'
 trap_ifc_dummy blackhole (output) More...
 
#define TRAP_IFC_TYPE_TCPIP   't'
 trap_ifc_tcpip (input&output part) More...
 
#define TRAP_IFC_TYPE_TLS   'T'
 trap_ifc_tls (input&output part) More...
 
#define TRAP_IFC_TYPE_UNIX   'u'
 trap_ifc_tcpip via UNIX socket(input&output part) More...
 
#define TRAP_IFC_TYPE_SERVICE   's'
 service ifc More...
 
#define TRAP_IFC_TYPE_FILE   'f'
 trap_ifc_file (input&output part) More...
 
#define TRAP_IFC_MESSAGEQ_SIZE   100000
 size of message queue used for buffering More...
 
#define TRAP_DEFAULT_SIGNAL_HANDLER(stop_cmd)
 Define default signal handler function Defines function to handle SIGTERM and SIGINT signals. When a signal is received, it runs the specified command and calls trap_terminate(). Place this macro before your main function. More...
 
#define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER()
 Register default signal handler. Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of SIGTERM and SIGINT signals. Place this macro between TRAP initialization and the main loop. More...
 
#define TRAP_DEFAULT_INITIALIZATION(argc, argv, module_info)
 Initialize TRAP using command-line parameters and handle errors. Generates code that parses command-line parameters using trap_parse_params, intializes TRAP library using trap_init and handle possible errors. It calls exit(1) when an error has occured. Place this macro at the beginning of your main function. More...
 
#define TRAP_DEFAULT_FINALIZATION()   trap_finalize();
 Generate TRAP cleanup code. Only calls trap_finalize function. Place this macro at the end of your main function. More...
 
#define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv(). More...
 
#define TRAP_DEFAULT_RECV_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv. More...
 
#define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send_data. More...
 
#define TRAP_DEFAULT_SEND_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send. More...
 
+ + + +

+Typedefs

typedef struct trap_ifc_spec_s trap_ifc_spec_t
 
+ + + + + + + + + + +

+Enumerations

enum  trap_ifc_type { TRAPIFC_INPUT = 1, +TRAPIFC_OUTPUT = 2 + }
 
enum  trap_data_format_t { TRAP_FMT_UNKNOWN = 0, +TRAP_FMT_RAW = 1, +TRAP_FMT_UNIREC = 2, +TRAP_FMT_JSON = 3 + }
 
enum  trap_in_ifc_state_t { FMT_WAITING = 0, +FMT_OK = 1, +FMT_MISMATCH = 2, +FMT_CHANGED = 3 + }
 
TRAP interface control request
enum  trap_ifcctl_request { TRAPCTL_AUTOFLUSH_TIMEOUT = 1, +TRAPCTL_BUFFERSWITCH = 2, +TRAPCTL_SETTIMEOUT = 3 + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void trap_set_data_fmt (uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_set_required_fmt (uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_get_data_fmt (uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
 
void trap_ctx_set_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
 
void trap_ctx_vset_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_get_in_ifc_state (trap_ctx_t *ctx, uint32_t ifc_idx)
 
int trap_ctx_set_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_vset_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_get_data_fmt (trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
 
const char * trap_get_type_and_name_from_string (const char *source, const char **name, const char **type, int *length_name, int *length_type)
 
int trap_ctx_cmp_data_fmt (const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
 
void * trap_get_global_ctx ()
 
int trap_get_in_ifc_state (uint32_t ifc_idx)
 
int trap_parse_params (int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
 
char * trap_get_param_by_delimiter (const char *source, char **dest, const char delimiter)
 Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter. More...
 
int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
 
int trap_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 
int trap_terminate ()
 
int trap_finalize ()
 
int trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
 
int trap_recv (uint32_t ifcidx, const void **data, uint16_t *size)
 Receive data from input interface. More...
 
int trap_send (uint32_t ifcidx, const void *data, uint16_t size)
 Send data via output interface. More...
 
void trap_set_verbose_level (int level)
 
int trap_get_verbose_level ()
 
void trap_set_help_section (int level)
 
void trap_print_help (const trap_module_info_t *module_info)
 
void trap_print_ifc_spec_help ()
 
int trap_ifcctl (int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
void trap_send_flush (uint32_t ifc)
 Force flush of buffer. More...
 
trap_ctx_ttrap_ctx_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init2 (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init3 (const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
int trap_ctx_finalize (trap_ctx_t **ctx)
 Terminate libtrap context and free resources. More...
 
int trap_ctx_terminate (trap_ctx_t *ctx)
 Terminate libtrap context. More...
 
int trap_ctx_recv (trap_ctx_t *ctx, uint32_t ifc, const void **data, uint16_t *size)
 Read data from input interface. More...
 
int trap_ctx_send (trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
 Send data via output interface. More...
 
void trap_ctx_set_verbose_level (trap_ctx_t *ctx, int level)
 Set verbosity level of library functions. More...
 
int trap_ctx_get_verbose_level (trap_ctx_t *ctx)
 Get verbosity level. More...
 
int trap_ctx_ifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
int trap_ctx_vifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
 Control TRAP interface. More...
 
int trap_ctx_get_last_error (trap_ctx_t *ctx)
 Get last result code from libtrap context. More...
 
const char * trap_ctx_get_last_error_msg (trap_ctx_t *ctx)
 Get last (error) message from libtrap context. More...
 
void trap_ctx_send_flush (trap_ctx_t *ctx, uint32_t ifc)
 Force flush of buffer. More...
 
int trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx)
 Get number of connected clients. More...
 
void trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path)
 Create dump files. More...
 
int output_ifc_negotiation (void *ifc_priv_data, char ifc_type, uint32_t client_idx)
 
int input_ifc_negotiation (void *ifc_priv_data, char ifc_type)
 
+ + + + + + + + + + + + + + + + + +

+Variables

const char trap_version []
 
const char trap_git_version [] = GIT_VERSION
 
char * trap_default_socket_path_format
 
char trap_ifc_type_supported []
 
enum trap_ifc_type __attribute__
 
int trap_last_error
 Code of last error (one of the codes above) More...
 
const char * trap_last_error_msg
 Human-readable message about last error. More...
 
+

Detailed Description

+

Interface of TRAP library.

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
+Tomas Jansky jansk.nosp@m.to1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2013 - 2018
+ +

Definition in file trap.h.

+

Macro Definition Documentation

+ +

◆ trap_ctx_t

+ +
+
+ + + + +
#define trap_ctx_t   void
+
+ +

Definition at line 59 of file trap.h.

+ +
+
+

Function Documentation

+ +

◆ input_ifc_negotiation()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int input_ifc_negotiation (void * ifc_priv_data,
char ifc_type 
)
+
+

Function handles input interface negotiation (receives hello message from output interface with its data format and data specifier and compares it with its own data format and data specifier). Hello message contains message header (data format and data specifier size) and data specifier.

+
Parameters
+ + + +
[in,out]ifc_priv_dataPointer to input interface private structure.
[in]ifc_typeType of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
+
+
+
Returns
NEG_RES_FAILED if receiving the data from output interface fails, NEG_RES_FMT_UNKNOWN if the output interface has not specified data format, NEG_RES_FMT_SUBSET if the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier, NEG_RES_CONT if the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation), NEG_RES_FMT_MISMATCH if the data format or data specifier of input and output interfaces does not match.
+

Receive hello msg header with data_type and data_fmt_spec_size
+
+
+
+ Compare data_type
+
+
+ Receive data_fmt_spec
+
+ Compare data_fmt_spec
+ Save senders data_type and data_fmt_spec

+ +

Definition at line 2995 of file trap.c.

+ +
+
+ +

◆ output_ifc_negotiation()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int output_ifc_negotiation (void * ifc_priv_data,
char ifc_type,
uint32_t client_idx 
)
+
+

Function handles output interface negotiation (sends hello message to input interface with its data format and data specifier). Hello message contains message header (data format and data specifier size) and data specifier.

+
Parameters
+ + + + +
[in]ifc_priv_dataPointer to output interface private structure.
[in]ifc_typeType of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
[in]client_idxIndex of new connected client.
+
+
+
Returns
NEG_RES_FAILED if sending the data to input interface fails, NEG_RES_FMT_UNKNOWN if the output interface has not specified data format, NEG_RES_OK signaling success (hello message successfully sent to input interface).
+

In case of file output interface, return NEG_RES_FMT_UNKNOWN In case of tcpip or unix output interface, send hello message header with format unknown value and return NEG_RES_FMT_UNKNOWN

+ +

Definition at line 2833 of file trap.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap_8h__dep__incl.map b/doc/libtrap-devel/trap_8h__dep__incl.map new file mode 100644 index 00000000..9a173c8b --- /dev/null +++ b/doc/libtrap-devel/trap_8h__dep__incl.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/doc/libtrap-devel/trap_8h__dep__incl.md5 b/doc/libtrap-devel/trap_8h__dep__incl.md5 new file mode 100644 index 00000000..02767a37 --- /dev/null +++ b/doc/libtrap-devel/trap_8h__dep__incl.md5 @@ -0,0 +1 @@ +ae1869867d35503c67eff05baa116e2e \ No newline at end of file diff --git a/doc/libtrap-devel/trap_8h__dep__incl.png b/doc/libtrap-devel/trap_8h__dep__incl.png new file mode 100644 index 00000000..34ff69ab Binary files /dev/null and b/doc/libtrap-devel/trap_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/trap_8h__incl.map b/doc/libtrap-devel/trap_8h__incl.map new file mode 100644 index 00000000..eb5cf805 --- /dev/null +++ b/doc/libtrap-devel/trap_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/doc/libtrap-devel/trap_8h__incl.md5 b/doc/libtrap-devel/trap_8h__incl.md5 new file mode 100644 index 00000000..cc7c2dcc --- /dev/null +++ b/doc/libtrap-devel/trap_8h__incl.md5 @@ -0,0 +1 @@ +267150214398a8a776c25cae7a8ad150 \ No newline at end of file diff --git a/doc/libtrap-devel/trap_8h__incl.png b/doc/libtrap-devel/trap_8h__incl.png new file mode 100644 index 00000000..176295c5 Binary files /dev/null and b/doc/libtrap-devel/trap_8h__incl.png differ diff --git a/doc/libtrap-devel/trap_8h_source.html b/doc/libtrap-devel/trap_8h_source.html new file mode 100644 index 00000000..7dbf7c13 --- /dev/null +++ b/doc/libtrap-devel/trap_8h_source.html @@ -0,0 +1,157 @@ + + + + + + + +Libtrap: Internal development docs: include/libtrap/trap.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap.h
3  * \brief Interface of TRAP library.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkat@cesnet.cz>
6  * \author Tomas Jansky <janskto1@fit.cvut.cz>
7  * \date 2013 - 2018
8  */
9 /*
10  * Copyright (C) 2013 - 2018 CESNET
11  *
12  * LICENSE TERMS
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  * 1. Redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer.
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  * 3. Neither the name of the Company nor the names of its contributors
24  * may be used to endorse or promote products derived from this
25  * software without specific prior written permission.
26  *
27  * ALTERNATIVELY, provided that this notice is retained in full, this
28  * product may be distributed under the terms of the GNU General Public
29  * License (GPL) version 2 or later, in which case the provisions
30  * of the GPL apply INSTEAD OF those given above.
31  *
32  * This software is provided ``as is'', and any express or implied
33  * warranties, including, but not limited to, the implied warranties of
34  * merchantability and fitness for a particular purpose are disclaimed.
35  * In no event shall the company or contributors be liable for any
36  * direct, indirect, incidental, special, exemplary, or consequential
37  * damages (including, but not limited to, procurement of substitute
38  * goods or services; loss of use, data, or profits; or business
39  * interruption) however caused and on any theory of liability, whether
40  * in contract, strict liability, or tort (including negligence or
41  * otherwise) arising in any way out of the use of this software, even
42  * if advised of the possibility of such damage.
43  *
44  */
45 
46 #ifndef _TRAP_H_
47 #define _TRAP_H_
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <stdint.h>
54 #include <stdarg.h>
55 
56 #include "trap_module_info.h"
57 #include "jansson.h"
58 
59 #define trap_ctx_t void
60 
61 /**
62  * \defgroup commonapi Common libtrap API
63  *
64  * This module declares basic public constants, structures and functions of libtrap.
65  * @{
66  */
67 
68 /**
69  * Text string with libtrap version.
70  */
71 extern const char trap_version[];
72 
73 /**
74  * Text string with Git revision of libtrap.
75  */
76 extern const char trap_git_version[];
77 
78 /**
79  * Text string with default path format to sockets (UNIX IFC and service IFC).
80  * Assigned in ifc_tcpip.h
81  */
83 
84 /**
85  * \defgroup errorcodes Error codes
86  * @{*/
87 #define TRAP_E_OK 0 ///< Success, no error
88 #define TRAP_E_TIMEOUT 1 ///< Read or write operation timeout
89 #define TRAP_E_INITIALIZED 10 ///< TRAP library already initilized
90 #define TRAP_E_BADPARAMS 11 ///< Bad parameters passed to interface initializer
91 #define TRAP_E_BAD_IFC_INDEX 12 ///< Interface index out of range
92 #define TRAP_E_BAD_FPARAMS 13 ///< Bad parameters of function
93 #define TRAP_E_IO_ERROR 14 ///< IO Error
94 #define TRAP_E_TERMINATED 15 ///< Interface was terminated during reading/writing
95 #define TRAP_E_NOT_SELECTED 16 ///< Interface was not selected reading/writing
96 #define TRAP_E_BAD_CERT 17 ///< Wrong certificate given to TLS interface
97 #define TRAP_E_HELP 20 ///< Returned by parse_parameters when help is requested
98 #define TRAP_E_FIELDS_MISMATCH 21 ///< Returned when receiver fields are not subset of sender fields
99 #define TRAP_E_FIELDS_SUBSET 22 ///< Returned when receivers fields are subset of senders fields and both sets are not identical
100 #define TRAP_E_FORMAT_CHANGED 23 ///< Returned by trap_recv when format or format spec of the receivers interface has been changed
101 #define TRAP_E_FORMAT_MISMATCH 24 ///< Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match
102 #define TRAP_E_NEGOTIATION_FAILED 25 ///< Returned by trap_recv when negotiation of the output and input interfaces failed
103 #define TRAP_E_NOT_INITIALIZED 254 ///< TRAP library not initilized
104 #define TRAP_E_MEMORY 255 ///< Memory allocation error
105 /**@}*/
106 
107 /**
108  * \defgroup trap_timeout TRAP Timeout
109  *
110  * TRAP IFC works with timeout to decide wether it should block or just wait
111  * for some time.
112  * The timeout is usually in microseconds.
113  * This section lists some special timeout values.
114  * @{
115  */
116 /**
117  * Non-Blocking mode, do not wait ever.
118  */
119 #define TRAP_NO_WAIT 0
120 /**
121  * Blocking mode, wait for client's connection, for message transport to/from
122  * internal system buffer.
123  */
124 #define TRAP_WAIT -1
125 /**
126  * Blocking mode, do not wait for client's connection, clients do not try to
127  * reconnect, there is no recovering of clients during get_data/send_data in this mode.
128  * For input ifc it is the same as TRAP_NO_WAIT.
129  */
130 #define TRAP_HALFWAIT -2
131 
132 #define TRAP_TIMEOUT_STR(t) (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
133 
134 #define TRAP_NO_AUTO_FLUSH (-1l) ///< value to disable autoflushing on output interface
135 
136 /**@}*/
137 
138 /**
139  * \defgroup trapifcspec Specifier of TRAP interfaces
140  * The format of -i parameter of modules sets up TRAP interfaces.
141  * #TRAP_IFC_DELIMITER divides specifier into interfaces.
142  * #TRAP_IFC_PARAM_DELIMITER divides parameters of one interface.
143  *
144  * Each TRAP interface must have the type (\ref ifctypes) as the first parameter.
145  * The following parameters are passed to the interface and they are interface-dependent.
146  *
147  * The format example, let's assume the module has 1 input IFC and 1 output IFC:
148  *
149  * <BLOCKQUOTE>-i t:localhost:7600,u:my_socket</BLOCKQUOTE>
150  *
151  * This sets the input IFC to TCP type and it will connect to localhost, port 7600.
152  * The output IFC will listen on UNIX socket with identifier my_socket.
153  *
154  * @{
155  */
156 
157 /**
158  * Delimiter of TRAP interfaces in IFC specifier
159  */
160 #define TRAP_IFC_DELIMITER ','
161 
162 /**
163  * Delimiter of TRAP interface's parameters in IFC specifier
164  */
165 #define TRAP_IFC_PARAM_DELIMITER ':'
166 
167 /**
168  * \defgroup ifctypes Types of IFC
169  * @{
170  */
171 #define TRAP_IFC_TYPE_GENERATOR 'g' ///< trap_ifc_dummy generator (input)
172 #define TRAP_IFC_TYPE_BLACKHOLE 'b' ///< trap_ifc_dummy blackhole (output)
173 #define TRAP_IFC_TYPE_TCPIP 't' ///< trap_ifc_tcpip (input&output part)
174 #define TRAP_IFC_TYPE_TLS 'T' ///< trap_ifc_tls (input&output part)
175 #define TRAP_IFC_TYPE_UNIX 'u' ///< trap_ifc_tcpip via UNIX socket(input&output part)
176 #define TRAP_IFC_TYPE_SERVICE 's' ///< service ifc
177 #define TRAP_IFC_TYPE_FILE 'f' ///< trap_ifc_file (input&output part)
178 extern char trap_ifc_type_supported[];
179 
180 /**
181  * Type of interface (direction)
182  */
184  TRAPIFC_INPUT = 1, ///< interface acts as source of data for module
185  TRAPIFC_OUTPUT = 2 ///< interface is used for sending data out of module
186 };
187 
188 /**
189  * @}
190  *//* ifctypes */
191 /**
192  * @}
193  *//* trapifcspec */
194 
195 /**
196  * \name TRAP interface control request
197  * @{*/
199  TRAPCTL_AUTOFLUSH_TIMEOUT = 1, ///< Set timeout of automatic buffer flushing for interface, expects uint64_t argument with number of microseconds. It can be set to #TRAP_NO_AUTO_FLUSH to disable autoflush.
200  TRAPCTL_BUFFERSWITCH = 2, ///< Enable/disable buffering - could be dangerous on input interface!!! expects char argument with value 1 (default value after libtrap initialization - enabled) or 0 (for disabling buffering on interface).
201  TRAPCTL_SETTIMEOUT = 3 ///< Set interface timeout (int32_t): in microseconds for non-blocking mode; timeout can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.
202 };
203 /**@}*/
204 
205 #ifndef TRAP_IFC_MESSAGEQ_SIZE
206 #define TRAP_IFC_MESSAGEQ_SIZE 100000 ///< size of message queue used for buffering
207 #endif
208 
209 /** Structure with specification of interface types and their parameters.
210  * This can be filled by command-line parameters using trap_parse_params
211  * function.
212  */
213 typedef struct trap_ifc_spec_s {
214  char *types;
215  char **params;
217 
218 /**
219  * \defgroup trap_mess_fmt Message format
220  * @{
221  */
222 /**
223  * Type of messages that are sent via IFC
224  */
225 typedef enum {
226  /** unknown - message format was not specified yet */
228 
229  /** raw data, no format specified */
231 
232  /** UniRec records */
234 
235  /** structured data serialized using JSON */
238 
239 /**
240  * Possible states of an IFC during data format negotiation.
241  */
242 typedef enum {
243  /** Negotiation is not completed */
245 
246  /** Negotiation was successful */
247  FMT_OK = 1,
248 
249  /** Negotiation failed, format mismatch */
251 
252  /** Negotiation was successful, but receivers (input ifc) template is subset of senders (output ifc) template and missing fields has to be defined */
255 
256 /**
257  * Set format of messages on output IFC.
258  *
259  * \param[in] out_ifc_idx index of output IFC
260  * \param[in] data_type format of messages defined by #trap_data_format_t
261  * \param[in] ... if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
262  * that specifies template is expected
263  */
264 void trap_set_data_fmt(uint32_t out_ifc_idx, uint8_t data_type, ...);
265 
266 /**
267  * Set format of messages expected on input IFC.
268  *
269  * \param[in] in_ifc_idx index of input IFC
270  * \param[in] data_type format of messages defined by #trap_data_format_t
271  * \param[in] ... if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
272  * that specifies template is expected
273  * \return TRAP_E_OK on success
274  */
275 int trap_set_required_fmt(uint32_t in_ifc_idx, uint8_t data_type, ...);
276 
277 /**
278  * Get message format and template that is set on IFC.
279  *
280  * On output IFC it should return the values that were set. On input IFC
281  * it should return format and template that was received.
282  *
283  * \param[in] ifc_dir #trap_ifc_type direction of interface
284  * \param[in] ifc_idx index of IFC
285  * \param[out] data_type format of messages defined by #trap_data_format_t
286  * \param[out] spec Template specifier - UniRec specifier in case of TRAP_FMT_UNIREC data_type, otherwise, it can be any string.
287  * \return TRAP_E_OK on success, on error see trap_ctx_get_data_fmt().
288  */
289 int trap_get_data_fmt(uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec);
290 
291 /**
292  * Set format of messages on output IFC.
293  *
294  * This function is thread safe.
295  *
296  * \param[in,out] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
297  * \param[in] out_ifc_idx Index of output IFC.
298  * \param[in] data_type Format of messages defined by #trap_data_format_t.
299  * \param[in] ... If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
300  * that specifies template (char *) is expected.
301  */
302 void trap_ctx_set_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, ...);
303 
304 /**
305  * Set format of messages on output IFC.
306  *
307  * This function is thread safe.
308  *
309  * \param[in,out] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
310  * \param[in] out_ifc_idx Index of output IFC.
311  * \param[in] data_type Format of messages defined by #trap_data_format_t.
312  * \param[in] ap If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
313  * that specifies template (char *) is expected.
314  */
315 void trap_ctx_vset_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap);
316 
317 /**
318  * Returns current state of an input interface on specified index.
319  *
320  * This function is thread safe.
321  *
322  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
323  * \param[in] ifc_idx Index of the input interface
324  * \return Value of #trap_in_ifc_state_t on success, otherwise TRAP_E_NOT_INITIALIZED when libtrap context is not initialized or
325  * TRAP_E_BAD_IFC_INDEX (ifc_idx >= number of input ifcs).
326  */
327 int trap_ctx_get_in_ifc_state(trap_ctx_t *ctx, uint32_t ifc_idx);
328 
329 /**
330  * Set format of messages expected on input IFC.
331  *
332  * This function is thread safe.
333  *
334  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
335  * \param[in] in_ifc_idx Index of input IFC.
336  * \param[in] data_type Format of messages defined by #trap_data_format_t.
337  * \param[in] ... If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
338  * that specifies template (char *) is expected.
339  * \return TRAP_E_OK on success, on error see #trap_ctx_vset_required_fmt().
340  */
341 int trap_ctx_set_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, ...);
342 
343 /**
344  * Set format of messages expected on input IFC.
345  *
346  * This function is thread safe.
347  *
348  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
349  * \param[in] in_ifc_idx Index of input IFC.
350  * \param[in] data_type Format of messages defined by #trap_data_format_t.
351  * \param[in] ap If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter
352  * that specifies template (char *) is expected.
353  * \return TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED when libtrap context is not initialized, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
354  */
355 int trap_ctx_vset_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap);
356 
357 /**
358  * Get message format and template that is set on IFC.
359  *
360  * On output IFC it should return the values that were set. On input IFC
361  * it should return format and template that was received.
362  * This function is thread safe.
363  *
364  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
365  * \param[in] ifc_dir #trap_ifc_type direction of interface
366  * \param[in] ifc_idx Index of IFC.
367  * \param[out] data_type Format of messages defined by #trap_data_format_t.
368  * \param[out] spec Specifier of data format specifies the template (char *) is expected.
369  * \return TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED if libtrap context is not initialized or negotiation is not successful yet for input IFC, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
370  */
371 int trap_ctx_get_data_fmt(trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec);
372 
373 /**
374  * @}
375  *//* trap_mess_fmt */
376 
377 /**
378  * Parse Fields name and types from string.
379  *
380  * Function parses the source string and sets the given pointers (pointers to source string). Than it sets length of name and type
381  *
382  * \param[in] source Source string to parse.
383  * \param[in] name ouput parameter, where will be set the pointer to name of a field (pointer to source string).
384  * \param[in] type ouput parameter, where will be set the pointer to type of a field (pointer to source string).
385  * \param[in] length_name ouput parameter, where will be set the length of a name.
386  * \param[in] length_type ouput parameter, where will be set the length of a type.
387  * \return pointer to source string, moved to next field
388  */
389 const char *trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type);
390 
391 /**
392  * Compares sender_ifc template and receiver_ifc template
393  * and returns whether receivers template is subset of the senders template.
394  *
395  * \param[in] sender_ifc_data_fmt sender_ifc template (char *)
396  * \param[in] receiver_ifc_data_fmt receiver_ifc template (char *)
397  * \return TRAP_E_OK on success (receivers template is subset of the senders template),
398  * TRAP_E_FIELDS_MISMATCH (receivers template has field which is not in senders template).
399  */
400 int trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt);
401 
402 /**
403  * Returns global context.
404  *
405  * \return pointer to global context.
406  */
407 void *trap_get_global_ctx();
408 
409 /**
410  * Returns current state of an input interface on specified index.
411  *
412  * \param[in] ifc_idx Index of the input interface
413  * \return See #trap_ctx_get_in_ifc_state().
414  */
415 int trap_get_in_ifc_state(uint32_t ifc_idx);
416 
417 /** Parse command-line arguments.
418  * Extract arguments needed by TRAP to set up interfaces (-i params), verbosity
419  * level (-v/-vv/-vvv) and return the rest (argc and argv are modified, i.e.
420  * processed parameter is removed). Extracted information is stored into
421  * ifc_spec. These variables should be passed to trap_init. Data in ifc_spec
422  * must be freed by trap_free_ifc_spec. If help is requested (-h/--help)
423  * TRAP_E_HELP is returned (argc and argv are modified also).
424  * @param[in,out] argc Pointer to number of command-line arguments.
425  * @param[in,out] argv Command-line arguments.
426  * @param[out] ifc_spec Structure with specification of interface types and
427  * their parameters.
428  * @return Error code (0 on success)
429  */
430 int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec);
431 
432 /**
433  * \brief Splitter of *params* string.
434  * Cut the first param, copy it into *dest* and returns pointer to the start of following
435  * parameter.
436  * \param[in] source source string, typically *params*
437  * \param[out] dest destination string, target of first paramater copying
438  * \param[in] delimiter separator of values in *params*
439  * \return Pointer to the start of following parameter (char after delimiter). \note If NULL, no other parameter is present or error during allocation occured.
440  */
441 char *trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter);
442 
443 /**
444  * \brief Check content of buffer, iterate over message headers
445  * \param [in] buffer start of buffer
446  * \param [in] buffer_size size of buffer
447  * \return 0 on success, number of errors otherwise
448  */
449 int trap_check_buffer_content(void *buffer, uint32_t buffer_size);
450 
451 /**
452  * @}
453  *//* commonapi */
454 
455 /*****************************************************************************/
456 /***************************** Library interface *****************************/
457 
458 /**
459  * \defgroup simpleapi Simple API
460  * @{
461  */
462 
463 extern int trap_last_error; ///< Code of last error (one of the codes above)
464 extern const char *trap_last_error_msg; ///< Human-readable message about last error
465 
466 /** Destructor of trap_ifc_spec_t structure.
467  * @param[in] ifc_spec trap_ifc_spec_t structure to clear.
468  * @return Error code (0 on success)
469  */
470 int trap_free_ifc_spec(trap_ifc_spec_t ifc_spec);
471 
472 /** Initialization function.
473  * Create and initialize all interfaces.
474  * @param[in] module_info Pointer to struct containing info about the module.
475  * @param[in] ifc_spec Structure with specification of interface types and
476  * their parameters.
477  * @return Error code (0 on success)
478  */
479 int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec);
480 
481 /** Function to terminate module's operation.
482  * This function stops all read/write operations on all interfaces.
483  * Any waiting in trap_recv() and trap_send()_data is interrupted and these
484  * functions return immediately with TRAP_E_TERMINATED.
485  * Any call of trap_recv() or trap_send() after call of this function
486  * returns TRAP_E_TERMINATED.
487  *
488  * This function is used to terminate module's operation (asynchronously), e.g.
489  * in SIGTERM handler.
490  * @return Always TRAP_E_OK (0).
491  */
492 int trap_terminate();
493 
494 /** Cleanup function.
495  * Disconnect all interfaces and do all necessary cleanup.
496  * @return Error code
497  */
498 int trap_finalize();
499 
500 /** Send data to output interface.
501  * Write data of size `size` given by `data` pointer into interface `ifc`.
502  * If data cannot be written immediately (e.g. because of full buffer or
503  * lost connection), wait until write is possible or `timeout` microseconds
504  * elapses. If `timeout` < 0, wait indefinitely.
505  * @param[in] ifcidx Index of interface to write into.
506  * @param[in] data Pointer to data.
507  * @param[in] size Number of bytes of data.
508  * @param[in] timeout Timeout in microseconds for non-blocking mode; timeout
509  * can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.
510  * @return Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
511  * \deprecated This function should be replaced by trap_send().
512  */
513 int trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout);
514 
515 /**
516  * \brief Receive data from input interface.
517  *
518  * Receive a message from interface specified by `ifcidx` and set
519  * pointer to the `data`.
520  * When function returns due to timeout, contents of `data` and `size` are undefined.
521  *
522  * @param[in] ifcidx Index of input IFC.
523  * @param[out] data Pointer to received data.
524  * @param[out] size Size of received data in bytes of data.
525  * @return Error code - #TRAP_E_OK on success, #TRAP_E_TIMEOUT if timeout elapses.
526  *
527  * \note Data must not be freed! Library stores incomming data into static array and rewrites it during every trap_recv() call.
528  * \see trap_ifcctl() to set timeout (#TRAPCTL_SETTIMEOUT)
529  */
530 int trap_recv(uint32_t ifcidx, const void **data, uint16_t *size);
531 
532 /**
533  * \brief Send data via output interface.
534  *
535  * Send a message given by `data` pointer of `size` message size via interface specified by `ifcidx`
536  * that is the index of output interfaces (counted from 0).
537  *
538  * @param[in] ifcidx Index of input IFC.
539  * @param[out] data Pointer to message to send.
540  * @param[out] size Size of message in bytes.
541  * @return Error code - #TRAP_E_OK on success, #TRAP_E_TIMEOUT if timeout elapses.
542  *
543  * \see trap_ifcctl() to set timeout (#TRAPCTL_SETTIMEOUT)
544  */
545 int trap_send(uint32_t ifcidx, const void *data, uint16_t size);
546 
547 /** Set verbosity level of library functions.
548  * Verbosity levels may be:
549  * - -3 - errors
550  * - -2 - warnings
551  * - -1 - notices (default)
552  * - 0 - verbose
553  * - 1 - more verbose
554  * - 2 - even more verbose
555  *
556  * @param[in] level Desired level of verbosity.
557  */
558 void trap_set_verbose_level(int level);
559 
560 /** Get verbosity level.
561  * See trap_set_verbose_level for list of levels.
562  * @return Verbosity level currently set in the library.
563  */
565 
566 /** Set section for trap_print_help()
567  *
568  * \param [in] level 0 for default info about module, 1 for info about IFC specifier
569  */
570 void trap_set_help_section(int level);
571 
572 /** Print common TRAP help message.
573  * The help message contains information from module_info and describes common
574  * TRAP command-line parameters.
575  * @param[in] module_info Pointer to struct containing info about the module.
576  */
577 void trap_print_help(const trap_module_info_t *module_info);
578 
579 /** Print help about interface specifier.
580  * Prints help message about format of interface specifier and description of
581  * all available interface types.
582  * This message is normally a part of help printed by trap_print_help, this
583  * function is useful when you don't use standard TRAP command-line parameters
584  * but you still use the same format of interface specifier.
585  */
587 
588 /**
589  * \brief Control TRAP interface.
590  *
591  * \note Type and request types were changed from enum because of python wrapper.
592  * \param [in] type #trap_ifc_type direction of interface
593  * \param [in] ifcidx index of TRAP interface
594  * \param [in] request #trap_ifcctl_request type of operation
595  * \param [in,out] ... arguments of request, see #trap_ifcctl_request for more details on requests and their arguments.
596  *
597  * Examples:
598  * \code{C}
599  * // set 4 seconds timeout
600  * trap_ifcctl(TRAPIFC_INPUT, 0, TRAPCTL_SETTIMEOUT, 4000000);
601  * // disable auto-flush
602  * trap_ifcctl(TRAPIFC_OUTPUT, 0, TRAPCTL_AUTOFLUSH_TIMEOUT, TRAP_NO_AUTO_FLUSH);
603  * // disable buffering
604  * trap_ifcctl(TRAPIFC_OUTPUT, 0, TRAPCTL_BUFFERSWITCH, 0);
605  * \endcode
606  *
607  * \return TRAP_E_OK on success
608  */
609 int trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request, ... /* arg */);
610 
611 /**
612  * \brief Force flush of buffer.
613  *
614  * \param[in] ifc IFC Index of interface to write into.
615  */
616 void trap_send_flush(uint32_t ifc);
617 
618 /**
619  * @}
620  *//* basic API */
621 
622 /********** Macros generating pieces of common code **********/
623 
624 /**
625  * \addtogroup contextapi Context API
626  *
627  * This API allows user to use multiple instances of libtrap in the same process.
628  *
629  * The API is similar to \ref simpleapi. The difference is in the private context memory
630  * that is returned by trap_ctx_init() and is freed by trap_ctx_finalize().
631  * Obtained context pointer must be passed to all functions from context API.
632  * @{
633  */
634 
635 /**
636  * \brief Initialize and return the context of libtrap.
637  *
638  * This function is thread safe.
639  *
640  * \param[in] module_info Pointer to struct containing info about the module.
641  * \param[in] ifc_spec Structure with specification of interface types and
642  * their parameters.
643  * \return Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
644  */
645 trap_ctx_t *trap_ctx_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec);
646 
647 /**
648  * \brief Initialize and return the context of libtrap.
649  *
650  * This function is thread safe.
651  *
652  * \param[in] module_info Pointer to struct containing info about the module.
653  * \param[in] ifc_spec Structure with specification of interface types and their parameters.
654  * \param[in] service_ifcname Identifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
655  *
656  * \return Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
657  */
658 trap_ctx_t *trap_ctx_init2(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifcname);
659 
660 /**
661  * \brief Initialize and return the context of libtrap.
662  *
663  * This function is thread safe.
664  *
665  * \param[in] name Name of the NEMEA module (libtrap context).
666  * \param[in] description - Detailed description of the module, can be NULL ("" will be used in such case)
667  * \param[in] i_ifcs Number of input IFCs, it can be -1 if o_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
668  * \param[in] o_ifcs Number of output IFCs, it can be -1 if i_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
669  * \param[in] ifc_spec IFC_SPEC stringdescribed in README.ifcspec.md
670  * \param[in] service_ifcname Identifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
671  *
672  * \return Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
673  */
674 trap_ctx_t *trap_ctx_init3(const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifcname);
675 
676 /**
677  * \brief Terminate libtrap context and free resources.
678  *
679  * This function is thread safe.
680  *
681  * \param[in] ctx Pointer to the private libtrap context data (trap_ctx_init()).
682  * \return TRAP_E_OK on success.
683  */
684 int trap_ctx_finalize(trap_ctx_t **ctx);
685 
686 /**
687  * \brief Terminate libtrap context.
688  *
689  * This function is thread safe.
690  *
691  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
692  * \return TRAP_E_OK on success.
693  */
695 
696 /**
697  * \brief Read data from input interface.
698  *
699  * This function is thread safe.
700  *
701  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
702  * \param[in] ifc Index of input interface (counted from 0).
703  * \param[out] data Pointer to received data.
704  * \param[out] size Size of received data in bytes.
705  *
706  * \return Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
707  * \see #trap_ctx_ifcctl
708  */
709 int trap_ctx_recv(trap_ctx_t *ctx, uint32_t ifc, const void **data, uint16_t *size);
710 
711 /**
712  * \brief Send data via output interface.
713  *
714  * Write data of size `size` given by `data` pointer into interface `ifc`.
715  * If data cannot be written immediately (e.g. because of full buffer or
716  * lost connection), wait until write is possible or `timeout` microseconds
717  * elapses. If `timeout` < 0, wait indefinitely.
718  * This function is thread safe.
719  *
720  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
721  * \param[in] ifc Index of interface to write into.
722  * \param[in] data Pointer to data.
723  * \param[in] size Number of bytes of data.
724  * \return Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
725  * \see #trap_ctx_ifcctl
726  */
727 int trap_ctx_send(trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size);
728 
729 /**
730  * \brief Set verbosity level of library functions.
731  *
732  * Verbosity levels may be:
733  * - -3 - errors
734  * - -2 - warnings
735  * - -1 - notices (default)
736  * - 0 - verbose
737  * - 1 - more verbose
738  * - 2 - even more verbose
739  *
740  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
741  * \param[in] level Desired level of verbosity.
742  */
743 void trap_ctx_set_verbose_level(trap_ctx_t *ctx, int level);
744 
745 /**
746  * \brief Get verbosity level.
747  *
748  * \see #trap_set_verbose_level for the list of levels.
749  *
750  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
751  * \return Verbosity level currently set in the library.
752  */
754 
755 /**
756  * \brief Control TRAP interface.
757  *
758  * This function is thread safe.
759  *
760  * \note Type and request types were changed from enum because of python wrapper.
761  *
762  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
763  * \param [in] type #trap_ifc_type direction of interface
764  * \param [in] ifcidx index of TRAP interface
765  * \param [in] request #trap_ifcctl_request type of operation
766  * \param [in,out] ... arguments of request, see #trap_ifcctl_request for more details on requests and their arguments.
767  *
768  * Examples:
769  * \code{C}
770  * // set 4 seconds timeout
771  * trap_ctx_ifcctl(ctx, TRAPIFC_INPUT, 0, TRAPCTL_SETTIMEOUT, 4000000);
772  * // disable auto-flush
773  * trap_ctx_ifcctl(ctx, TRAPIFC_OUTPUT, 0, TRAPCTL_AUTOFLUSH_TIMEOUT, TRAP_NO_AUTO_FLUSH);
774  * // disable buffering
775  * trap_ctx_ifcctl(ctx, TRAPIFC_OUTPUT, 0, TRAPCTL_BUFFERSWITCH, 0);
776  * \endcode
777  *
778  * \return TRAP_E_OK on success
779  */
780 int trap_ctx_ifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, ... /* arg */);
781 
782 /**
783  * \brief Control TRAP interface.
784  *
785  * This function is thread safe.
786  *
787  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
788  * \param [in] type #trap_ifc_type direction of interface
789  * \param [in] ifcidx index of TRAP interface
790  * \param [in] request #trap_ifcctl_request type of operation
791  * \param [in,out] ap arguments of request.
792  * \return TRAP_E_OK on success
793  *
794  * \see trap_ctx_ifcctl().
795  */
796 int trap_ctx_vifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap);
797 
798 /**
799  * \brief Get last result code from libtrap context.
800  *
801  * This function is thread safe.
802  *
803  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
804  * \return \ref errorcodes
805  */
807 
808 /**
809  * \brief Get last (error) message from libtrap context.
810  *
811  * This function is thread safe.
812  *
813  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
814  * \return Text string with last (error) message from libtrap context.
815  */
816 const char *trap_ctx_get_last_error_msg(trap_ctx_t *ctx);
817 
818 /**
819  * \brief Force flush of buffer.
820  *
821  * This function is thread safe.
822  *
823  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
824  * \param[in] ifc IFC Index of interface to write into.
825  */
826 void trap_ctx_send_flush(trap_ctx_t *ctx, uint32_t ifc);
827 
828 /**
829  * \brief Get number of connected clients.
830  *
831  * Output interface (TCP or UNIX) allows to send messages to multiple clients. This
832  * function reads number of connected clients from internal interface
833  * structure.
834  *
835  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
836  * \param[in] ifcidx IFC Index of output interface.
837  * \return Number of connected clients. -1 on error.
838  */
839 int trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx);
840 
841 /**
842  * \brief Create dump files.
843  *
844  * Create dump files for debug as follows:
845  * trap-i[number]-config.txt Output interface configuration.
846  * trap-i[number]-buffer.dat Output interface buffer
847  * trap-o[number]-config.txt Input interface configuration.
848  * trap-o[number]-buffer.dat Input interface buffer
849  *
850  * \param[in] ctx Pointer to the private libtrap context data (#trap_ctx_init()).
851  * \param[in] path Output directory, if NULL use current working directory.
852  */
853 void trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path);
854 
855 /**
856  * @}
857  *//* contextapi */
858 
859 /**
860  * \defgroup modulemacros Nemea module macros
861  *
862  * Set of preprocessor macros for rapid NEMEA module development.
863  * @{
864  */
865 /** \brief Define default signal handler function
866  * Defines function to handle SIGTERM and SIGINT signals. When a signal is
867  * received, it runs the specified command and calls trap_terminate().
868  * Place this macro before your main function.
869  * \param[in] stop_cmd Command which stops operation of a module. Usually
870  * setting a variable which is tested in module's main loop.
871  */
872 #define TRAP_DEFAULT_SIGNAL_HANDLER(stop_cmd) \
873  void trap_default_signal_handler(int signal)\
874  {\
875  if (signal == SIGTERM || signal == SIGINT) { \
876  stop_cmd;\
877  trap_terminate();\
878  }\
879  }
880 
881 /** \brief Register default signal handler.
882  * Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of
883  * SIGTERM and SIGINT signals.
884  * Place this macro between TRAP initialization and the main loop.
885  */
886 #ifdef HAVE_SIGACTION
887 #define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER() \
888  do {\
889  if (trap_get_verbose_level() >= 1)\
890  printf("Setting signal handler for SIGINT and SIGTERM using 'sigaction' function.\n");\
891  struct sigaction act;\
892  /* Set default signal handler function*/\
893  act.sa_handler = trap_default_signal_handler;\
894  act.sa_flags = 0;\
895  /* Prevent interruption of signal handler by another SIGTERM or SIGINT */\
896  sigemptyset(&act.sa_mask);\
897  sigaddset(&act.sa_mask, SIGTERM);\
898  sigaddset(&act.sa_mask, SIGINT);\
899  /* Register signal hander */\
900  sigaction(SIGTERM, &act, NULL);\
901  sigaction(SIGINT, &act, NULL);\
902  } while(0)
903 #else
904 #define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER() \
905  do {\
906  if (trap_get_verbose_level() >= 1)\
907  printf("Setting signal handler for SIGINT and SIGTERM using 'signal' function.\n");\
908  signal(SIGTERM, trap_default_signal_handler);\
909  signal(SIGINT, trap_default_signal_handler);\
910  } while(0)
911 #endif
912 
913 
914 
915 /** \brief Initialize TRAP using command-line parameters and handle errors.
916  * Generates code that parses command-line parameters using trap_parse_params,
917  * intializes TRAP library using trap_init and handle possible errors.
918  * It calls exit(1) when an error has occured.
919  * Place this macro at the beginning of your main function.
920  * \param[in,out] argc Number of command-line parameters.
921  * \param[in,out] argv List of command-line parameters.
922  * \param[in] module_info trap_module_info_t structure containing information
923  * about the module.
924  */
925 #define TRAP_DEFAULT_INITIALIZATION(argc, argv, module_info) \
926  {\
927  trap_ifc_spec_t ifc_spec;\
928  int ret = trap_parse_params(&argc, argv, &ifc_spec);\
929  if (ret != TRAP_E_OK) {\
930  if (ret == TRAP_E_HELP) {\
931  trap_print_help(&module_info);\
932  FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
933  return 0;\
934  }\
935  trap_free_ifc_spec(ifc_spec);\
936  fprintf(stderr, "ERROR in parsing of parameters for TRAP: %s\n", trap_last_error_msg);\
937  FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
938  return 1;\
939  }\
940  ret = trap_init(&module_info, ifc_spec);\
941  if (ret != TRAP_E_OK) {\
942  trap_free_ifc_spec(ifc_spec);\
943  fprintf(stderr, "ERROR in TRAP initialization: %s\n", trap_last_error_msg);\
944  FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
945  return 1;\
946  }\
947  trap_free_ifc_spec(ifc_spec);\
948  }
949 
950 /** \brief Generate TRAP cleanup code.
951  * Only calls trap_finalize function.
952  * Place this macro at the end of your main function.
953  */
954 #define TRAP_DEFAULT_FINALIZATION() \
955  trap_finalize();
956 
957 /** \brief Handle possible errors after call to trap_recv().
958  * \param[in] ret_code Return code of trap_recv().
959  * \param timeout_cmd Command to run when a timeout has occured, e.g. "continue".
960  * \param error_cmd Command to run when an error has occured or interface was
961  * terminated, e.g. "break".
962  * \deprecated This macro should be replaced by TRAP_DEFAULT_RECV_ERROR_HANDLING.
963  */
964 #define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd) \
965  if ((ret_code) != TRAP_E_OK) {\
966  if ((ret_code) == TRAP_E_TIMEOUT) {\
967  timeout_cmd;\
968  } else if ((ret_code) == TRAP_E_TERMINATED) {\
969  error_cmd;\
970  } else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
971  /* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
972  /* (module can perform some special operations with templates after trap_recv() signals format change) */ \
973  } else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
974  fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
975  error_cmd; \
976  } else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
977  fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
978  error_cmd; \
979  } else {\
980  fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
981  error_cmd;\
982  }\
983  }
984 
985 /** \brief Handle possible errors after call to trap_recv.
986  * \param[in] ret_code Return code of trap_recv.
987  * \param timeout_cmd Command to run when a timeout has occured, e.g. "continue".
988  * \param error_cmd Command to run when an error has occured or interface was
989  * terminated, e.g. "break".
990  */
991 #define TRAP_DEFAULT_RECV_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd) \
992  if ((ret_code) != TRAP_E_OK) {\
993  if ((ret_code) == TRAP_E_TIMEOUT) {\
994  timeout_cmd;\
995  } else if ((ret_code) == TRAP_E_TERMINATED) {\
996  error_cmd;\
997  } else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
998  /* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
999  /* (module can perform some special operations with templates after trap_recv() signals format change) */ \
1000  } else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
1001  fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
1002  error_cmd; \
1003  } else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
1004  fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
1005  error_cmd; \
1006  } else {\
1007  fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
1008  error_cmd;\
1009  }\
1010  }
1011 
1012 
1013 /** \brief Handle possible errors after call to trap_send_data.
1014  * \param[in] ret_code Return code of trap_send_data.
1015  * \param timeout_cmd Command to run when a timeout has occured, e.g. "0" to
1016  * do nothing.
1017  * \param error_cmd Command to run when an error has occured or interface was
1018  * terminated, e.g. "break".
1019  * \deprecated This macro should be replaced by TRAP_DEFAULT_SEND_ERROR_HANDLING.
1020  */
1021 #define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd) \
1022  if ((ret_code) != TRAP_E_OK) {\
1023  if ((ret_code) == TRAP_E_TIMEOUT) {\
1024  timeout_cmd;\
1025  } else if ((ret_code) == TRAP_E_TERMINATED) {\
1026  error_cmd;\
1027  } else {\
1028  fprintf(stderr, "Error: trap_send_data() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
1029  error_cmd;\
1030  }\
1031  }
1032 
1033 /** \brief Handle possible errors after call to trap_send.
1034  * \param[in] ret_code Return code of trap_send.
1035  * \param timeout_cmd Command to run when a timeout has occured, e.g. "0" to
1036  * do nothing.
1037  * \param error_cmd Command to run when an error has occured or interface was
1038  * terminated, e.g. "break".
1039  */
1040 #define TRAP_DEFAULT_SEND_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd) \
1041  if ((ret_code) != TRAP_E_OK) {\
1042  if ((ret_code) == TRAP_E_TIMEOUT) {\
1043  timeout_cmd;\
1044  } else if ((ret_code) == TRAP_E_TERMINATED) {\
1045  error_cmd;\
1046  } else {\
1047  fprintf(stderr, "Error: trap_send() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
1048  error_cmd;\
1049  }\
1050  }
1051 /**
1052  * @}
1053  *//* modulemacros */
1054 
1055 
1056 
1057 /**
1058  * Function handles output interface negotiation (sends hello message to input interface with its data format
1059  * and data specifier). Hello message contains message header (data format and data specifier size) and data specifier.
1060  *
1061  * \param[in] ifc_priv_data Pointer to output interface private structure.
1062  * \param[in] ifc_type Type of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
1063  * \param[in] client_idx Index of new connected client.
1064  *
1065  * \return NEG_RES_FAILED if sending the data to input interface fails,
1066  * NEG_RES_FMT_UNKNOWN if the output interface has not specified data format,
1067  * NEG_RES_OK signaling success (hello message successfully sent to input interface).
1068  */
1069 int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx);
1070 
1071 
1072 /**
1073  * Function handles input interface negotiation (receives hello message from output interface with its data format
1074  * and data specifier and compares it with its own data format and data specifier).
1075  * Hello message contains message header (data format and data specifier size) and data specifier.
1076  *
1077  * \param[in,out] ifc_priv_data Pointer to input interface private structure.
1078  * \param[in] ifc_type Type of IFC, e.g. TRAP_IFC_TYPE_FILE, TRAP_IFC_TYPE_TCPIP, or TRAP_IFC_TYPE_UNIX.
1079  *
1080  * \return NEG_RES_FAILED if receiving the data from output interface fails,
1081  * NEG_RES_FMT_UNKNOWN if the output interface has not specified data format,
1082  * NEG_RES_FMT_SUBSET if the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier,
1083  * NEG_RES_CONT if the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation),
1084  * NEG_RES_FMT_MISMATCH if the data format or data specifier of input and output interfaces does not match.
1085  */
1086 int input_ifc_negotiation(void *ifc_priv_data, char ifc_type);
1087 
1088 
1089 #ifdef __cplusplus
1090 } // extern "C"
1091 #endif
1092 
1093 #endif
void trap_ctx_set_verbose_level(trap_ctx_t *ctx, int level)
Set verbosity level of library functions.
+
int trap_get_data_fmt(uint8_t ifc_dir, uint32_t in_ifc_idx, uint8_t *data_type, const char **spec)
Definition: trap.c:2714
+
int trap_ctx_cmp_data_fmt(const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
Definition: trap.c:2765
+
Set interface timeout (int32_t): in microseconds for non-blocking mode; timeout can be also: TRAP_WAI...
Definition: trap.h:201
+
void trap_ctx_create_ifc_dump(trap_ctx_t *ctx, const char *path)
Create dump files.
Definition: trap.c:2473
+
int trap_ctx_get_in_ifc_state(trap_ctx_t *ctx, uint32_t ifc_idx)
Definition: trap.c:2719
+
int trap_ctx_set_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2602
+
char * trap_get_param_by_delimiter(const char *source, char **dest, const char delimiter)
Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of...
Definition: trap.c:1160
+
trap_ctx_t * trap_ctx_init3(const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifc_name)
Initialize and return the context of libtrap.
Definition: trap.c:1731
+ + + +
#define trap_ctx_t
Definition: trap.h:59
+
void * trap_get_global_ctx()
Definition: trap.c:2820
+
const char trap_version[]
+
int trap_last_error
Code of last error (one of the codes above)
Definition: trap.c:123
+
char * trap_default_socket_path_format
+
const char * trap_last_error_msg
Human-readable message about last error.
Definition: trap.c:125
+
trap_ifc_type
Definition: trap.h:183
+
Set timeout of automatic buffer flushing for interface, expects uint64_t argument with number of micr...
Definition: trap.h:199
+
struct trap_ifc_spec_s trap_ifc_spec_t
+
int trap_ctx_vifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
Control TRAP interface.
Definition: trap.c:2032
+
const char * trap_ctx_get_last_error_msg(trap_ctx_t *ctx)
Get last (error) message from libtrap context.
Definition: trap.c:2108
+
int trap_ctx_send(trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
Send data via output interface.
Definition: trap.c:1448
+
void trap_set_help_section(int level)
Definition: trap.c:324
+
int trap_get_in_ifc_state(uint32_t ifc_idx)
Definition: trap.c:2734
+ +
int trap_ctx_get_client_count(trap_ctx_t *ctx, uint32_t ifcidx)
Get number of connected clients.
Definition: trap.c:2495
+
int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
Definition: trap.c:526
+
void trap_ctx_vset_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
Definition: trap.c:2516
+
uint8_t data[0]
+
int trap_finalize()
Definition: trap.c:578
+
int trap_ifcctl(int8_t type, uint32_t ifcidx, int32_t request,...)
Control TRAP interface.
Definition: trap.c:1231
+
void trap_ctx_send_flush(trap_ctx_t *ctx, uint32_t ifc)
Force flush of buffer.
Definition: trap.c:2115
+
int output_ifc_negotiation(void *ifc_priv_data, char ifc_type, uint32_t client_idx)
Definition: trap.c:2833
+
void trap_send_flush(uint32_t ifc)
Force flush of buffer.
Definition: trap.c:1241
+ +
interface acts as source of data for module
Definition: trap.h:184
+
int trap_ctx_ifcctl(trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
Control TRAP interface.
Definition: trap.c:2019
+
int trap_ctx_finalize(trap_ctx_t **ctx)
Terminate libtrap context and free resources.
Definition: trap.c:1409
+
int trap_ctx_recv(trap_ctx_t *ctx, uint32_t ifcidx, const void **data, uint16_t *size)
Read data from input interface.
Definition: trap.c:1379
+
trap_ifcctl_request
Definition: trap.h:198
+
int trap_ctx_vset_required_fmt(trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
Definition: trap.c:2565
+
int trap_ctx_get_last_error(trap_ctx_t *ctx)
Get last result code from libtrap context.
Definition: trap.c:2102
+
int trap_ctx_get_data_fmt(trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
Definition: trap.c:2617
+
int trap_get_verbose_level()
Definition: trap.c:663
+
void trap_set_verbose_level(int level)
Definition: trap.c:654
+
int input_ifc_negotiation(void *ifc_priv_data, char ifc_type)
Definition: trap.c:2995
+
trap_ctx_t * trap_ctx_init2(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifc_name)
Initialize and return the context of libtrap.
Definition: trap.c:1802
+
int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
Definition: trap.c:339
+
int trap_free_ifc_spec(trap_ifc_spec_t ifc_spec)
Definition: trap.c:497
+
Enable/disable buffering - could be dangerous on input interface!!! expects char argument with value ...
Definition: trap.h:200
+
int trap_send_data(unsigned int ifcidx, const void *data, uint16_t size, int timeout)
Definition: trap.c:618
+ +
int trap_ctx_terminate(trap_ctx_t *ctx)
Terminate libtrap context.
Definition: trap.c:1342
+
void trap_set_data_fmt(uint32_t out_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2693
+
int trap_terminate()
Definition: trap.c:563
+
int trap_recv(uint32_t ifcidx, const void **data, uint16_t *size)
Receive data from input interface.
Definition: trap.c:631
+
int trap_set_required_fmt(uint32_t in_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2702
+ +
trap_data_format_t
Definition: trap.h:225
+
int trap_ctx_get_verbose_level(trap_ctx_t *ctx)
Get verbosity level.
+
char ** params
Definition: trap.h:215
+
Definition: trap.h:247
+ +
void trap_print_help(const trap_module_info_t *module_info)
Definition: trap.c:898
+
trap_ctx_t * trap_ctx_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
Initialize and return the context of libtrap.
Definition: trap.c:1786
+
char * types
Definition: trap.h:214
+
int trap_check_buffer_content(void *buffer, uint32_t buffer_size)
Check content of buffer, iterate over message headers.
Definition: trap.c:222
+
void trap_ctx_set_data_fmt(trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
Definition: trap.c:2551
+
const char * trap_get_type_and_name_from_string(const char *source, const char **name, const char **type, int *length_name, int *length_type)
Definition: trap.c:2739
+
trap_in_ifc_state_t
Definition: trap.h:242
+
const char trap_git_version[]
+
void trap_print_ifc_spec_help()
Definition: trap.c:1138
+
interface is used for sending data out of module
Definition: trap.h:185
+
int trap_send(uint32_t ifcidx, const void *data, uint16_t size)
Send data via output interface.
Definition: trap.c:624
+
+ + + + diff --git a/doc/libtrap-devel/trap__buffer_8c.html b/doc/libtrap-devel/trap__buffer_8c.html new file mode 100644 index 00000000..fe2fbe0a --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8c.html @@ -0,0 +1,384 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_buffer.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_buffer.c File Reference
+
+
+ +

TRAP ring buffer data structure. +More...

+
#include "trap_buffer.h"
+#include <stdint.h>
+#include <inttypes.h>
+
+Include dependency graph for trap_buffer.c:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + + + + + +

+Macros

#define DEBUG_PRINTS   0
 
#define DBG_PRINT(...)
 
#define BLOCKSIZE_TOTAL(tb)   (tb->blocksize + sizeof(tb_block_t))
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static void _tb_block_clear (tb_block_t *bl)
 
static int _tb_block_init (tb_block_t *b)
 
static int _tb_block_destroy (tb_block_t *b)
 
static tb_block_ttb_computenext_blockp (trap_buffer_t *tb, uint16_t curidx)
 
void tb_next_wr_block (trap_buffer_t *tb)
 
void tb_next_rd_block (trap_buffer_t *tb)
 
void tb_first_rd_block (trap_buffer_t *b)
 
void tb_first_wr_block (trap_buffer_t *b)
 
int tb_isblockfree (tb_block_t *b)
 
trap_buffer_ttb_init (uint16_t nblocks, uint32_t blocksize)
 
void tb_destroy (trap_buffer_t **b)
 
int tb_lock (trap_buffer_t *b)
 
int tb_unlock (trap_buffer_t *b)
 
int tb_block_lock (tb_block_t *bl)
 
int tb_block_unlock (tb_block_t *bl)
 
static int _tb_pushmess_checksize (trap_buffer_t *b, tb_block_t **bl, uint32_t ts)
 
int tb_pushmess (trap_buffer_t *b, const void *data, uint16_t size)
 
int tb_pushmess2 (trap_buffer_t *b, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
 
int tb_getmess (trap_buffer_t *b, const void **data, uint16_t *size)
 
void tb_clear_unused (trap_buffer_t *tb)
 
+

Detailed Description

+

TRAP ring buffer data structure.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2016
+ +

Definition in file trap_buffer.c.

+

Macro Definition Documentation

+ +

◆ BLOCKSIZE_TOTAL

+ +
+
+ + + + + + + + +
#define BLOCKSIZE_TOTAL( tb)   (tb->blocksize + sizeof(tb_block_t))
+
+ +

Definition at line 67 of file trap_buffer.c.

+ +
+
+ +

◆ DBG_PRINT

+ +
+
+ + + + + + + + +
#define DBG_PRINT( ...)
+
+ +

Definition at line 64 of file trap_buffer.c.

+ +
+
+ +

◆ DEBUG_PRINTS

+ +
+
+ + + + +
#define DEBUG_PRINTS   0
+
+

Change to 1 to enable debug printing.

+ +

Definition at line 58 of file trap_buffer.c.

+ +
+
+

Function Documentation

+ +

◆ _tb_block_clear()

+ +
+
+ + + + + +
+ + + + + + + + +
static void _tb_block_clear (tb_block_tbl)
+
+inlinestatic
+
+ +

Definition at line 69 of file trap_buffer.c.

+ +
+
+ +

◆ _tb_block_destroy()

+ +
+
+ + + + + +
+ + + + + + + + +
static int _tb_block_destroy (tb_block_tb)
+
+static
+
+ +

Definition at line 88 of file trap_buffer.c.

+ +
+
+ +

◆ _tb_block_init()

+ +
+
+ + + + + +
+ + + + + + + + +
static int _tb_block_init (tb_block_tb)
+
+static
+
+ +

Definition at line 76 of file trap_buffer.c.

+ +
+
+ +

◆ _tb_pushmess_checksize()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int _tb_pushmess_checksize (trap_buffer_tb,
tb_block_t ** bl,
uint32_t ts 
)
+
+inlinestatic
+
+ +

Definition at line 232 of file trap_buffer.c.

+ +
+
+ +

◆ tb_computenext_blockp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static tb_block_t* tb_computenext_blockp (trap_buffer_ttb,
uint16_t curidx 
)
+
+inlinestatic
+
+ +

Definition at line 97 of file trap_buffer.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__buffer_8c__incl.map b/doc/libtrap-devel/trap__buffer_8c__incl.map new file mode 100644 index 00000000..6819f29c --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8c__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/trap__buffer_8c__incl.md5 b/doc/libtrap-devel/trap__buffer_8c__incl.md5 new file mode 100644 index 00000000..13281cb3 --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8c__incl.md5 @@ -0,0 +1 @@ +1eb2787b26339ff9766cc9c6810cc247 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__buffer_8c__incl.png b/doc/libtrap-devel/trap__buffer_8c__incl.png new file mode 100644 index 00000000..42bcc1b9 Binary files /dev/null and b/doc/libtrap-devel/trap__buffer_8c__incl.png differ diff --git a/doc/libtrap-devel/trap__buffer_8c_source.html b/doc/libtrap-devel/trap__buffer_8c_source.html new file mode 100644 index 00000000..de6f7473 --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8c_source.html @@ -0,0 +1,129 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_buffer.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_buffer.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_buffer.c
3  * \brief TRAP ring buffer data structure
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2016
6  */
7 /*
8  * Copyright (C) 2016 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #include "trap_buffer.h"
45 
46 #ifdef UNIT_TESTING
47 #include <stdarg.h>
48 #include <stddef.h>
49 #include <setjmp.h>
50 #include <cmocka.h>
51 #endif
52 #include <stdint.h>
53 #include <inttypes.h>
54 
55 /**
56  * Change to 1 to enable debug printing.
57  */
58 #define DEBUG_PRINTS 0
59 
60 #if DEBUG_PRINTS
61 #include <stdio.h>
62 #define DBG_PRINT(...) printf(__VA_ARGS__)
63 #else
64 #define DBG_PRINT(...)
65 #endif
66 
67 #define BLOCKSIZE_TOTAL(tb) (tb->blocksize + sizeof(tb_block_t))
68 
69 static inline void _tb_block_clear(tb_block_t *bl)
70 {
71  bl->write_data = (char *) bl->data->data;
72  bl->read_data = bl->write_data;
73  bl->data->size = 0;
74 }
75 
76 static int _tb_block_init(tb_block_t *b)
77 {
78  _tb_block_clear(b);
79  b->refcount = 0;
80  int res = pthread_mutex_init(&b->lock, NULL);
81  if (res == 0) {
82  return TB_SUCCESS;
83  } else {
84  return TB_ERROR;
85  }
86 }
87 
89 {
90  if (pthread_mutex_destroy(&b->lock) == 0) {
91  return TB_SUCCESS;
92  } else {
93  return TB_ERROR;
94  }
95 }
96 
97 static inline tb_block_t *tb_computenext_blockp(trap_buffer_t *tb, uint16_t curidx)
98 {
99  uint16_t bi = (curidx + 1) % tb->nblocks;
100  return (tb_block_t *) (tb->mem + (BLOCKSIZE_TOTAL(tb) * bi));
101 }
102 
104 {
105  uint16_t bi = (tb->cur_wr_block_idx + 1) % tb->nblocks;
106  tb_block_t *bp = tb->blocks[bi];
107  DBG_PRINT("move block from %p to idx %" PRIu32 " %p\n", tb->cur_wr_block, bi, bp);
108 
109  tb->cur_wr_block_idx = bi;
110  tb->cur_wr_block = bp;
111 }
112 
114 {
115  uint16_t bi = (tb->cur_rd_block_idx + 1) % tb->nblocks;
116  tb_block_t *bp = tb->blocks[bi];
117  DBG_PRINT("move block from %p to idx %" PRIu32 " %p\n", tb->cur_rd_block, bi, bp);
118 
119  tb->cur_rd_block_idx = bi;
120  tb->cur_rd_block = bp;
121 }
122 
124 {
125  b->cur_rd_block = (tb_block_t *) b->mem;
126  b->cur_rd_block_idx = 0;
127  DBG_PRINT("move block %p\n", b->cur_rd_block);
128 }
129 
131 {
132  b->cur_wr_block = (tb_block_t *) b->mem;
133  b->cur_wr_block_idx = 0;
134  DBG_PRINT("move block %p\n", b->cur_wr_block);
135 }
136 
138 {
139  if (b->data->size == 0) {
140  return TB_SUCCESS;
141  } else {
142  return TB_FULL;
143  }
144 }
145 
146 trap_buffer_t *tb_init(uint16_t nblocks, uint32_t blocksize)
147 {
148  uint16_t i = 0;
149  trap_buffer_t *n = NULL;
150  if (nblocks == 0 || blocksize == 0) {
151  return NULL;
152  }
153  n = malloc(sizeof(trap_buffer_t));
154  if (n == NULL) {
155  return NULL;
156  }
157 
158  n->blocksize = blocksize;
159  n->nblocks = nblocks;
160  n->mem = malloc(nblocks * BLOCKSIZE_TOTAL(n));
161  if (n->mem == NULL) {
162  free(n);
163  return NULL;
164  }
165 
166  n->blocks = malloc(nblocks * sizeof(tb_block_t *));
167  if (n->blocks == NULL) {
168  free(n->mem);
169  free(n);
170  return NULL;
171  }
172 
173  if (pthread_mutex_init(&n->lock, NULL) != 0) {
174  free(n->mem);
175  free(n);
176  return NULL;
177  }
180 
181  tb_block_t *bl = n->cur_wr_block;
182  for (i = 0; i < nblocks; i++) {
183  _tb_block_init(bl);
184  n->blocks[i] = bl;
185  bl = tb_computenext_blockp(n, i);
186  }
187 
188  return n;
189 }
190 
192 {
193  int i;
194  if (b == NULL || (*b) == NULL) {
195  return;
196  }
197 
198  trap_buffer_t *p = (*b);
199 
201  for (i = 0; i < p->nblocks; i++) {
203  tb_next_wr_block(p);
204  }
205 
206  free(p->mem);
207  free(p->blocks);
208  free(p);
209  (*b) = NULL;
210 }
211 
213 {
214  return pthread_mutex_lock(&b->lock);
215 }
216 
218 {
219  return pthread_mutex_unlock(&b->lock);
220 }
221 
223 {
224  return pthread_mutex_lock(&bl->lock);
225 }
226 
228 {
229  return pthread_mutex_unlock(&bl->lock);
230 }
231 
232 static inline int _tb_pushmess_checksize(trap_buffer_t *b, tb_block_t **bl, uint32_t ts)
233 {
234  uint32_t maxsize = (b->blocksize - sizeof(struct tb_block_data_s));
235  tb_block_t *blp = *bl;
236 
237  if (((*bl)->data->size + ts) > maxsize) {
238  DBG_PRINT("No memory for %" PRIu16 " msg, total size: %" PRIu32 ", hdr: %" PRIu32 "\n",
239  size, ((*bl)->data->size + ts), (*bl)->data->size);
240  if (ts > maxsize) {
241  DBG_PRINT("Message is bigger than block.\n");
242  return TB_ERROR;
243  }
244 
245  /* move to the next block in locked time */
246  tb_block_unlock(blp);
247  tb_next_wr_block(b);
248  blp = b->cur_wr_block;
249  tb_block_lock(blp);
250  (*bl) = blp;
251 
252  if (tb_isblockfree(*bl) == TB_FULL) {
253  return TB_FULL;
254  } else {
255  DBG_PRINT("Moved to the next block.\n");
256  return TB_USED_NEWBLOCK;
257  }
258  }
259  return TB_SUCCESS;
260 }
261 
262 int tb_pushmess(trap_buffer_t *b, const void *data, uint16_t size)
263 {
264  int res = TB_SUCCESS;
265 
266  tb_lock(b);
267  tb_block_t *bl = b->cur_wr_block;
268  tb_block_lock(bl);
269  uint32_t ts = size + sizeof(size);
270 
271  res = _tb_pushmess_checksize(b, &bl, ts);
272  tb_unlock(b);
273 
274  if (res == TB_ERROR || res == TB_FULL) {
275  goto exit;
276  }
277 
278  uint16_t *msize = (uint16_t *) bl->write_data;
279  char *p = (char *) (msize + 1);
280  (*msize) = htons(size);
281  memcpy(p, data, size);
282  bl->data->size += size + sizeof(size);
283  bl->write_data += size + sizeof(size);
284  DBG_PRINT("Saved %" PRIu16 " B, total: %" PRIu32 " B\n", size, (bl->data->size + ts));
285 
286 exit:
287  tb_block_unlock(bl);
288  return res;
289 }
290 
291 int tb_pushmess2(trap_buffer_t *b, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
292 {
293  int res = TB_SUCCESS;
294  uint32_t ts = s1 + s2 + sizeof(ts);
295 
296  tb_lock(b);
297  tb_block_t *bl = b->cur_wr_block;
298  tb_block_lock(bl);
299 
300  res = _tb_pushmess_checksize(b, &bl, ts);
301  tb_unlock(b);
302 
303  if (res == TB_ERROR || res == TB_FULL) {
304  goto exit;
305  }
306 
307  uint16_t *msize = (uint16_t *) bl->write_data;
308  char *p = (char *) (msize + 1);
309 
310  (*msize) = htons(ts);
311  memcpy(p, d1, s1);
312  p += s1;
313  memcpy(p, d2, s2);
314  bl->data->size += ts + sizeof(ts);
315  bl->write_data += ts + sizeof(ts);
316  DBG_PRINT("Saved 2-part-msg %" PRIu16 " B, total: %" PRIu32 " B\n", ts, (bl->data->size + ts));
317 
318 exit:
319  tb_block_unlock(bl);
320  return res;
321 }
322 
323 int tb_getmess(trap_buffer_t *b, const void **data, uint16_t *size)
324 {
325  int res = TB_SUCCESS;
326  tb_lock(b);
327  tb_block_t *bl = b->cur_rd_block;
328  tb_block_lock(bl);
329 
330  if (bl->read_data == bl->write_data) {
331  DBG_PRINT("Not enough memory in %" PRIu32 " block for %" PRIu16 " message, total size: %" PRIu32 ", header: %" PRIu32 "\n",
332  b->blocksize, size, (bl->data->size + size + sizeof(size)), bl->data->size);
333  tb_block_unlock(bl);
334  tb_next_rd_block(b);
335  bl = b->cur_rd_block;
336  tb_block_lock(bl);
337  if (bl->read_data >= bl->write_data) {
338  tb_block_unlock(bl);
339  tb_unlock(b);
340  return TB_EMPTY;
341  } else {
342  res = TB_USED_NEWBLOCK;
343  DBG_PRINT("Moved to the next block.\n");
344  }
345  }
346  tb_unlock(b);
347 
348  uint16_t *msize = (uint16_t *) bl->read_data;
349  (*data) = (const void *) (msize + 1);
350  (*size) = ntohs(*msize);
351  bl->read_data += sizeof(uint16_t) + (*size);
352 
353  tb_block_unlock(bl);
354  return res;
355 }
356 
358 {
359  uint16_t i;
360  tb_block_t *bl;
361  tb_lock(tb);
362  for (i = 0; i < tb->nblocks; i++) {
363  bl = tb->blocks[i];
364  tb_block_lock(bl);
365  if (bl->refcount == 0) {
366  _tb_block_clear(bl);
367  }
368  tb_block_unlock(bl);
369  }
370  tb_unlock(tb);
371 }
372 
#define TB_EMPTY
Definition: trap_buffer.h:57
+
uint16_t cur_wr_block_idx
Definition: trap_buffer.h:118
+
int tb_unlock(trap_buffer_t *b)
Definition: trap_buffer.c:217
+
void tb_first_rd_block(trap_buffer_t *b)
Definition: trap_buffer.c:123
+
#define BLOCKSIZE_TOTAL(tb)
Definition: trap_buffer.c:67
+
static tb_block_t * tb_computenext_blockp(trap_buffer_t *tb, uint16_t curidx)
Definition: trap_buffer.c:97
+
int tb_pushmess2(trap_buffer_t *b, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
Definition: trap_buffer.c:291
+
pthread_mutex_t lock
Definition: trap_buffer.h:92
+
#define TB_SUCCESS
Definition: trap_buffer.h:53
+
#define TB_ERROR
Definition: trap_buffer.h:54
+
uint16_t cur_rd_block_idx
Definition: trap_buffer.h:128
+ + +
void tb_next_rd_block(trap_buffer_t *tb)
Definition: trap_buffer.c:113
+
char * read_data
Definition: trap_buffer.h:82
+ +
uint32_t size
Definition: trap_buffer.h:66
+
int tb_block_unlock(tb_block_t *bl)
Definition: trap_buffer.c:227
+
static void _tb_block_clear(tb_block_t *bl)
Definition: trap_buffer.c:69
+
int tb_lock(trap_buffer_t *b)
Definition: trap_buffer.c:212
+
uint16_t refcount
Definition: trap_buffer.h:87
+
uint8_t data[0]
+
static int _tb_block_destroy(tb_block_t *b)
Definition: trap_buffer.c:88
+
void tb_first_wr_block(trap_buffer_t *b)
Definition: trap_buffer.c:130
+
static int _tb_pushmess_checksize(trap_buffer_t *b, tb_block_t **bl, uint32_t ts)
Definition: trap_buffer.c:232
+ +
int tb_pushmess(trap_buffer_t *b, const void *data, uint16_t size)
Definition: trap_buffer.c:262
+
void tb_destroy(trap_buffer_t **b)
Definition: trap_buffer.c:191
+
int tb_block_lock(tb_block_t *bl)
Definition: trap_buffer.c:222
+
tb_block_t ** blocks
Definition: trap_buffer.h:114
+
#define TB_USED_NEWBLOCK
Definition: trap_buffer.h:56
+
static int _tb_block_init(tb_block_t *b)
Definition: trap_buffer.c:76
+
void tb_next_wr_block(trap_buffer_t *tb)
Definition: trap_buffer.c:103
+
void tb_clear_unused(trap_buffer_t *tb)
Definition: trap_buffer.c:357
+
trap_buffer_t * tb_init(uint16_t nblocks, uint32_t blocksize)
Definition: trap_buffer.c:146
+
#define DBG_PRINT(...)
Definition: trap_buffer.c:64
+
uint32_t blocksize
Definition: trap_buffer.h:133
+
tb_block_t * cur_wr_block
Definition: trap_buffer.h:109
+ +
char * write_data
Definition: trap_buffer.h:77
+
uint16_t nblocks
Definition: trap_buffer.h:138
+
#define TB_FULL
Definition: trap_buffer.h:55
+
pthread_mutex_t lock
Definition: trap_buffer.h:143
+
int tb_getmess(trap_buffer_t *b, const void **data, uint16_t *size)
Definition: trap_buffer.c:323
+
int tb_isblockfree(tb_block_t *b)
Definition: trap_buffer.c:137
+
tb_block_t * cur_rd_block
Definition: trap_buffer.h:123
+
struct tb_block_data_s data[0]
Definition: trap_buffer.h:97
+
TRAP ring buffer data structure.
+
+ + + + diff --git a/doc/libtrap-devel/trap__buffer_8h.html b/doc/libtrap-devel/trap__buffer_8h.html new file mode 100644 index 00000000..cb78174e --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h.html @@ -0,0 +1,298 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_buffer.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_buffer.h File Reference
+
+
+ +

TRAP ring buffer data structure. +More...

+
#include <pthread.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+Include dependency graph for trap_buffer.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + + + + + +

+Data Structures

struct  tb_block_data_s
 
struct  tb_block_s
 
struct  trap_buffer_s
 
+ + + + + + + + + + + + + + + + + + + +

+Macros

#define TB_SUCCESS   0
 
#define TB_ERROR   1
 
#define TB_FULL   2
 
#define TB_USED_NEWBLOCK   3
 
#define TB_EMPTY   4
 
#define TB_FLUSH_START(wrb, bl, res)
 
#define TB_FLUSH_END(rdb, bl, s)
 
#define TB_FILL_START(rdb, bl, res)
 
#define TB_FILL_END(rdb, bl, s)
 
+ + + + + +

+Typedefs

typedef struct tb_block_s tb_block_t
 
typedef struct trap_buffer_s trap_buffer_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

trap_buffer_ttb_init (uint16_t nblocks, uint32_t blocksize)
 
void tb_destroy (trap_buffer_t **tb)
 
int tb_lock (trap_buffer_t *tb)
 
int tb_unlock (trap_buffer_t *tb)
 
int tb_block_lock (tb_block_t *bl)
 
int tb_block_unlock (tb_block_t *bl)
 
int tb_isblockfree (tb_block_t *bl)
 
int tb_pushmess (trap_buffer_t *tb, const void *data, uint16_t size)
 
int tb_pushmess2 (trap_buffer_t *tb, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
 
void tb_clear_unused (trap_buffer_t *tb)
 
void tb_next_wr_block (trap_buffer_t *tb)
 
void tb_first_wr_block (trap_buffer_t *tb)
 
int tb_getmess (trap_buffer_t *tb, const void **data, uint16_t *size)
 
void tb_first_rd_block (trap_buffer_t *tb)
 
void tb_next_rd_block (trap_buffer_t *tb)
 
+

Detailed Description

+

TRAP ring buffer data structure.

+
Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2016
+ +

Definition in file trap_buffer.h.

+

Macro Definition Documentation

+ +

◆ TB_EMPTY

+ +
+
+ + + + +
#define TB_EMPTY   4
+
+ +

Definition at line 57 of file trap_buffer.h.

+ +
+
+ +

◆ TB_ERROR

+ +
+
+ + + + +
#define TB_ERROR   1
+
+ +

Definition at line 54 of file trap_buffer.h.

+ +
+
+ +

◆ TB_FULL

+ +
+
+ + + + +
#define TB_FULL   2
+
+ +

Definition at line 55 of file trap_buffer.h.

+ +
+
+ +

◆ TB_SUCCESS

+ +
+
+ + + + +
#define TB_SUCCESS   0
+
+ +

Definition at line 53 of file trap_buffer.h.

+ +
+
+ +

◆ TB_USED_NEWBLOCK

+ +
+
+ + + + +
#define TB_USED_NEWBLOCK   3
+
+ +

Definition at line 56 of file trap_buffer.h.

+ +
+
+

Typedef Documentation

+ +

◆ tb_block_t

+ +
+
+ + + + +
typedef struct tb_block_s tb_block_t
+
+ +
+
+ +

◆ trap_buffer_t

+ +
+
+ + + + +
typedef struct trap_buffer_s trap_buffer_t
+
+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__buffer_8h__dep__incl.map b/doc/libtrap-devel/trap__buffer_8h__dep__incl.map new file mode 100644 index 00000000..4258b34c --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap-devel/trap__buffer_8h__dep__incl.md5 b/doc/libtrap-devel/trap__buffer_8h__dep__incl.md5 new file mode 100644 index 00000000..b010dc16 --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h__dep__incl.md5 @@ -0,0 +1 @@ +bc82751a42501b826045d101304db21f \ No newline at end of file diff --git a/doc/libtrap-devel/trap__buffer_8h__dep__incl.png b/doc/libtrap-devel/trap__buffer_8h__dep__incl.png new file mode 100644 index 00000000..9949aa45 Binary files /dev/null and b/doc/libtrap-devel/trap__buffer_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/trap__buffer_8h__incl.map b/doc/libtrap-devel/trap__buffer_8h__incl.map new file mode 100644 index 00000000..802aaf27 --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/doc/libtrap-devel/trap__buffer_8h__incl.md5 b/doc/libtrap-devel/trap__buffer_8h__incl.md5 new file mode 100644 index 00000000..bb8f3bcf --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h__incl.md5 @@ -0,0 +1 @@ +f086c0e901995c3baf4b3d7f40e92420 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__buffer_8h__incl.png b/doc/libtrap-devel/trap__buffer_8h__incl.png new file mode 100644 index 00000000..d60587c9 Binary files /dev/null and b/doc/libtrap-devel/trap__buffer_8h__incl.png differ diff --git a/doc/libtrap-devel/trap__buffer_8h_source.html b/doc/libtrap-devel/trap__buffer_8h_source.html new file mode 100644 index 00000000..61ec779a --- /dev/null +++ b/doc/libtrap-devel/trap__buffer_8h_source.html @@ -0,0 +1,118 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_buffer.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  0.11.7 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_buffer.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_buffer.h
3  * \brief TRAP ring buffer data structure
4  * \author Tomas Cejka <cejkat@cesnet.cz>
5  * \date 2016
6  */
7 /*
8  * Copyright (C) 2016 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #ifndef TRAP_BUFFER_H
45 #define TRAP_BUFFER_H
46 
47 #include <pthread.h>
48 #include <stdint.h>
49 #include <stdlib.h>
50 #include <string.h>
51 #include <arpa/inet.h>
52 
53 #define TB_SUCCESS 0
54 #define TB_ERROR 1
55 #define TB_FULL 2
56 #define TB_USED_NEWBLOCK 3
57 #define TB_EMPTY 4
58 
59 
61  /**
62  * Size of stored data, it must be always <= (blocksize - sizeof(size)).
63  *
64  * If the size is 0, the block is free.
65  */
66  uint32_t size;
67  /**
68  * Pointer to the beginning of data stored in this block
69  */
70  char data[0];
71 };
72 
73 typedef struct tb_block_s {
74  /**
75  * Pointer to the space for adding new data (to the header of message)
76  */
77  char *write_data;
78 
79  /**
80  * Pointer to the space for adding new data (to the header of message)
81  */
82  char *read_data;
83 
84  /**
85  * Reference counter with non-zero value means that the block is used and cannot be freed.
86  */
87  uint16_t refcount;
88 
89  /**
90  * Lock the block
91  */
92  pthread_mutex_t lock;
93 
94  /**
95  * Pointer to data in the block (to the header of the first message)
96  */
97  struct tb_block_data_s data[0];
98 } tb_block_t;
99 
100 typedef struct trap_buffer_s {
101  /**
102  * Pointer to internal memory containing the whole ring buffer.
103  */
104  char *mem;
105 
106  /**
107  * Pointer to current block
108  */
110 
111  /**
112  * Array of pointers to blocks.
113  */
115  /**
116  * Index of current block to spare computation when moving to next block
117  */
119 
120  /**
121  * Pointer to current block
122  */
124 
125  /**
126  * Index of current block to spare computation when moving to next block
127  */
129 
130  /**
131  * Maximal size of tb_block_data_s element (containing data + 32b header).
132  */
133  uint32_t blocksize;
134 
135  /**
136  * Number of blocks in the buffer.
137  */
138  uint16_t nblocks;
139 
140  /**
141  * Lock the buffer
142  */
143  pthread_mutex_t lock;
144 } trap_buffer_t;
145 
146 /**
147  * \defgroup trap_buffer_general General API
148  * @{
149  */
150 
151 /**
152  * Create a new buffer that will work wit nblocks of block_size.
153  * \param[in] nblocks Number of blocks that will be stored in the ring buffer.
154  * \param[in] blocksize Maximal size of each block.
155  * \return Pointer to the buffer struct, NULL on error.
156  */
157 trap_buffer_t *tb_init(uint16_t nblocks, uint32_t blocksize);
158 
159 /**
160  * Free memory and set the pointer to NULL.
161  * \param[in] tb Pointer to the TRAP buffer.
162  */
163 void tb_destroy(trap_buffer_t **tb);
164 
165 /**
166  * Lock buffer before manipulation.
167  * \param[in] tb Pointer to the TRAP buffer.
168  */
169 int tb_lock(trap_buffer_t *tb);
170 
171 /**
172  * Unlock buffer after manipulation.
173  * \param[in] tb Pointer to the TRAP buffer.
174  */
175 int tb_unlock(trap_buffer_t *tb);
176 
177 /**
178  * Lock block before manipulation.
179  * \param[in] bl Pointer to the TRAP buffer.
180  */
181 int tb_block_lock(tb_block_t *bl);
182 
183 /**
184  * Unlock block after manipulation.
185  */
186 int tb_block_unlock(tb_block_t *bl);
187 
188 /**
189  * Check if the current block is free.
190  *
191  * \param[in] bl Pointer to the block.
192  * \return TB_SUCCESS when the current block is free, TB_FULL if it contains at least one message.
193  */
194 int tb_isblockfree(tb_block_t *bl);
195 
196 /**
197  * @}
198  */
199 
200 /**
201  * \defgroup trap_buffer_send Output IFC
202  * A set of functions used for output IFC (module sends messages).
203  * @{
204  */
205 /**
206  * Push message into the current block
207  * \param[in] tb Pointer to the buffer.
208  * \param[in] data Pointer to the message to send.
209  * \param[in] size Size of the message to send.
210  * \return TB_SUCCESS or TB_USED_NEWBLOCK when the message was stored
211  * successfuly, TB_FULL when there is no place for the message.
212  * TB_USED_NEWBLOCK indicates that the current block was changed.
213  * TB_ERROR means that size is bigger than block size.
214  */
215 int tb_pushmess(trap_buffer_t *tb, const void *data, uint16_t size);
216 
217 /**
218  * Push message (consisting of d1 and d2 parts) into the current block
219  * \param[in] tb Pointer to the buffer.
220  * \param[in] d1 Pointer to the 1st part of the message to send.
221  * \param[in] s1 Size of the 1st part of the message to send.
222  * \param[in] d2 Pointer to the 2nd part of the message to send.
223  * \param[in] s2 Size of the 2nd part of the message to send.
224  * \return TB_SUCCESS or TB_USED_NEWBLOCK when the message was stored
225  * successfuly, TB_FULL when there is no place for the message.
226  * TB_USED_NEWBLOCK indicates that the current block was changed.
227  * TB_ERROR means that size is bigger than block size.
228  */
229 int tb_pushmess2(trap_buffer_t *tb, const void *d1, uint16_t s1, const void *d2, uint16_t s2);
230 
231 /**
232  * Go through all blocks and those which are not used (refcount) mark as free.
233  *
234  * \param[in] tb Pointer to the TRAP buffer.
235  */
237 
238 /**
239  * Move to the next block for writing.
240  *
241  * This function moves cur_block pointer to the next block (it overflows after nblocks).
242  * \param[in] tb Pointer to the TRAP buffer
243  */
245 
246 /**
247  * Move to the first block for writing.
248  *
249  * This function moves cur_block pointer to the first block.
250  * \param[in] tb Pointer to the TRAP buffer
251  */
253 
254 /**
255  * Lock the current free block for getting its content.
256  *
257  * After this code, it is possible to read size and data from bl.
258  * See TB_FLUSH_START() for unlocking the block.
259  *
260  * Pseudocode:
261  * trap_buffer_t *b = tb_init(10, 100000);
262  * tb_block_t *bl;
263  * TB_FILL_START(b, &bl, res);
264  * if (res == TB_SUCCESS) {
265  * s = recv(...);
266  * TB_FILL_END(b, bl, s);
267  * }
268  *
269  * \param[in] wrb Pointer to the buffer.
270  * \param[out] bl Pointer to block (tb_block_t **bl).
271  * \param[out] res Result of TB_FILL_START(), it is set to TB_SUCCESS or TB_FULL.
272  */
273 #define TB_FLUSH_START(wrb, bl, res) do { \
274  tb_lock(wrb); \
275  (*bl) = wrb->cur_rd_block; \
276  tb_block_lock(*bl); \
277  if (tb_isblockfree(*bl) != TB_FULL) { \
278  /* current block is not free, we must unlock and wait */ \
279  tb_block_unlock(*bl); \
280  res = TB_EMPTY; \
281  } else { \
282  res = TB_FULL; \
283  } \
284  tb_unlock(wrb); \
285  } while (0)
286 
287 /**
288  * Unlock the current free block after writing its content.
289  *
290  * It MUST NOT be called when TB_FILL_START() returned TB_FULL.
291  *
292  * \param[in] rdb Pointer to the buffer.
293  * \param[in] bl Pointer to block (tb_block_t *bl).
294  * \param[in] s Size of data written into the block. This will be set into header.
295  */
296 #define TB_FLUSH_END(rdb, bl, s) do { \
297  if (bl->refcount == 0) { \
298  /* block can be marked as empty for next pushmess() */ \
299  bl->data->size = 0; \
300  tb_next_rd_block(rdb); \
301  } \
302  tb_block_unlock(bl); \
303  } while (0)
304 
305 /**
306  * @}
307  */
308 
309 /**
310  * \defgroup trap_buffer_recv Input IFC
311  * A set of functions used for input IFC (module receives messages).
312  * @{
313  */
314 
315 /**
316  * Get message from buffer.
317  * \param[in] tb Pointer to the buffer.
318  * \param[out] data Pointer to read message.
319  * \param[out] size Size of read message.
320  * \return TB_SUCCESS or TB_USED_NEWBLOCK when the message was read
321  * successfuly, TB_EMPTY when there is no message in the buffer to read.
322  * TB_USED_NEWBLOCK indicates that the current block was changed
323  */
324 int tb_getmess(trap_buffer_t *tb, const void **data, uint16_t *size);
325 
326 /**
327  * Move to the first block for reading.
328  *
329  * This function moves cur_block pointer to the first block.
330  * \param[in] tb Pointer to the buffer.
331  */
333 
334 
335 /**
336  * Move to the next block for reading.
337  *
338  * This function moves cur_block pointer to the next block (it overflows after nblocks).
339  * \param[in] tb Pointer to the buffer.
340  */
342 
343 /**
344  * Lock the current free block for writing its content.
345  *
346  * After this code, it is possible to write size and data into bl.
347  * See TB_FILL_END() for unlocking the block.
348  *
349  * Pseudocode:
350  * trap_buffer_t *b = tb_init(10, 100000);
351  * tb_block_t *bl;
352  * TB_FILL_START(b, &bl, res);
353  * if (res == TB_SUCCESS) {
354  * s = recv(...);
355  * TB_FILL_END(b, bl, s);
356  * }
357  *
358  * \param[in] rdb Pointer to the buffer.
359  * \param[out] bl Pointer to block (tb_block_t **bl).
360  * \param[out] res Result of TB_FILL_START(), it is set to TB_SUCCESS or TB_FULL.
361  */
362 #define TB_FILL_START(rdb, bl, res) do { \
363  tb_lock(rdb); \
364  (*bl) = rdb->cur_wr_block; \
365  tb_block_lock(*bl); \
366  if (tb_isblockfree(*bl) == TB_SUCCESS) { \
367  tb_next_wr_block(rdb); \
368  (res) = TB_SUCCESS; \
369  } else { \
370  /* current block is not free, we must unlock and wait */ \
371  tb_block_unlock(*bl); \
372  (res) = TB_FULL; \
373  } \
374  tb_unlock(rdb); \
375  } while (0)
376 
377 /**
378  * Unlock the current free block after writing its content.
379  *
380  * It MUST NOT be called when TB_FILL_START() returned TB_FULL.
381  *
382  * \param[in] rdb Pointer to the buffer.
383  * \param[in] bl Pointer to block (tb_block_t *bl).
384  * \param[in] s Size of data written into the block. This will be set into header.
385  */
386 #define TB_FILL_END(rdb, bl, s) do { \
387  bl->data->size = s; \
388  bl->write_data += s; \
389  bl->read_data = bl->data->data; \
390  tb_block_unlock(bl); \
391  } while (0)
392 
393 /**
394  * @}
395  */
396 
397 #endif
398 
uint16_t cur_wr_block_idx
Definition: trap_buffer.h:118
+
int tb_unlock(trap_buffer_t *tb)
Definition: trap_buffer.c:217
+
void tb_first_rd_block(trap_buffer_t *tb)
Definition: trap_buffer.c:123
+
int tb_pushmess2(trap_buffer_t *tb, const void *d1, uint16_t s1, const void *d2, uint16_t s2)
Definition: trap_buffer.c:291
+
pthread_mutex_t lock
Definition: trap_buffer.h:92
+
uint16_t cur_rd_block_idx
Definition: trap_buffer.h:128
+ + +
void tb_next_rd_block(trap_buffer_t *tb)
Definition: trap_buffer.c:113
+
char * read_data
Definition: trap_buffer.h:82
+ +
uint32_t size
Definition: trap_buffer.h:66
+
int tb_block_unlock(tb_block_t *bl)
Definition: trap_buffer.c:227
+
int tb_lock(trap_buffer_t *tb)
Definition: trap_buffer.c:212
+
uint16_t refcount
Definition: trap_buffer.h:87
+
uint8_t data[0]
+
struct tb_block_s tb_block_t
+
void tb_first_wr_block(trap_buffer_t *tb)
Definition: trap_buffer.c:130
+ +
int tb_pushmess(trap_buffer_t *tb, const void *data, uint16_t size)
Definition: trap_buffer.c:262
+
void tb_destroy(trap_buffer_t **tb)
Definition: trap_buffer.c:191
+
int tb_block_lock(tb_block_t *bl)
Definition: trap_buffer.c:222
+
tb_block_t ** blocks
Definition: trap_buffer.h:114
+
void tb_next_wr_block(trap_buffer_t *tb)
Definition: trap_buffer.c:103
+
void tb_clear_unused(trap_buffer_t *tb)
Definition: trap_buffer.c:357
+
trap_buffer_t * tb_init(uint16_t nblocks, uint32_t blocksize)
Definition: trap_buffer.c:146
+
uint32_t blocksize
Definition: trap_buffer.h:133
+
tb_block_t * cur_wr_block
Definition: trap_buffer.h:109
+ +
char * write_data
Definition: trap_buffer.h:77
+
uint16_t nblocks
Definition: trap_buffer.h:138
+
struct trap_buffer_s trap_buffer_t
+
pthread_mutex_t lock
Definition: trap_buffer.h:143
+
int tb_getmess(trap_buffer_t *tb, const void **data, uint16_t *size)
Definition: trap_buffer.c:323
+
int tb_isblockfree(tb_block_t *bl)
Definition: trap_buffer.c:137
+
tb_block_t * cur_rd_block
Definition: trap_buffer.h:123
+
struct tb_block_data_s data[0]
Definition: trap_buffer.h:97
+
+ + + + diff --git a/doc/libtrap-devel/trap__error_8c.html b/doc/libtrap-devel/trap__error_8c.html new file mode 100644 index 00000000..6003d626 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8c.html @@ -0,0 +1,134 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_error.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_error.c File Reference
+
+
+ +

Error handling for TRAP. +More...

+
#include "trap_error.h"
+
+Include dependency graph for trap_error.c:
+
+
+ + + + + + +
+
+

Go to the source code of this file.

+ + + + +

+Variables

const char * default_err_msg [256]
 
+

Detailed Description

+

Error handling for TRAP.

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2013
+
+2014
+ +

Definition in file trap_error.c.

+

Variable Documentation

+ +

◆ default_err_msg

+ +
+
+ + + + +
const char* default_err_msg[256]
+
+

Default error message for each error code

+ +

Definition at line 49 of file trap_error.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__error_8c__incl.map b/doc/libtrap-devel/trap__error_8c__incl.map new file mode 100644 index 00000000..8e62e403 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8c__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/libtrap-devel/trap__error_8c__incl.md5 b/doc/libtrap-devel/trap__error_8c__incl.md5 new file mode 100644 index 00000000..8e2e7e15 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8c__incl.md5 @@ -0,0 +1 @@ +074016a93a82d3ef837b4ea6996f8341 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__error_8c__incl.png b/doc/libtrap-devel/trap__error_8c__incl.png new file mode 100644 index 00000000..886c59b3 Binary files /dev/null and b/doc/libtrap-devel/trap__error_8c__incl.png differ diff --git a/doc/libtrap-devel/trap__error_8c_source.html b/doc/libtrap-devel/trap__error_8c_source.html new file mode 100644 index 00000000..94266322 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8c_source.html @@ -0,0 +1,83 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_error.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_error.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_error.c
3  * \brief Error handling for TRAP.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkat@cesnet.cz>
6  * \date 2013
7  * \date 2014
8  */
9 /*
10  * Copyright (C) 2013,2014 CESNET
11  *
12  * LICENSE TERMS
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  * 1. Redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer.
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  * 3. Neither the name of the Company nor the names of its contributors
24  * may be used to endorse or promote products derived from this
25  * software without specific prior written permission.
26  *
27  * ALTERNATIVELY, provided that this notice is retained in full, this
28  * product may be distributed under the terms of the GNU General Public
29  * License (GPL) version 2 or later, in which case the provisions
30  * of the GPL apply INSTEAD OF those given above.
31  *
32  * This software is provided ``as is'', and any express or implied
33  * warranties, including, but not limited to, the implied warranties of
34  * merchantability and fitness for a particular purpose are disclaimed.
35  * In no event shall the company or contributors be liable for any
36  * direct, indirect, incidental, special, exemplary, or consequential
37  * damages (including, but not limited to, procurement of substitute
38  * goods or services; loss of use, data, or profits; or business
39  * interruption) however caused and on any theory of liability, whether
40  * in contract, strict liability, or tort (including negligence or
41  * otherwise) arising in any way out of the use of this software, even
42  * if advised of the possibility of such damage.
43  *
44  */
45 
46 #include "trap_error.h"
47 
48 /** Default error message for each error code */
49 const char* default_err_msg[256] = {
50  "No error", // 0 TRAP_E_OK
51  "Read or write operation timeout", // 1 TRAP_E_TIMEOUT
52  0,0,0,0,0,0,0,0, // 2-9 unused
53  "TRAP library already initialized.", // 10 TRAP_E_INITIALIZED
54  "Bad parameters passed to interface initializer.", // 11 TRAP_E_BADPARAMS
55  "Interface index out of range.", // 12 TRAP_E_BAD_IFC_INDEX
56  "Bad parameters of function", // 13 TRAP_E_BAD_FPARAMS
57  "Input/Output error", // 14 TRAP_E_IO_ERROR
58  "Interface was terminated during read/write", // 15 TRAP_E_TERMINATED
59  "Interface was not selected for read/write", // 16 TRAP_E_NOT_SELECTED
60  "TLS certificate verification failed", // 17 TRAP_E_BAD_CERT
61  0,0, // 18-19 unused
62  0,0,0,0,0,0,0,0,0,0, // 20-29 unused
63  0,0,0,0,0,0,0,0,0,0, // 30-39 unused
64  0,0,0,0,0,0,0,0,0,0, // 40-49 unused
65  0,0,0,0,0,0,0,0,0,0, // 50-59 unused
66  0,0,0,0,0,0,0,0,0,0, // 60-69 unused
67  0,0,0,0,0,0,0,0,0,0, // 70-79 unused
68  0,0,0,0,0,0,0,0,0,0, // 80-89 unused
69  0,0,0,0,0,0,0,0,0,0, // 90-99 unused
70  0,0,0,0,0,0,0,0,0,0, // 100-109 unused
71  0,0,0,0,0,0,0,0,0,0, // 110-119 unused
72  0,0,0,0,0,0,0,0,0,0, // 120-129 unused
73  0,0,0,0,0,0,0,0,0,0, // 130-139 unused
74  0,0,0,0,0,0,0,0,0,0, // 140-149 unused
75  0,0,0,0,0,0,0,0,0,0, // 150-159 unused
76  0,0,0,0,0,0,0,0,0,0, // 160-169 unused
77  0,0,0,0,0,0,0,0,0,0, // 170-179 unused
78  0,0,0,0,0,0,0,0,0,0, // 180-189 unused
79  0,0,0,0,0,0,0,0,0,0, // 190-199 unused
80  0,0,0,0,0,0,0,0,0,0, // 200-209 unused
81  0,0,0,0,0,0,0,0,0,0, // 210-219 unused
82  0,0,0,0,0,0,0,0,0,0, // 220-229 unused
83  0,0,0,0,0,0,0,0,0,0, // 230-239 unused
84  0,0,0,0,0,0,0,0,0,0, // 240-249 unused
85  0,0,0,0, // 250-253 unused
86  "TRAP library not initialized", // 254 TRAP_E_NOT_INITIALIZED
87  "Memory allocation error", // 255 TRAP_E_MEMORY
88 };
89 
const char * default_err_msg[256]
Definition: trap_error.c:49
+
Error handling for TRAP.
+
+ + + + diff --git a/doc/libtrap-devel/trap__error_8h.html b/doc/libtrap-devel/trap__error_8h.html new file mode 100644 index 00000000..211b5d44 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h.html @@ -0,0 +1,323 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_error.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_error.h File Reference
+
+
+ +

Error handling for TRAP. +More...

+
#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include "trap_internal.h"
+#include "../include/libtrap/trap.h"
+
+Include dependency graph for trap_error.h:
+
+
+ + + + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + + + + +
+
+

Go to the source code of this file.

+ + + + + + + + +

+Functions

static int trap_error (trap_ctx_priv_t *ctx, int err_num)
 
static int trap_errorf (trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
 
static int trap_errorp (trap_ctx_priv_t *ctx, const char *msg,...)
 
+ + + +

+Variables

const char * default_err_msg [256]
 
+

Detailed Description

+

Error handling for TRAP.

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.to2@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
+Tomas Jansky jansk.nosp@m.to1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2013 - 2018
+ +

Definition in file trap_error.h.

+

Function Documentation

+ +

◆ trap_error()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int trap_error (trap_ctx_priv_tctx,
int err_num 
)
+
+inlinestatic
+
+

Set error with default message.

+
Parameters
+ + + +
[in]ctxlibtrap context
[in]err_numError number as defined in trap.h
+
+
+
Returns
err_num
+ +

Definition at line 63 of file trap_error.h.

+ +
+
+ +

◆ trap_errorf()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static int trap_errorf (trap_ctx_priv_tctx,
int err_num,
const char * msg,
 ... 
)
+
+inlinestatic
+
+

Set error with custom message (printf-like formatting).

+
Parameters
+ + + + + +
[in]ctxlibtrap context
[in]err_numError number as defined in trap.h
[in]msgHuman-readable string describing error, supports printf formatting.
[in]...Additional parameters for printf-like formatting of msg.
+
+
+
Returns
err_num
+ +

Definition at line 92 of file trap_error.h.

+ +
+
+ +

◆ trap_errorp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int trap_errorp (trap_ctx_priv_tctx,
const char * msg,
 ... 
)
+
+inlinestatic
+
+

Prepend given string before current ctx->trap_last_error_msg. This function is useful when a call of some function fails and you want to print a message about it but keep the original message about the error inside the function. Expected usage: return errorp("Call of myFunc failed: ");

+
Parameters
+ + + + +
[in]ctxlibtrap context
[in]msgString to prepend current message
[in]...Additional parameters for printf-like formatting of msg.
+
+
+
Returns
Current value of ctx->trap_last_error
+ +

Definition at line 120 of file trap_error.h.

+ +
+
+

Variable Documentation

+ +

◆ default_err_msg

+ +
+
+ + + + +
const char* default_err_msg[256]
+
+

Default error message for each error code

+ +

Definition at line 49 of file trap_error.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__error_8h__dep__incl.map b/doc/libtrap-devel/trap__error_8h__dep__incl.map new file mode 100644 index 00000000..938c3b99 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h__dep__incl.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/libtrap-devel/trap__error_8h__dep__incl.md5 b/doc/libtrap-devel/trap__error_8h__dep__incl.md5 new file mode 100644 index 00000000..daf96999 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h__dep__incl.md5 @@ -0,0 +1 @@ +de5d3b796e240d5bc085332d30eabb95 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__error_8h__dep__incl.png b/doc/libtrap-devel/trap__error_8h__dep__incl.png new file mode 100644 index 00000000..ae13c489 Binary files /dev/null and b/doc/libtrap-devel/trap__error_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/trap__error_8h__incl.map b/doc/libtrap-devel/trap__error_8h__incl.map new file mode 100644 index 00000000..ef619171 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/trap__error_8h__incl.md5 b/doc/libtrap-devel/trap__error_8h__incl.md5 new file mode 100644 index 00000000..1a7b9a8f --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h__incl.md5 @@ -0,0 +1 @@ +0ab6e03a22c500deeadc8e6507f233ba \ No newline at end of file diff --git a/doc/libtrap-devel/trap__error_8h__incl.png b/doc/libtrap-devel/trap__error_8h__incl.png new file mode 100644 index 00000000..c64ffaca Binary files /dev/null and b/doc/libtrap-devel/trap__error_8h__incl.png differ diff --git a/doc/libtrap-devel/trap__error_8h_source.html b/doc/libtrap-devel/trap__error_8h_source.html new file mode 100644 index 00000000..1fb7a592 --- /dev/null +++ b/doc/libtrap-devel/trap__error_8h_source.html @@ -0,0 +1,93 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_error.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_error.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_error.h
3  * \brief Error handling for TRAP.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkato2@fit.cvut.cz>
6  * \author Tomas Jansky <janskto1@fit.cvut.cz>
7  * \date 2013 - 2018
8  */
9 /*
10  * Copyright (C) 2013 - 2018 CESNET
11  *
12  * LICENSE TERMS
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  * 1. Redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer.
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  * 3. Neither the name of the Company nor the names of its contributors
24  * may be used to endorse or promote products derived from this
25  * software without specific prior written permission.
26  *
27  * ALTERNATIVELY, provided that this notice is retained in full, this
28  * product may be distributed under the terms of the GNU General Public
29  * License (GPL) version 2 or later, in which case the provisions
30  * of the GPL apply INSTEAD OF those given above.
31  *
32  * This software is provided ``as is'', and any express or implied
33  * warranties, including, but not limited to, the implied warranties of
34  * merchantability and fitness for a particular purpose are disclaimed.
35  * In no event shall the company or contributors be liable for any
36  * direct, indirect, incidental, special, exemplary, or consequential
37  * damages (including, but not limited to, procurement of substitute
38  * goods or services; loss of use, data, or profits; or business
39  * interruption) however caused and on any theory of liability, whether
40  * in contract, strict liability, or tort (including negligence or
41  * otherwise) arising in any way out of the use of this software, even
42  * if advised of the possibility of such damage.
43  *
44  */
45 #ifndef _TRAP_ERROR_H_
46 #define _TRAP_ERROR_H_
47 
48 #include <stdarg.h>
49 #include <stdio.h>
50 #include <string.h>
51 
52 #include "trap_internal.h"
53 #include "../include/libtrap/trap.h"
54 
55 extern const char* default_err_msg[256]; // default messages
56 
57 /** Set error with default message.
58  *
59  * @param[in] ctx libtrap context
60  * @param[in] err_num Error number as defined in trap.h
61  * @return err_num
62  */
63 static inline int trap_error(trap_ctx_priv_t *ctx, int err_num)
64 {
65  if (ctx != NULL && ctx->trap_last_error != err_num) {
66  pthread_mutex_lock(&ctx->error_mtx);
67  ctx->trap_last_error = err_num;
68  if (err_num >= 0 &&
69  err_num < sizeof(default_err_msg)/sizeof(char*) &&
70  default_err_msg[err_num] != 0) {
71  ctx->trap_last_error_msg = default_err_msg[err_num];
72  }
73  else {
74  snprintf(ctx->error_msg_buffer, MAX_ERROR_MSG_BUFF_SIZE, "Unknown error (%i).", err_num);
76  }
77  pthread_mutex_unlock(&ctx->error_mtx);
78  }
79 
80  return err_num;
81 }
82 
83 
84 /** Set error with custom message (printf-like formatting).
85  *
86  * @param[in] ctx libtrap context
87  * @param[in] err_num Error number as defined in trap.h
88  * @param[in] msg Human-readable string describing error, supports printf formatting.
89  * @param[in] ... Additional parameters for printf-like formatting of msg.
90  * @return err_num
91  */
92 static inline int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg, ...)
93 {
94  if (ctx != NULL) {
95  pthread_mutex_lock(&ctx->error_mtx);
96  ctx->trap_last_error = err_num;
97  va_list args;
98  va_start(args, msg);
99  vsnprintf(ctx->error_msg_buffer, MAX_ERROR_MSG_BUFF_SIZE, msg, args);
100  va_end(args);
102  pthread_mutex_unlock(&ctx->error_mtx);
103  }
104 
105  return err_num;
106 }
107 
108 /** Prepend given string before current ctx->trap_last_error_msg.
109  * This function is useful when a call of some function fails and you want
110  * to print a message about it but keep the original message about the error
111  * inside the function.
112  * Expected usage:
113  * return errorp("Call of myFunc failed: ");
114  *
115  * @param[in] ctx libtrap context
116  * @param[in] msg String to prepend current message
117  * @param[in] ... Additional parameters for printf-like formatting of msg.
118  * @return Current value of ctx->trap_last_error
119  */
120 static inline int trap_errorp(trap_ctx_priv_t *ctx, const char *msg, ...)
121 {
122  int retval = TRAP_E_BAD_FPARAMS;
123  if (ctx != NULL) {
124  pthread_mutex_lock(&ctx->error_mtx);
125  char tmp_str[MAX_ERROR_MSG_BUFF_SIZE];
126  strcpy(tmp_str, ctx->trap_last_error_msg);
127  va_list args;
128  va_start(args, msg);
129  int n = vsnprintf(ctx->error_msg_buffer, MAX_ERROR_MSG_BUFF_SIZE, msg, args);
130  va_end(args);
131  if (n >= 0 && n < MAX_ERROR_MSG_BUFF_SIZE) {
132  snprintf(ctx->error_msg_buffer + n, MAX_ERROR_MSG_BUFF_SIZE - n, tmp_str, args);
133  }
135  retval = ctx->trap_last_error;
136  pthread_mutex_unlock(&ctx->error_mtx);
137  }
138 
139  return retval;
140 }
141 
142 #endif
#define MAX_ERROR_MSG_BUFF_SIZE
Definition: trap_internal.h:57
+
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+
char error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
+
static int trap_errorp(trap_ctx_priv_t *ctx, const char *msg,...)
Definition: trap_error.h:120
+ +
static int trap_errorf(trap_ctx_priv_t *ctx, int err_num, const char *msg,...)
Definition: trap_error.h:92
+ +
#define TRAP_E_BAD_FPARAMS
Bad parameters of function.
Definition: trap.h:92
+
pthread_mutex_t error_mtx
+
const char * trap_last_error_msg
+
static int trap_error(trap_ctx_priv_t *ctx, int err_num)
Definition: trap_error.h:63
+
const char * default_err_msg[256]
Definition: trap_error.c:49
+
+ + + + diff --git a/doc/libtrap-devel/trap__ifc_8h.html b/doc/libtrap-devel/trap__ifc_8h.html new file mode 100644 index 00000000..e6c9f88a --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h.html @@ -0,0 +1,187 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_ifc.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_ifc.h File Reference
+
+
+ +

Interface of TRAP interfaces. +More...

+
#include <stdint.h>
+#include <sys/time.h>
+#include <pthread.h>
+#include <semaphore.h>
+
+Include dependency graph for trap_ifc.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + + + + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + + + +

+Data Structures

struct  trap_input_ifc_s
 
struct  trap_output_ifc_s
 
+ + + +

+Macros

#define TRAP_IFC_DEFAULT_MAX_CLIENTS   64
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef int(* ifc_recv_func_t) (void *p, void *d, uint32_t *s, int t)
 
typedef int(* ifc_send_func_t) (void *p, const void *d, uint16_t s, int t)
 
typedef void(* ifc_flush_func_t) (void *p)
 
typedef void(* ifc_disconn_clients_func_t) (void *p)
 
typedef void(* ifc_terminate_func_t) (void *p)
 
typedef void(* ifc_destroy_func_t) (void *p)
 
typedef void(* ifc_create_dump_func_t) (void *p, uint32_t i, const char *d)
 
typedef int32_t(* ifc_get_client_count_func_t) (void *p)
 
typedef int8_t(* ifc_get_client_stats_json_func_t) (void *p, json_t *client_stats_arr)
 
typedef char *(* ifc_get_id_func_t) (void *priv)
 
typedef uint8_t(* ifc_is_conn_func_t) (void *priv)
 
typedef struct trap_input_ifc_s trap_input_ifc_t
 
typedef struct trap_output_ifc_s trap_output_ifc_t
 
+ + + + + + + +

+Functions

void trap_set_timeouts (int timeout, struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
void trap_set_abs_timespec (struct timeval *tm, struct timespec *tmnblk)
 Internal function for setting of timeout structs according to libtrap timeout. More...
 
+

Detailed Description

+
+ + + + diff --git a/doc/libtrap-devel/trap__ifc_8h__dep__incl.map b/doc/libtrap-devel/trap__ifc_8h__dep__incl.map new file mode 100644 index 00000000..11bd7651 --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h__dep__incl.map @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/doc/libtrap-devel/trap__ifc_8h__dep__incl.md5 b/doc/libtrap-devel/trap__ifc_8h__dep__incl.md5 new file mode 100644 index 00000000..ac5f8efd --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h__dep__incl.md5 @@ -0,0 +1 @@ +c94c53e95f7932555a0dce3b29e3f562 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__ifc_8h__dep__incl.png b/doc/libtrap-devel/trap__ifc_8h__dep__incl.png new file mode 100644 index 00000000..c3a9b9af Binary files /dev/null and b/doc/libtrap-devel/trap__ifc_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/trap__ifc_8h__incl.map b/doc/libtrap-devel/trap__ifc_8h__incl.map new file mode 100644 index 00000000..8f4019c3 --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/doc/libtrap-devel/trap__ifc_8h__incl.md5 b/doc/libtrap-devel/trap__ifc_8h__incl.md5 new file mode 100644 index 00000000..4343e59e --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h__incl.md5 @@ -0,0 +1 @@ +5a39066414c4fee23d766e80ef481447 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__ifc_8h__incl.png b/doc/libtrap-devel/trap__ifc_8h__incl.png new file mode 100644 index 00000000..62cdbedb Binary files /dev/null and b/doc/libtrap-devel/trap__ifc_8h__incl.png differ diff --git a/doc/libtrap-devel/trap__ifc_8h_source.html b/doc/libtrap-devel/trap__ifc_8h_source.html new file mode 100644 index 00000000..768ee330 --- /dev/null +++ b/doc/libtrap-devel/trap__ifc_8h_source.html @@ -0,0 +1,138 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_ifc.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_ifc.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_ifc.h
3  * \brief Interface of TRAP interfaces.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkat@cesnet.cz>
6  * \author Jan Neuzil <neuzija1@fit.cvut.cz>
7  * \author Marek Svepes <svepemar@fit.cvut.cz>
8  * \author Tomas Jansky <janskto1@fit.cvut.cz>
9  * \date 2013 -2018
10  */
11 /*
12  * Copyright (C) 2013-2018 CESNET
13  *
14  * LICENSE TERMS
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions
18  * are met:
19  * 1. Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  * 2. Redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in
23  * the documentation and/or other materials provided with the
24  * distribution.
25  * 3. Neither the name of the Company nor the names of its contributors
26  * may be used to endorse or promote products derived from this
27  * software without specific prior written permission.
28  *
29  * ALTERNATIVELY, provided that this notice is retained in full, this
30  * product may be distributed under the terms of the GNU General Public
31  * License (GPL) version 2 or later, in which case the provisions
32  * of the GPL apply INSTEAD OF those given above.
33  *
34  * This software is provided ``as is'', and any express or implied
35  * warranties, including, but not limited to, the implied warranties of
36  * merchantability and fitness for a particular purpose are disclaimed.
37  * In no event shall the company or contributors be liable for any
38  * direct, indirect, incidental, special, exemplary, or consequential
39  * damages (including, but not limited to, procurement of substitute
40  * goods or services; loss of use, data, or profits; or business
41  * interruption) however caused and on any theory of liability, whether
42  * in contract, strict liability, or tort (including negligence or
43  * otherwise) arising in any way out of the use of this software, even
44  * if advised of the possibility of such damage.
45  *
46  */
47 #ifndef _TRAP_IFC_H_
48 #define _TRAP_IFC_H_
49 
50 #include <stdint.h>
51 #include <sys/time.h>
52 #include <pthread.h>
53 #include <semaphore.h>
54 
55 /** \defgroup trap_ifc TRAP communication module interface
56  * @{
57  */
58 
59 /**
60  * Default max number of clients that can connect to output interface.
61  * It takes effect when no value is given during interface initialization.
62  */
63 #ifndef TRAP_IFC_DEFAULT_MAX_CLIENTS
64 #define TRAP_IFC_DEFAULT_MAX_CLIENTS 64
65 #endif
66 
67 /**
68  * \defgroup trap_ifc_api IFC API
69  *
70  * The set of function that must be implemented for communication interface.
71  * @{
72  */
73 /**
74  * Receive one message via this IFC.
75  *
76  * This function is called from trap_read_from_buffer() when there is a
77  * need to get new data.
78  *
79  * \param[in] p pointer to IFC's private memory allocated by constructor
80  * \param[out] d pointer to memory where this IFC can write received message
81  * \param[out] s size (in bytes) of received message (must be set by this IFC)
82  * \param[in] t timeout, see \ref trap_timeout
83  * \returns TRAP_E_OK on success
84  */
85 typedef int (*ifc_recv_func_t)(void *p, void *d, uint32_t *s, int t);
86 
87 /**
88  * Send one message via this IFC.
89  *
90  * This function is called from trap_store_into_buffer() when there is a
91  * need to send new data.
92  *
93  * \param[in] p pointer to IFC's private memory allocated by constructor
94  * \param[in] d pointer to message that will be sent
95  * \param[in] s size (in bytes) of message that will be sent
96  * \param[in] t timeout, see \ref trap_timeout
97  * \returns TRAP_E_OK on success
98  */
99 typedef int (*ifc_send_func_t)(void *p, const void *d, uint16_t s, int t);
100 
101 /**
102  * Force flush on interface
103  *
104  * \param[in] p pointer to IFC's private memory allocated by constructor
105  */
106 typedef void (*ifc_flush_func_t)(void *p);
107 
108 /**
109  * Disconnect all connected clients to output IFC.
110  *
111  * \param[in] p pointer to IFC's private memory allocated by constructor
112  */
113 typedef void (*ifc_disconn_clients_func_t)(void *p);
114 
115 /**
116  * Terminate IFC - stop sending/receiving.
117  *
118  * \param[in] p pointer to IFC's private memory allocated by constructor
119  */
120 typedef void (*ifc_terminate_func_t)(void *p);
121 
122 /**
123  * Destructor, called to free allocated memory.
124  *
125  * \param[in,out] p pointer to IFC's private memory allocated by constructor
126  */
127 typedef void (*ifc_destroy_func_t)(void *p);
128 
129 /**
130  * Create dump of interface for debug purposes.
131  *
132  * \param[in] p pointer to IFC's private memory allocated by constructor
133  * \param[in] i index of interface (index into the IFC array in the context
134  * #trap_ctx_priv_s)
135  * \param[in] d directory path to generate output
136  */
137 typedef void (*ifc_create_dump_func_t)(void *p, uint32_t i, const char *d);
138 
139 /**
140  * Get number of connected clients.
141  *
142  * \param[in] p pointer to IFC's private memory allocated by constructor
143  * \returns number of clients that are connected to this IFC
144  */
145 typedef int32_t (*ifc_get_client_count_func_t)(void *p);
146 
147 /**
148  * Get json array with client statistics
149  *
150  * \param[in] p pointer to IFC's private memory allocated by constructor
151  * \param[out] client_stats_arr pointer to JSON array to be filled with client statistics
152  * \returns 1 (TRUE) on success, otherwise 0 (FALSE)
153  */
154 typedef int8_t (*ifc_get_client_stats_json_func_t)(void *p, json_t *client_stats_arr);
155 
156 /**
157  * Get identifier of the interface
158  *
159  * \param[in] priv pointer to IFC's private memory allocated by constructor
160  * \returns pointer to char (private memory of the ifc - do not free!).
161  * TCP and UNIXSOCKET ifces return port and name of socket, file ifc returns name of the file,
162  * GENERATOR and BLACKHOLE ifces return NULL.
163  */
164 typedef char * (*ifc_get_id_func_t)(void *priv);
165 
166 /**
167  * Check whether the input interface is connected
168  *
169  * \param[in] priv pointer to IFC's private memory allocated by constructor
170  * \returns 1 (TRUE) if connected, otherwise 0 (FALSE)
171  */
172 typedef uint8_t (*ifc_is_conn_func_t)(void *priv);
173 
174 
175 /**
176  * @}
177  */
178 
179 /** Struct to hold an instance of some input interface. */
180 typedef struct trap_input_ifc_s {
181  ifc_is_conn_func_t is_conn; ///< Pointer to is_connected function
182  ifc_get_id_func_t get_id; ///< Pointer to get_id function
183  ifc_recv_func_t recv; ///< Pointer to receive function
184  ifc_terminate_func_t terminate; ///< Pointer to terminate function
185  ifc_destroy_func_t destroy; ///< Pointer to destructor function
186  ifc_create_dump_func_t create_dump; ///< Pointer to function for generating of dump
187  void *priv; ///< Pointer to instance's private data
188  char *buffer; ///< Internal pointer to buffer for messages
189  char *buffer_pointer; ///< Internal pointer to current message in buffer
190  uint32_t buffer_unread_bytes; ///< Number of unread bytes in buffer.
191  int32_t datatimeout; ///< Timeout for *_recv() calls
192  char ifc_type; ///< Type of interface
193  pthread_mutex_t ifc_mtx; ///< Locking mutex for interface.
194 
195  /**
196  * If 1 do not allow to change timeout by module, it is used to force
197  * timeout of IFC by module's parameter. If 0 - timeout can be changed
198  * by standard way using trap_ctx_ifcctl().
199  */
201 
202  /**
203  * Negotiation state defined as #trap_in_ifc_state_t.
204  */
206 
207  /**
208  * Message format defined by trap_data_format_t.
209  */
210  uint8_t data_type;
211 
212  /**
213  * Message format specifier.
214  *
215  * if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise,
216  * data_fmt_spec contains e.g. UniRec template specifier (string representation)
217  */
219 
220  /**
221  * Required message format defined by trap_data_format_t
222  */
223  uint8_t req_data_type;
224 
225  /**
226  * Required message format specifier.
227  *
228  * if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise,
229  * data_fmt_spec contains e.g. UniRec template specifier (string representation)
230  */
233 
234 /** Struct to hold an instance of some output interface. */
235 typedef struct trap_output_ifc_s {
236  ifc_get_id_func_t get_id; ///< Pointer to get_id function
237  ifc_disconn_clients_func_t disconn_clients; ///< Pointer to disconnect_clients function
238  ifc_send_func_t send; ///< Pointer to send function
239  ifc_flush_func_t flush; ///< Pointer to flush function
240  ifc_terminate_func_t terminate; ///< Pointer to terminate function
241  ifc_destroy_func_t destroy; ///< Pointer to destructor function
242  ifc_create_dump_func_t create_dump; ///< Pointer to function for generating of dump
243  ifc_get_client_count_func_t get_client_count; ///< Pointer to get_client_count function
244  ifc_get_client_stats_json_func_t get_client_stats_json; ///< Pointer to get_client_stats_json function
245  void *priv; ///< Pointer to instance's private data
246  pthread_mutex_t ifc_mtx; ///< Locking mutex for interface.
247  int64_t timeout; ///< Internal structure to send partial data after timeout (autoflush).
248  int32_t datatimeout; ///< Timeout for *_send() calls
249  char ifc_type; ///< Type of interface
250  char bufferswitch; ///< Enable (1) or Disable (0) buffering, default is Enabled (1).
251 
252  /**
253  * If 1 do not allow to change autoflush timeout by module. If 0 - autoflush can
254  * be changed by standard way using trap_ctx_ifcctl().
255  */
257 
258  /**
259  * If 1 do not allow to change bufferswitch by module. If 0 - bufferswitch can
260  * be changed by standard way using trap_ctx_ifcctl().
261  */
263 
264  /**
265  * If 1 do not allow to change timeout by module, it is used to force
266  * timeout of IFC by module's parameter. If 0 - timeout can be changed
267  * by standard way using trap_ctx_ifcctl().
268  */
270 
271  /**
272  * Message format specifier.
273  *
274  * if data_type is TRAP_FMT_RAW, no data_fmt_spec is expected. Otherwise,
275  * data_fmt_spec contains e.g. UniRec template specifier (string representation)
276  */
278 
279  /**
280  * Message format defined by trap_data_format_t
281  */
282  uint8_t data_type;
284 
285 /**
286  * \brief Internal function for setting of timeout structs according to libtrap timeout.
287  *
288  * \param[in] timeout timeout in microseconds, or \ref trap_timeout
289  * \param[out] tm used for select() call when non-blocking
290  * \param[out] tmnblk used for sem_timedwait() call to block on semaphore.
291  */
292 void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk);
293 
294 /**
295  * \brief Internal function for setting of timeout structs according to libtrap timeout.
296  *
297  * \param[in] tm Precomputed timeval, set using e.g. trap_set_timeouts().
298  * \param[out] tmnblk Used for sem_timedwait() call to block on semaphore.
299  */
300 void trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk);
301 
302 /**
303  * @}
304  */
305 #endif
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:182
+
int(* ifc_send_func_t)(void *p, const void *d, uint16_t s, int t)
Definition: trap_ifc.h:99
+
int(* ifc_recv_func_t)(void *p, void *d, uint32_t *s, int t)
Definition: trap_ifc.h:85
+
char *(* ifc_get_id_func_t)(void *priv)
Definition: trap_ifc.h:164
+
char * data_fmt_spec
Definition: trap_ifc.h:218
+
ifc_get_client_stats_json_func_t get_client_stats_json
Pointer to get_client_stats_json function.
Definition: trap_ifc.h:244
+
char * req_data_fmt_spec
Definition: trap_ifc.h:231
+ +
struct trap_input_ifc_s trap_input_ifc_t
+
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:246
+
void(* ifc_create_dump_func_t)(void *p, uint32_t i, const char *d)
Definition: trap_ifc.h:137
+
void trap_set_abs_timespec(struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1190
+
void trap_set_timeouts(int timeout, struct timeval *tm, struct timespec *tmnblk)
Internal function for setting of timeout structs according to libtrap timeout.
Definition: trap.c:1211
+
ifc_get_id_func_t get_id
Pointer to get_id function.
Definition: trap_ifc.h:236
+
int8_t(* ifc_get_client_stats_json_func_t)(void *p, json_t *client_stats_arr)
Definition: trap_ifc.h:154
+
void(* ifc_destroy_func_t)(void *p)
Definition: trap_ifc.h:127
+ +
void(* ifc_flush_func_t)(void *p)
Definition: trap_ifc.h:106
+
char * buffer_pointer
Internal pointer to current message in buffer.
Definition: trap_ifc.h:189
+
int32_t(* ifc_get_client_count_func_t)(void *p)
Definition: trap_ifc.h:145
+
struct trap_output_ifc_s trap_output_ifc_t
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:242
+
char ifc_type
Type of interface.
Definition: trap_ifc.h:249
+
pthread_mutex_t ifc_mtx
Locking mutex for interface.
Definition: trap_ifc.h:193
+
char * data_fmt_spec
Definition: trap_ifc.h:277
+
trap_in_ifc_state_t client_state
Definition: trap_ifc.h:205
+
ifc_get_client_count_func_t get_client_count
Pointer to get_client_count function.
Definition: trap_ifc.h:243
+
uint8_t req_data_type
Definition: trap_ifc.h:223
+
ifc_disconn_clients_func_t disconn_clients
Pointer to disconnect_clients function.
Definition: trap_ifc.h:237
+
char datatimeout_fixed
Definition: trap_ifc.h:269
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:184
+ +
char bufferswitch
Enable (1) or Disable (0) buffering, default is Enabled (1).
Definition: trap_ifc.h:250
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:185
+
int32_t datatimeout
Timeout for *_send() calls.
Definition: trap_ifc.h:248
+
uint8_t data_type
Definition: trap_ifc.h:282
+
ifc_send_func_t send
Pointer to send function.
Definition: trap_ifc.h:238
+
int32_t datatimeout
Timeout for *_recv() calls.
Definition: trap_ifc.h:191
+
char bufferswitch_fixed
Definition: trap_ifc.h:262
+
uint32_t buffer_unread_bytes
Number of unread bytes in buffer.
Definition: trap_ifc.h:190
+
ifc_recv_func_t recv
Pointer to receive function.
Definition: trap_ifc.h:183
+
ifc_create_dump_func_t create_dump
Pointer to function for generating of dump.
Definition: trap_ifc.h:186
+
char datatimeout_fixed
Definition: trap_ifc.h:200
+
char * buffer
Internal pointer to buffer for messages.
Definition: trap_ifc.h:188
+
int64_t timeout
Internal structure to send partial data after timeout (autoflush).
Definition: trap_ifc.h:247
+
char ifc_type
Type of interface.
Definition: trap_ifc.h:192
+
ifc_destroy_func_t destroy
Pointer to destructor function.
Definition: trap_ifc.h:241
+
ifc_terminate_func_t terminate
Pointer to terminate function.
Definition: trap_ifc.h:240
+
ifc_flush_func_t flush
Pointer to flush function.
Definition: trap_ifc.h:239
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:187
+
ifc_is_conn_func_t is_conn
Pointer to is_connected function.
Definition: trap_ifc.h:181
+
void * priv
Pointer to instance&#39;s private data.
Definition: trap_ifc.h:245
+
void(* ifc_terminate_func_t)(void *p)
Definition: trap_ifc.h:120
+
trap_in_ifc_state_t
Definition: trap.h:242
+
uint8_t data_type
Definition: trap_ifc.h:210
+
uint8_t(* ifc_is_conn_func_t)(void *priv)
Definition: trap_ifc.h:172
+
void(* ifc_disconn_clients_func_t)(void *p)
Definition: trap_ifc.h:113
+
+ + + + diff --git a/doc/libtrap-devel/trap__internal_8c.html b/doc/libtrap-devel/trap__internal_8c.html new file mode 100644 index 00000000..73b845e3 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8c.html @@ -0,0 +1,388 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_internal.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_internal.c File Reference
+
+
+ +

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr. +More...

+
#include <stdio.h>
+#include "trap_internal.h"
+
+Include dependency graph for trap_internal.c:
+
+
+ + + + + +
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + +

+Functions

static void get_level (int level, char **str_level)
 Return syslog and output level based on given verbose level. More...
 
void trap_verbose_msg (int level, char *string)
 send verbose message to stderr More...
 
_Bool __sync_bool_compare_and_swap_8 (int64_t *ptr, int64_t oldvar, int64_t newval)
 
uint64_t __sync_fetch_and_add_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_add_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_and_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_or_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
+ + + + + + + + + +

+Variables

int trap_debug = 0
 
int trap_verbose = -1
 
char trap_err_msg [4096]
 
static pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER
 
+

Detailed Description

+

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.

+
Author
Tomas Konir Tomas.nosp@m..Kon.nosp@m.ir@li.nosp@m.bero.nosp@m.uter..nosp@m.org
+
+Milan Kovacik xkova.nosp@m.ci1@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
+
+Vojtech Krmicek xkrmi.nosp@m.cek@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
+
+Juraj Blaho xblah.nosp@m.o00@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2006-2011
+
+2013
+
+2014
+

Copyright (C) 2006-2014 CESNET

+

LICENSE TERMS

+

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    +
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. +
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. +
  5. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  6. +
+

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

+

This software is provided `‘as is’', and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

+ +

Definition in file trap_internal.c.

+

Function Documentation

+ +

◆ __sync_add_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_add_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 137 of file trap_internal.c.

+ +
+
+ +

◆ __sync_and_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_and_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 146 of file trap_internal.c.

+ +
+
+ +

◆ __sync_bool_compare_and_swap_8()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
_Bool __sync_bool_compare_and_swap_8 (int64_t * ptr,
int64_t oldvar,
int64_t newval 
)
+
+ +

Definition at line 119 of file trap_internal.c.

+ +
+
+ +

◆ __sync_fetch_and_add_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_fetch_and_add_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 128 of file trap_internal.c.

+ +
+
+ +

◆ __sync_or_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_or_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 155 of file trap_internal.c.

+ +
+
+ +

◆ get_level()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void get_level (int level,
char ** str_level 
)
+
+static
+
+ +

Return syslog and output level based on given verbose level.

+
Parameters
+ + + +
levelVerbose level
str_levelString that is set according to given verbose level
+
+
+ +

Definition at line 66 of file trap_internal.c.

+ +
+
+

Variable Documentation

+ +

◆ atomic_mutex

+ +
+
+ + + + + +
+ + + + +
pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER
+
+static
+
+ +

Definition at line 117 of file trap_internal.c.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__internal_8c__incl.map b/doc/libtrap-devel/trap__internal_8c__incl.map new file mode 100644 index 00000000..c9590ab6 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8c__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/doc/libtrap-devel/trap__internal_8c__incl.md5 b/doc/libtrap-devel/trap__internal_8c__incl.md5 new file mode 100644 index 00000000..9b005423 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8c__incl.md5 @@ -0,0 +1 @@ +34fb9a8a749889bb57768aa9669fe48d \ No newline at end of file diff --git a/doc/libtrap-devel/trap__internal_8c__incl.png b/doc/libtrap-devel/trap__internal_8c__incl.png new file mode 100644 index 00000000..a4189c10 Binary files /dev/null and b/doc/libtrap-devel/trap__internal_8c__incl.png differ diff --git a/doc/libtrap-devel/trap__internal_8c_source.html b/doc/libtrap-devel/trap__internal_8c_source.html new file mode 100644 index 00000000..235f97fe --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8c_source.html @@ -0,0 +1,99 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_internal.c Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_internal.c
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_internal.c
3  * \brief Internal functions and macros for libtrap
4  * Verbose and debug macros from libcommlbr
5  * \author Tomas Konir <Tomas.Konir@liberouter.org>
6  * \author Milan Kovacik <xkovaci1@fi.muni.cz>
7  * \author Vojtech Krmicek <xkrmicek@fi.muni.cz>
8  * \author Juraj Blaho <xblaho00@stud.fit.vutbr.cz>
9  * \author Tomas Cejka <cejkat@cesnet.cz>
10  * \date 2006-2011
11  * \date 2013
12  * \date 2014
13  *
14  * Copyright (C) 2006-2014 CESNET
15  *
16  *
17  * LICENSE TERMS
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions
21  * are met:
22  * 1. Redistributions of source code must retain the above copyright
23  * notice, this list of conditions and the following disclaimer.
24  * 2. Redistributions in binary form must reproduce the above copyright
25  * notice, this list of conditions and the following disclaimer in
26  * the documentation and/or other materials provided with the
27  * distribution.
28  * 3. Neither the name of the Company nor the names of its contributors
29  * may be used to endorse or promote products derived from this
30  * software without specific prior written permission.
31  *
32  * ALTERNATIVELY, provided that this notice is retained in full, this
33  * product may be distributed under the terms of the GNU General Public
34  * License (GPL) version 2 or later, in which case the provisions
35  * of the GPL apply INSTEAD OF those given above.
36  *
37  * This software is provided ``as is'', and any express or implied
38  * warranties, including, but not limited to, the implied warranties of
39  * merchantability and fitness for a particular purpose are disclaimed.
40  * In no event shall the company or contributors be liable for any
41  * direct, indirect, incidental, special, exemplary, or consequential
42  * damages (including, but not limited to, procurement of substitute
43  * goods or services; loss of use, data, or profits; or business
44  * interruption) however caused and on any theory of liability, whether
45  * in contract, strict liability, or tort (including negligence or
46  * otherwise) arising in any way out of the use of this software, even
47  * if advised of the possibility of such damage.
48  *
49  */
50 #include <stdio.h>
51 #include "trap_internal.h"
52 
53 /**
54  * Verbose level storage
55  */
56 int trap_debug = 0;
57 int trap_verbose = -1;
58 char trap_err_msg[4096];
59 
60 /**
61  * \brief Return syslog and output level based on given verbose level
62  *
63  * \param level Verbose level
64  * \param str_level String that is set according to given verbose level
65  */
66 static void get_level(int level, char **str_level)
67 {
68  static char *error="ERROR";
69  static char *warning="WARNING";
70  static char *notice="NOTICE";
71  static char *verbose="VERBOSE";
72  static char *adv_verbose="ADVANCED VERBOSE";
73  static char *library="LIBRARY VERBOSE";
74 
75  switch (level) {
76  case CL_ERROR:
77  *str_level = error;
78  break;
79  case CL_WARNING:
80  *str_level= warning;
81  break;
82  case CL_VERBOSE_OFF:
83  *str_level= notice;
84  break;
85  case CL_VERBOSE_BASIC:
86  *str_level= verbose;
87  break;
89  *str_level= adv_verbose;
90  break;
91  case CL_VERBOSE_LIBRARY:
92  *str_level= library;
93  break;
94  default:
95  *str_level= notice;
96  }
97 }
98 
99 /**
100  * \brief send verbose message to stderr
101  *
102  * send verbose message to stderr. may change in future. don't use it directly
103  *
104  * \param level importance level
105  * \param string format string, like printf function
106  */
107 void trap_verbose_msg(int level, char *string)
108 {
109  char *strl;
110  get_level(level, &strl);
111  fprintf(stderr, "%s: %s\n", strl, string);
112  fflush(stderr);
113  string[0] = 0;
114 }
115 
116 #ifndef ATOMICOPS
117 static pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER;
118 
119 _Bool __sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval)
120 {
121  pthread_mutex_lock(&atomic_mutex);
122  int64_t tmp = *ptr;
123  *ptr = newval;
124  pthread_mutex_unlock(&atomic_mutex);
125  return tmp == oldvar;
126 }
127 
128 uint64_t __sync_fetch_and_add_8(uint64_t *ptr, uint64_t value)
129 {
130  pthread_mutex_lock(&atomic_mutex);
131  uint64_t tmp = *ptr;
132  *ptr += value;
133  pthread_mutex_unlock(&atomic_mutex);
134  return tmp;
135 }
136 
137 uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t value)
138 {
139  pthread_mutex_lock(&atomic_mutex);
140  uint64_t tmp = *ptr;
141  *ptr += value;
142  pthread_mutex_unlock(&atomic_mutex);
143  return tmp;
144 }
145 
146 uint64_t __sync_and_and_fetch_8(uint64_t *ptr, uint64_t value)
147 {
148  pthread_mutex_lock(&atomic_mutex);
149  uint64_t tmp = *ptr;
150  *ptr &= value;
151  pthread_mutex_unlock(&atomic_mutex);
152  return tmp;
153 }
154 
155 uint64_t __sync_or_and_fetch_8(uint64_t *ptr, uint64_t value)
156 {
157  pthread_mutex_lock(&atomic_mutex);
158  uint64_t tmp = *ptr;
159  *ptr |= value;
160  pthread_mutex_unlock(&atomic_mutex);
161  return tmp;
162 }
163 
164 #endif
165 
_Bool __sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval)
+ +
Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.
+ +
int trap_debug
Definition: trap_internal.c:56
+ +
static pthread_mutex_t atomic_mutex
+
uint64_t __sync_and_and_fetch_8(uint64_t *ptr, uint64_t value)
+
char trap_err_msg[4096]
Definition: trap_internal.c:58
+
uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t value)
+
uint64_t __sync_or_and_fetch_8(uint64_t *ptr, uint64_t value)
+ +
int trap_verbose
Definition: trap_internal.c:57
+
static void get_level(int level, char **str_level)
Return syslog and output level based on given verbose level.
Definition: trap_internal.c:66
+ +
uint64_t __sync_fetch_and_add_8(uint64_t *ptr, uint64_t value)
+ +
void trap_verbose_msg(int level, char *string)
send verbose message to stderr
+
+ + + + diff --git a/doc/libtrap-devel/trap__internal_8h.html b/doc/libtrap-devel/trap__internal_8h.html new file mode 100644 index 00000000..4a72e83f --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h.html @@ -0,0 +1,658 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_internal.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
trap_internal.h File Reference
+
+
+ +

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr. +More...

+
#include <config.h>
+#include <stdio.h>
+#include <pthread.h>
+#include "../include/libtrap/trap.h"
+#include "trap_ifc.h"
+
+Include dependency graph for trap_internal.h:
+
+
+ + + + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + + + + + + + + +
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + +

+Data Structures

struct  hello_msg_header_s
 
struct  reader_threads_s
 
struct  autoflush_timeouts
 List of autoflush timeouts of output interfaces. More...
 
struct  trap_ctx_priv_s
 
struct  trap_buffer_header_s
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define MAX_ERROR_MSG_BUFF_SIZE   1024
 
#define DEFAULT_MAX_TERMINAL_WIDTH   85
 
#define SERVICE_GET_COM   10
 Signaling a request for module statistics (interfaces stats - received messages and buffers, sent messages and buffers, autoflushes counter) More...
 
#define SERVICE_SET_COM   11
 Signaling a request to set some interface parameters (timeouts etc.) More...
 
#define SERVICE_OK_REPLY   12
 A value used as a reply signaling success. More...
 
#define NEG_RES_CONT   111
 If the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation) More...
 
#define NEG_RES_RECEIVER_FMT_SUBSET   112
 If the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier. More...
 
#define NEG_RES_SENDER_FMT_SUBSET   116
 If the data format of input and output interfaces is the same and new data specifier of the output interface is subset of the old one (it is not first negotiation) More...
 
#define NEG_RES_FMT_MISMATCH   113
 If the data format or data specifier of input and output interfaces does not match. More...
 
#define NEG_RES_FMT_CHANGED   117
 If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants) More...
 
#define NEG_RES_OK   116
 Signaling success (hello message successfully sent to input interface) More...
 
#define NEG_RES_FAILED   114
 If receiving the data from output interface fails or sending the data to input interface fails. More...
 
#define NEG_RES_FMT_UNKNOWN   115
 If the output interface has not specified data format. More...
 
#define MSG(level, format, args...)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg(level,trap_err_msg);}
 Debug message macro if DEBUG macro is defined. More...
 
#define MSG_NONL(level, format, args...)   if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg_nonl(trap_err_msg);}
 Debug message macro if DEBUG macro is defined - without new line. More...
 
#define LINE()   {fprintf(stderr, "file: %s, line: %i\n", __FILE__, __LINE__); fflush(stderr);}
 
#define INLINE
 
#define VERBOSE(level, format, args...)
 
#define DEBUG_IFC(X)
 
#define DEBUG_BUF(X)
 
#define TRAP_IN_IFC_COUNTERS   1
 
#define TRAP_OUT_IFC_COUNTERS   3
 
Timeouts handling
#define TRAP_NO_IFC_SLEEP   4
 seconds to sleep, when autoflushing is not active More...
 
#define TRAP_IFC_TIMEOUT   2000000
 size of default timeout on output interfaces in microseconds More...
 
+ + + + + + + + + + + + + +

+Typedefs

typedef struct trap_ctx_priv_s trap_ctx_priv_t
 
typedef struct hello_msg_header_s hello_msg_header_t
 
typedef enum trap_verbose_level trap_verbose_level_t
 VERBOSE/MSG levels. More...
 
typedef struct autoflush_timeouts ifc_autoflush_t
 List of autoflush timeouts of output interfaces. More...
 
typedef struct trap_buffer_header_s trap_buffer_header_t
 
+ + + + +

+Enumerations

enum  trap_verbose_level {
+  CL_ERROR = -3, +CL_WARNING = -2, +CL_VERBOSE_OFF = -1, +CL_VERBOSE_BASIC, +
+  CL_VERBOSE_ADVANCED, +CL_VERBOSE_LIBRARY +
+ }
 VERBOSE/MSG levels. More...
 
+ + + + + + + + + + + + + + + + + + +

+Functions

void trap_verbose_msg (int level, char *string)
 send verbose message to stderr More...
 
trap_ctx_priv_ttrap_create_ctx_t ()
 
struct trap_buffer_header_s __attribute__ ((__packed__))
 
_Bool __sync_bool_compare_and_swap_8 (int64_t *ptr, int64_t oldvar, int64_t newval)
 
uint64_t __sync_fetch_and_add_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_add_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_or_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
uint64_t __sync_and_and_fetch_8 (uint64_t *ptr, uint64_t value)
 
+ + + + + + + + + + + + + +

+Variables

int trap_debug
 
int trap_verbose
 
char trap_err_msg []
 
trap_ctx_priv_ttrap_glob_ctx
 
uint32_t data_length
 
uint8_t data [0]
 
+

Detailed Description

+

Internal functions and macros for libtrap Verbose and debug macros from libcommlbr.

+
Author
Tomas Konir Tomas.nosp@m..Kon.nosp@m.ir@li.nosp@m.bero.nosp@m.uter..nosp@m.org
+
+Milan Kovacik xkova.nosp@m.ci1@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
+
+Vojtech Krmicek xkrmi.nosp@m.cek@.nosp@m.fi.mu.nosp@m.ni.c.nosp@m.z
+
+Juraj Blaho xblah.nosp@m.o00@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
+Tomas Jansky jansk.nosp@m.to1@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2006-2018
+

Copyright (C) 2006-2018 CESNET

+

LICENSE TERMS

+

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    +
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. +
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. +
  5. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  6. +
+

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

+

This software is provided `‘as is’', and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

+ +

Definition in file trap_internal.h.

+

Macro Definition Documentation

+ +

◆ DEFAULT_MAX_TERMINAL_WIDTH

+ +
+
+ + + + +
#define DEFAULT_MAX_TERMINAL_WIDTH   85
+
+

Max length of line printed in help (used for line-breaks).

+ +

Definition at line 62 of file trap_internal.h.

+ +
+
+ +

◆ MAX_ERROR_MSG_BUFF_SIZE

+ +
+
+ + + + +
#define MAX_ERROR_MSG_BUFF_SIZE   1024
+
+ +

Definition at line 57 of file trap_internal.h.

+ +
+
+ +

◆ SERVICE_GET_COM

+ +
+
+ + + + +
#define SERVICE_GET_COM   10
+
+ +

Signaling a request for module statistics (interfaces stats - received messages and buffers, sent messages and buffers, autoflushes counter)

+ +

Definition at line 65 of file trap_internal.h.

+ +
+
+ +

◆ SERVICE_OK_REPLY

+ +
+
+ + + + +
#define SERVICE_OK_REPLY   12
+
+ +

A value used as a reply signaling success.

+ +

Definition at line 67 of file trap_internal.h.

+ +
+
+ +

◆ SERVICE_SET_COM

+ +
+
+ + + + +
#define SERVICE_SET_COM   11
+
+ +

Signaling a request to set some interface parameters (timeouts etc.)

+ +

Definition at line 66 of file trap_internal.h.

+ +
+
+ +

◆ TRAP_IN_IFC_COUNTERS

+ +
+
+ + + + +
#define TRAP_IN_IFC_COUNTERS   1
+
+

Number of counter types sf IN IFC stored trap_ctx_priv_s used in service_thread_routine()

+ +

Definition at line 350 of file trap_internal.h.

+ +
+
+ +

◆ TRAP_OUT_IFC_COUNTERS

+ +
+
+ + + + +
#define TRAP_OUT_IFC_COUNTERS   3
+
+

Number of counter types sf OUT IFC stored trap_ctx_priv_s used in service_thread_routine()

+ +

Definition at line 354 of file trap_internal.h.

+ +
+
+

Typedef Documentation

+ +

◆ ifc_autoflush_t

+ +
+
+ + + + +
typedef struct autoflush_timeouts ifc_autoflush_t
+
+ +

List of autoflush timeouts of output interfaces.

+ +
+
+ +

◆ trap_buffer_header_t

+ +
+
+ + + + +
typedef struct trap_buffer_header_s trap_buffer_header_t
+
+ +

Definition at line 365 of file trap_internal.h.

+ +
+
+

Function Documentation

+ +

◆ __attribute__()

+ +
+
+ + + + + + + + +
struct trap_buffer_header_s __attribute__ ((__packed__) )
+
+ +
+
+ +

◆ __sync_add_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_add_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 137 of file trap_internal.c.

+ +
+
+ +

◆ __sync_and_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_and_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 146 of file trap_internal.c.

+ +
+
+ +

◆ __sync_bool_compare_and_swap_8()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
_Bool __sync_bool_compare_and_swap_8 (int64_t * ptr,
int64_t oldvar,
int64_t newval 
)
+
+ +

Definition at line 119 of file trap_internal.c.

+ +
+
+ +

◆ __sync_fetch_and_add_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_fetch_and_add_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 128 of file trap_internal.c.

+ +
+
+ +

◆ __sync_or_and_fetch_8()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t __sync_or_and_fetch_8 (uint64_t * ptr,
uint64_t value 
)
+
+ +

Definition at line 155 of file trap_internal.c.

+ +
+
+

Variable Documentation

+ +

◆ data

+ +
+
+ + + + +
uint8_t data[0]
+
+ +

Definition at line 361 of file trap_internal.h.

+ +
+
+ +

◆ data_length

+ +
+
+ + + + +
uint32_t data_length
+
+

size of data in the data unit

+ +

Definition at line 357 of file trap_internal.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap-devel/trap__internal_8h__dep__incl.map b/doc/libtrap-devel/trap__internal_8h__dep__incl.map new file mode 100644 index 00000000..59b86ace --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h__dep__incl.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/doc/libtrap-devel/trap__internal_8h__dep__incl.md5 b/doc/libtrap-devel/trap__internal_8h__dep__incl.md5 new file mode 100644 index 00000000..156d6030 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h__dep__incl.md5 @@ -0,0 +1 @@ +f6e9ab52c87ce4c74ab71ce730b417fc \ No newline at end of file diff --git a/doc/libtrap-devel/trap__internal_8h__dep__incl.png b/doc/libtrap-devel/trap__internal_8h__dep__incl.png new file mode 100644 index 00000000..76db9be1 Binary files /dev/null and b/doc/libtrap-devel/trap__internal_8h__dep__incl.png differ diff --git a/doc/libtrap-devel/trap__internal_8h__incl.map b/doc/libtrap-devel/trap__internal_8h__incl.map new file mode 100644 index 00000000..f45ef372 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap-devel/trap__internal_8h__incl.md5 b/doc/libtrap-devel/trap__internal_8h__incl.md5 new file mode 100644 index 00000000..00689762 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h__incl.md5 @@ -0,0 +1 @@ +34e551a7461e8749fe2819df5360f956 \ No newline at end of file diff --git a/doc/libtrap-devel/trap__internal_8h__incl.png b/doc/libtrap-devel/trap__internal_8h__incl.png new file mode 100644 index 00000000..0cac2aa7 Binary files /dev/null and b/doc/libtrap-devel/trap__internal_8h__incl.png differ diff --git a/doc/libtrap-devel/trap__internal_8h_source.html b/doc/libtrap-devel/trap__internal_8h_source.html new file mode 100644 index 00000000..26e202f0 --- /dev/null +++ b/doc/libtrap-devel/trap__internal_8h_source.html @@ -0,0 +1,147 @@ + + + + + + + +Libtrap: Internal development docs: src/trap_internal.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
trap_internal.h
+
+
+Go to the documentation of this file.
1 /**
2  * \file trap_internal.h
3  * \brief Internal functions and macros for libtrap
4  * Verbose and debug macros from libcommlbr
5  * \author Tomas Konir <Tomas.Konir@liberouter.org>
6  * \author Milan Kovacik <xkovaci1@fi.muni.cz>
7  * \author Vojtech Krmicek <xkrmicek@fi.muni.cz>
8  * \author Juraj Blaho <xblaho00@stud.fit.vutbr.cz>
9  * \author Tomas Cejka <cejkat@cesnet.cz>
10  * \author Tomas Jansky <janskto1@fit.cvut.cz>
11  * \date 2006-2018
12  *
13  * Copyright (C) 2006-2018 CESNET
14  *
15  *
16  * LICENSE TERMS
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions
20  * are met:
21  * 1. Redistributions of source code must retain the above copyright
22  * notice, this list of conditions and the following disclaimer.
23  * 2. Redistributions in binary form must reproduce the above copyright
24  * notice, this list of conditions and the following disclaimer in
25  * the documentation and/or other materials provided with the
26  * distribution.
27  * 3. Neither the name of the Company nor the names of its contributors
28  * may be used to endorse or promote products derived from this
29  * software without specific prior written permission.
30  *
31  * ALTERNATIVELY, provided that this notice is retained in full, this
32  * product may be distributed under the terms of the GNU General Public
33  * License (GPL) version 2 or later, in which case the provisions
34  * of the GPL apply INSTEAD OF those given above.
35  *
36  * This software is provided ``as is'', and any express or implied
37  * warranties, including, but not limited to, the implied warranties of
38  * merchantability and fitness for a particular purpose are disclaimed.
39  * In no event shall the company or contributors be liable for any
40  * direct, indirect, incidental, special, exemplary, or consequential
41  * damages (including, but not limited to, procurement of substitute
42  * goods or services; loss of use, data, or profits; or business
43  * interruption) however caused and on any theory of liability, whether
44  * in contract, strict liability, or tort (including negligence or
45  * otherwise) arising in any way out of the use of this software, even
46  * if advised of the possibility of such damage.
47  *
48  */
49 #ifndef _TRAP_INTERNAL_H
50 #define _TRAP_INTERNAL_H
51 #include <config.h>
52 #include <stdio.h>
53 #include <pthread.h>
54 #include "../include/libtrap/trap.h"
55 #include "trap_ifc.h"
56 
57 #define MAX_ERROR_MSG_BUFF_SIZE 1024
58 
59 /**
60  * Max length of line printed in help (used for line-breaks).
61  */
62 #define DEFAULT_MAX_TERMINAL_WIDTH 85
63 
64 /* Values of commands that supervisor wants module to perform. These values are sent in header via service interface. */
65 #define SERVICE_GET_COM 10 ///< Signaling a request for module statistics (interfaces stats - received messages and buffers, sent messages and buffers, autoflushes counter)
66 #define SERVICE_SET_COM 11 ///< Signaling a request to set some interface parameters (timeouts etc.)
67 #define SERVICE_OK_REPLY 12 ///< A value used as a reply signaling success
68 
69 /**
70  * \defgroup negotiationretvals Negotiation return values
71  * @{*/
72 
73 /* Input interface negotiation return values */
74 #define NEG_RES_CONT 111 ///< If the data format and data specifier of input and output interface are the same (input interface can receive the data for module right after the negotiation)
75 #define NEG_RES_RECEIVER_FMT_SUBSET 112 ///< If the data format of input and output interfaces is the same and data specifier of the input interface is subset of the output interface data specifier
76 #define NEG_RES_SENDER_FMT_SUBSET 116 ///< If the data format of input and output interfaces is the same and new data specifier of the output interface is subset of the old one (it is not first negotiation)
77 #define NEG_RES_FMT_MISMATCH 113 ///< If the data format or data specifier of input and output interfaces does not match
78 #define NEG_RES_FMT_CHANGED 117 ///< If the data format has changed (for JSON type, UNIREC type uses *SUBSET variants)
79 
80 /* Output interface negotiation return values */
81 #define NEG_RES_OK 116 ///< Signaling success (hello message successfully sent to input interface)
82 
83 /* Return values of input and output interface negotiations */
84 #define NEG_RES_FAILED 114 ///< If receiving the data from output interface fails or sending the data to input interface fails
85 #define NEG_RES_FMT_UNKNOWN 115 ///< If the output interface has not specified data format
86 /**@}*/
87 
88 /** @defgroup debug Macros for verbose and debug listings
89  * @{
90  */
91 
92 /*! control debug level */
93 extern int trap_debug;
94 /*! control verbose level */
95 extern int trap_verbose;
96 /*! buffer for verbose and debug messages */
97 extern char trap_err_msg[];
98 
100 
102 
103 /**
104  * Hello message header structure (used during the output and input interface negotiation).
105  * Contains data format and data specifier size of the output interface which is making the negotiation.
106  */
107 typedef struct hello_msg_header_s {
108  uint8_t data_type;
111 
112 
113 /*!
114 \brief VERBOSE/MSG levels
115 */
116 typedef enum trap_verbose_level {
117  CL_ERROR = -3, /*!< Inforamtion about error*/
118  CL_WARNING = -2, /*< Warining message */
119  CL_VERBOSE_OFF = -1,/*!< Verbose off / print even if VERBOSE is off*/
120  CL_VERBOSE_BASIC,/*!< Basic verbose information*/
121  CL_VERBOSE_ADVANCED,/*!< Advanced verbose information*/
122  CL_VERBOSE_LIBRARY/*!< Used for library functions verbose*/
124 
125 /**
126  * \name Timeouts handling
127  * @{*/
128 #define TRAP_NO_IFC_SLEEP 4 ///< seconds to sleep, when autoflushing is not active
129 #define TRAP_IFC_TIMEOUT 2000000 ///< size of default timeout on output interfaces in microseconds
130 /**@}*/
131 
132 #ifndef NDEBUG
133  /*! \brief Debug message macro if DEBUG macro is defined
134  *
135  * now 3 known DEBUG LEVELS
136  * - 0 normal debug messages
137  * - 1 extended debug (messages on enter and before exit important functions)
138  * - 2 flood developer with debug messages :-) (don't use)
139  *
140  * BE VERBOSE AND DEBUG ARE DIFFERENT OPTIONS !!!
141  */
142 # define MSG(level,format,args...) if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg(level,trap_err_msg);}
143 
144  /*! \brief Debug message macro if DEBUG macro is defined - without new
145  * line */
146 # define MSG_NONL(level,format,args...) if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg_nonl(trap_err_msg);}
147  /*! Prints line in source file if DEBUG macro is defined */
148 # define LINE() {fprintf(stderr, "file: %s, line: %i\n", __FILE__, __LINE__); fflush(stderr);}
149 
150 #define INLINE
151 #else
152 
153 # ifdef __GNUC__
154 static inline int __attribute__ ((format (printf, 2, 3))) MSG(int l, const char *fmt, ...)
155 {
156  (void)(l + fmt);
157  return 0;
158 }
159 # else
160 # define MSG(level,string,args...)
161 # endif
162 
163 # define LINE()
164 #define INLINE inline
165 #endif
166 
167 void trap_verbose_msg(int level, char *string);
168 
169 #ifndef NDEBUG
170 /*! Macro for verbose message */
171 #define VERBOSE(level,format,args...) if (trap_verbose>=level) { \
172  snprintf(trap_err_msg,4095,"%s:%d "format,__FILE__, __LINE__, ##args); \
173  trap_verbose_msg(level,trap_err_msg); \
174 }
175 #else
176 #define VERBOSE(level,format,args...) if (trap_verbose>=level) { \
177  snprintf(trap_err_msg,4095,format, ##args); \
178  trap_verbose_msg(level,trap_err_msg); \
179 }
180 #endif
181 
182 
183 #define DEBUG_IFC(X) if (TRAP_DEBUG_IFC) { \
184  X; \
185 }
186 
187 #define DEBUG_BUF(X) if (TRAP_DEBUG_BUFFERING) { \
188  X; \
189 }
190 
191 
192 /** @} */
193 
194 /**
195  * List of threads and their semaphores.
196  *
197  * It is used for multi-result reading when _get_data() is called
198  * with ifc_mask including more than one ifc.
199  */
201  pthread_t thr; /**< thread of reader */
202  sem_t sem; /**< semaphore used when thread is ought to sleep */
203 };
204 
205 /**
206  * \brief List of autoflush timeouts of output interfaces.
207  */
208 typedef struct autoflush_timeouts {
209  int idx; /**< Index of output interface. */
210  int64_t tm; /**< Autoflush timeout to be elapsed. */
211  int64_t tm_backup; /**< Backup value of the autoflush timeout. */
213 
214 /**
215  * Libtrap context structure.
216  *
217  * It contains the whole context of one instance of libtrap. The context
218  * contains arrays of communication interfaces (IFC), buffers, locks/mutexes.
219  */
221  /**
222  * Is libtrap initialized correctly? (0 ~ false)
223  */
225  /**
226  * Is libtrap terminated? (0 ~ false, should run)
227  */
228  volatile int terminated;
229 
230  /**
231  * Number of interface changes waiting to be applied.
232  */
233  volatile int ifc_change;
234 
235  /**
236  * Code of last error (one of the codes above)
237  */
239 
240  /**
241  * Human-readable message about last error
242  */
243  const char *trap_last_error_msg;
244 
245  /**
246  * Buffer for dynamically generated messages
247  */
249 
250  /**
251  * Array of input interfaces
252  */
254 
255  /**
256  * Arrays of output interfaces
257  */
259 
260  /**
261  * Number of input interfaces
262  */
263  uint32_t num_ifc_in;
264 
265  /**
266  * Number of output interfaces
267  */
268  uint32_t num_ifc_out;
269 
270  /**
271  * Timeout common to all readers for multiread feature
272  */
274 
275  /**
276  * Lock setting last error code and last error message.
277  */
278  pthread_mutex_t error_mtx;
279 
280  /**
281  * Timeouts for autoflush thread.
282  */
284 
285  /**
286  * Service thread that enables communication with module
287  */
288  pthread_t service_thread;
289 
290  /**
291  * Name of the service IFC socket, it is disabled when NULL.
292  */
294 
295  /**
296  * Indicator of initialized service thread
297  */
299 
300  /**
301  * \defgroup ctxifccounters IFC counters
302  *
303  * The counters are sent by service_thread_routine() via service IFC (e.g. to supervisor).
304  * @{
305  */
306  /**
307  * counter_send_message is incremented within trap_ctx_send().
308  */
310  /**
311  * counter_dropped_message is incremented within trap_ctx_send().
312  */
314  /**
315  * counter_recv_message is incremented within trap_ctx_recv().
316  */
318  /**
319  * counter_send_buffer is incremented within trap_store_into_buffer() after sending buffer.
320  */
322  /**
323  * counter_autoflush is incremented within trap_automatic_flush_thr() after flushing buffer.
324  */
325  uint64_t *counter_autoflush;
326  /**
327  * counter_recv_buffer is incremented within trap_read_from_buffer() after successful receiving buffer.
328  */
330  /**
331  * counter_recv_delay_last represents time interval between last two recv() calls (in microseconds).
332  */
334  /**
335  * counter_recv_delay_total represents total time spent outside of recv() function (in microseconds).
336  */
338  /**
339  * recv_delay_timestamp is used to determine the time that has elapsed between last two recv() calls
340  */
342  /**
343  * @}
344  */
345 };
346 
347 /**
348  * Number of counter types sf IN IFC stored #trap_ctx_priv_s used in service_thread_routine()
349  */
350 #define TRAP_IN_IFC_COUNTERS 1
351 /**
352  * Number of counter types sf OUT IFC stored #trap_ctx_priv_s used in service_thread_routine()
353  */
354 #define TRAP_OUT_IFC_COUNTERS 3
355 
359  uint32_t data_length; /**< size of data in the data unit */
360 #ifdef ENABLE_HEADER_TIMESTAMP
361  uint64_t timestamp;
362 #endif
363  uint8_t data[0];
364 } __attribute__ ((__packed__));
366 
367 #ifndef ATOMICOPS
368 _Bool __sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval);
369 
370 uint64_t __sync_fetch_and_add_8(uint64_t *ptr, uint64_t value);
371 
372 uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t value);
373 
374 uint64_t __sync_or_and_fetch_8(uint64_t *ptr, uint64_t value);
375 
376 uint64_t __sync_and_and_fetch_8(uint64_t *ptr, uint64_t value);
377 
378 #endif
379 
380 #endif
381 
+
#define MAX_ERROR_MSG_BUFF_SIZE
Definition: trap_internal.h:57
+ + + +
uint64_t __sync_and_and_fetch_8(uint64_t *ptr, uint64_t value)
+
uint64_t __sync_fetch_and_add_8(uint64_t *ptr, uint64_t value)
+ +
char error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
+ +
struct autoflush_timeouts ifc_autoflush_t
List of autoflush timeouts of output interfaces.
+
ifc_autoflush_t * ifc_autoflush_timeout
+ + + +
volatile int ifc_change
+ +
uint32_t num_ifc_in
+
int trap_debug
Definition: trap_internal.c:56
+ + +
volatile int terminated
+
uint64_t * counter_dropped_message
+
trap_ctx_priv_t * trap_create_ctx_t()
Definition: trap.c:1251
+ +
uint32_t num_ifc_out
+ +
char trap_err_msg[]
Definition: trap_internal.c:58
+ +
pthread_t service_thread
+
int service_thread_initialized
+ +
uint64_t * counter_recv_message
+
_Bool __sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval)
+
pthread_mutex_t error_mtx
+
trap_ctx_priv_t * trap_glob_ctx
Definition: trap.c:120
+ + + +
const char * trap_last_error_msg
+
uint64_t * recv_delay_timestamp
+
char * service_ifc_name
+
uint64_t * counter_recv_delay_total
+
struct trap_buffer_header_s __attribute__((__packed__))
+ +
int trap_verbose
Definition: trap_internal.c:57
+
trap_verbose_level
VERBOSE/MSG levels.
+
struct hello_msg_header_s hello_msg_header_t
+ +
uint64_t * counter_recv_buffer
+ +
uint64_t * counter_recv_delay_last
+
List of autoflush timeouts of output interfaces.
+
uint64_t * counter_autoflush
+
uint64_t __sync_or_and_fetch_8(uint64_t *ptr, uint64_t value)
+
uint32_t data_fmt_spec_size
+
uint64_t * counter_send_buffer
+
enum trap_verbose_level trap_verbose_level_t
VERBOSE/MSG levels.
+
trap_output_ifc_t * out_ifc_list
+ +
Interface of TRAP interfaces.
+
uint64_t * counter_send_message
+
#define MSG(level, format, args...)
Debug message macro if DEBUG macro is defined.
+
void trap_verbose_msg(int level, char *string)
send verbose message to stderr
+
uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t value)
+
trap_input_ifc_t * in_ifc_list
+
+ + + + diff --git a/doc/libtrap-devel/uniontcpip__socket__addr.html b/doc/libtrap-devel/uniontcpip__socket__addr.html new file mode 100644 index 00000000..fd6dc825 --- /dev/null +++ b/doc/libtrap-devel/uniontcpip__socket__addr.html @@ -0,0 +1,133 @@ + + + + + + + +Libtrap: Internal development docs: tcpip_socket_addr Union Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ + + + + + + + +

+Data Fields

struct addrinfo tcpip_addr
 used for TCPIP socket More...
 
struct sockaddr_un unix_addr
 used for path of UNIX socket More...
 
+

Detailed Description

+

Internal union for host address storage, common for tcpip & unix

+ +

Definition at line 100 of file ifc_tcpip.c.

+

Field Documentation

+ +

◆ tcpip_addr

+ +
+
+ + + + +
struct addrinfo tcpip_socket_addr::tcpip_addr
+
+ +

used for TCPIP socket

+ +

Definition at line 101 of file ifc_tcpip.c.

+ +
+
+ +

◆ unix_addr

+ +
+
+ + + + +
struct sockaddr_un tcpip_socket_addr::unix_addr
+
+ +

used for path of UNIX socket

+ +

Definition at line 102 of file ifc_tcpip.c.

+ +
+
+
The documentation for this union was generated from the following file: +
+ + + + diff --git a/doc/libtrap-devel/uniontls__socket__addr.html b/doc/libtrap-devel/uniontls__socket__addr.html new file mode 100644 index 00000000..a844ebb1 --- /dev/null +++ b/doc/libtrap-devel/uniontls__socket__addr.html @@ -0,0 +1,133 @@ + + + + + + + +Libtrap: Internal development docs: tls_socket_addr Union Reference + + + + + + + + + +
+
+ + + + + + +
+
Libtrap: Internal development docs +  1.16.1 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ + + + + + + + +

+Data Fields

struct addrinfo tls_addr
 used for TCPIP socket More...
 
struct sockaddr_un unix_addr
 used for path of UNIX socket More...
 
+

Detailed Description

+

Internal union for host address storage, common for tcpip & unix

+ +

Definition at line 249 of file ifc_tls.c.

+

Field Documentation

+ +

◆ tls_addr

+ +
+
+ + + + +
struct addrinfo tls_socket_addr::tls_addr
+
+ +

used for TCPIP socket

+ +

Definition at line 250 of file ifc_tls.c.

+ +
+
+ +

◆ unix_addr

+ +
+
+ + + + +
struct sockaddr_un tls_socket_addr::unix_addr
+
+ +

used for path of UNIX socket

+ +

Definition at line 251 of file ifc_tls.c.

+ +
+
+
The documentation for this union was generated from the following file: +
+ + + + diff --git a/doc/libtrap/annotated.html b/doc/libtrap/annotated.html new file mode 100644 index 00000000..7ddcd60a --- /dev/null +++ b/doc/libtrap/annotated.html @@ -0,0 +1,63 @@ + + + + + + + +libtrap: Data Structures + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+
+ + + + diff --git a/doc/libtrap/bc_s.png b/doc/libtrap/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/doc/libtrap/bc_s.png differ diff --git a/doc/libtrap/bdwn.png b/doc/libtrap/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/doc/libtrap/bdwn.png differ diff --git a/doc/libtrap/changelog.html b/doc/libtrap/changelog.html new file mode 100644 index 00000000..bf33d271 --- /dev/null +++ b/doc/libtrap/changelog.html @@ -0,0 +1,54 @@ + + + + + + + +libtrap: ChangeLog + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
ChangeLog
+
+
+
2021-02-27 libtrap-1.16.1
* bugfixes and refactoring (timestamps, deadlocks)
2020-12-08 libtrap-1.16.0
* replaced select() with poll() - thanks to Flowmon Networks
* bugfixes of deadlocks, negotiation failure, memory leaks - Jiri Havranek
2020-09-20 libtrap-1.15.1
* bugfix: strncpy in file IFC
* bugfix: compilation on openwrt
* bugfix: compilation on new gcc10 (-fcommon)
2020-04-21 libtrap-1.15.0
* fixed CPU exhausting issue
* fixed missing atomicops on turris
* fixed segfault on bad params of file IFC
* add delay statistics for input IFC
2020-04-01 libtrap-1.14.0
* libtrap:
New enhanced version of buffering that uses ring buffer.
2019-05-18 libtrap-1.13.1
* Replace 8B atomics on platforms that do not support it (turris)
* File IFC file numbers are aligned to 5 digits with leading zeros
* File IFC file has default mode set to 'w' now
* Maintenance and fixing warnings.
2019-04-20 libtrap-1.13.0
* Improved error messages
* Removed multi_recv unused feature
2019-02-07 libtrap-1.12.2
* Bugfix in init - possible deadlock on uninitialized semaphore
2018-11-23 libtrap-0.12.1
* libtrap:
Libtrap buffer now properly empties itself if no client is
connected to the ouput interface. (This changes how statistics
- number of messages sent and dropped - are treated when
no client is connected).
Added client identification for TCP and UNIX output interfaces
and computation of statistics. For UNIX IFC type, ID is set to PID of the connected client.
For TCP or TLS IFC types, ID is set to a remote TCP port of the connected
client (which can be looked up using `netstat(8)` or `ss(8)`).
2018-10-26 libtrap-0.12.0
* libtrap:
Refactoring, improved throughput.
Fixed problems with not setting trap last error.
Most of the context functions are now thread safe.
Autoflush is no longer called in situations when send procedure keeps failing repeatedly.
Added periodical interface statistics printings when run in verbose mode.
Improved documentation.
2018-10-09 libtrap-0.11.8
* libtrap:
Fix non-blocking recv in libtrap.
Fix possible write to uninitialized address.
Improved VERBOSE CPP macro to print file&line in debug.
2018-09-18 libtrap-0.11.7
* libtrap:
Bugfixes and performance improvement (locks rework)
* trap_stats:
Improved trap_stats argument to allow passing just PID
2018-07-30 libtrap-0.11.6
* libtrap:
bugfixes of TLS IFC
fixed bad error message (no error)
doc update
2018-07-16 libtrap-0.11.5
* libtrap:
bugfixes in file and TLS interfaces
2017-08-08 libtrap-0.11.0
* added TLS communication IFC
2017-08-07 libtrap-0.10.0
* extended API - new functions trap_ctx_init2() and trap_ctx_init3()
* changed name and path to sockets (/var/run/libtrap/)
* path to sockets can be specified in run-time (TRAP_SOCKET_DIR env variable)
* max clients of IFCs is configurable in compile-time
* many bugfixes
* added tests
* doc improved
2016-07-26 libtrap-0.8.0
* extended internal IFC API
* documentation improved and revisited
* added build target for Debian packages
* cleanup of 3rd party json code
* file IFC can rotate files (based on time or size)
* trap_stats (and supervisor) shows IFC identification (socket name)
* bugfixes:
- memory leak in service IFC
- handling byte order in headers of libtrap messages (incompatibility with older versions)
- additional checks in code
2016-02-28 libtrap-0.7.2
* trap_stats
* moved example into nemea-framework
* improved doc
2015-06-26 libtrap-0.7.0:
* added new tests
* documentation improved and revisited
- 2 levels of documentation: internal (libtrap developers) and public (Nemea developers)
* Nemea module parameters API - helpers
* non-blocking connect
* removed unused shmem IFC
* extended IFC API:
- get_client_count
- create dump of configuration and buffer for development purposes
* experimental support of file IFC (integrated trap{dump,replay}
* bugfixes
* added new tests
* JSON output of module's parameters
2015-06-20 libtrap-0.6.0:
* added new tests
* extended internal counters
* bugfixes:
- deadlocks during termination, disconnection
- revision blocking and non-blocking mode of IFCs
- service IFC
2014-03-30 libtrap-0.5.3:
* trap_send() & trap_recv()
* force flush of output IFCs on finalize
* PAGER for help (use e.g. export PAGER=less)
* bugfixes:
- init and finalize
- removed recovery limit
- delete of old unix socket
- service thread close
2014-02-20 libtrap-0.5.0:
* context libtrap API
* service interface for supervisor
* function for buffer flush
* constant text string with libtrap version
2013-10-28 libtrap-0.4.4:
* max number of clients is optional IFC parameter (in -i)
* using autools
* autoflush
+ + + + diff --git a/doc/libtrap/classes.html b/doc/libtrap/classes.html new file mode 100644 index 00000000..2db8b5e9 --- /dev/null +++ b/doc/libtrap/classes.html @@ -0,0 +1,65 @@ + + + + + + + +libtrap: Data Structure Index + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
Data Structure Index
+
+
+
j | t
+ + + + + + +
  j  
+
json_t   trap_module_info_parameter_s   
  t  
+
trap_module_info_s   
json_error_t   
trap_ifc_spec_s   
+
j | t
+
+ + + + diff --git a/doc/libtrap/closed.png b/doc/libtrap/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/doc/libtrap/closed.png differ diff --git a/doc/libtrap/deprecated.html b/doc/libtrap/deprecated.html new file mode 100644 index 00000000..d84946dc --- /dev/null +++ b/doc/libtrap/deprecated.html @@ -0,0 +1,62 @@ + + + + + + + +libtrap: Deprecated List + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
Deprecated List
+
+
+
+
Global TRAP_DEFAULT_GET_DATA_ERROR_HANDLING (ret_code, timeout_cmd, error_cmd)
+
This macro should be replaced by TRAP_DEFAULT_RECV_ERROR_HANDLING.
+
Global TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING (ret_code, timeout_cmd, error_cmd)
+
This macro should be replaced by TRAP_DEFAULT_SEND_ERROR_HANDLING.
+
Global trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
+
This function should be replaced by trap_send().
+
+
+ + + + diff --git a/doc/libtrap/dir_d10f943620c8cf996cd13f7b110dc16f.html b/doc/libtrap/dir_d10f943620c8cf996cd13f7b110dc16f.html new file mode 100644 index 00000000..ab76e311 --- /dev/null +++ b/doc/libtrap/dir_d10f943620c8cf996cd13f7b110dc16f.html @@ -0,0 +1,70 @@ + + + + + + + +libtrap: include/libtrap Directory Reference + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + + +
+
+
+
libtrap Directory Reference
+
+
+ + + + + + + + + + +

+Files

file  jansson.h [code]
 
file  trap.h [code]
 Interface of TRAP library.
 
file  trap_module_info.h [code]
 Structures containing information about Nemea modules and macros for initialization and release of these structures.
 
+
+ + + + diff --git a/doc/libtrap/dir_d44c64559bbebec7f509842c48db8b23.html b/doc/libtrap/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 00000000..722b400a --- /dev/null +++ b/doc/libtrap/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,64 @@ + + + + + + + +libtrap: include Directory Reference + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + + +
+
+
+
include Directory Reference
+
+
+ + + + +

+Directories

directory  libtrap
 
+
+ + + + diff --git a/doc/libtrap/doc.png b/doc/libtrap/doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/doc/libtrap/doc.png differ diff --git a/doc/libtrap/doxygen.css b/doc/libtrap/doxygen.css new file mode 100644 index 00000000..266c8b3a --- /dev/null +++ b/doc/libtrap/doxygen.css @@ -0,0 +1,1596 @@ +/* The standard CSS for doxygen 1.8.14 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +/* +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTableHead tr { +} + +table.markdownTableBodyLeft td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft { + text-align: left +} + +th.markdownTableHeadRight { + text-align: right +} + +th.markdownTableHeadCenter { + text-align: center +} +*/ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + + +/* @end */ diff --git a/doc/libtrap/doxygen.png b/doc/libtrap/doxygen.png new file mode 100644 index 00000000..3ff17d80 Binary files /dev/null and b/doc/libtrap/doxygen.png differ diff --git a/doc/libtrap/dynsections.js b/doc/libtrap/dynsections.js new file mode 100644 index 00000000..537e3e49 --- /dev/null +++ b/doc/libtrap/dynsections.js @@ -0,0 +1,127 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +libtrap: File List + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+
[detail level 123]
+ + + + + +
  include
  libtrap
 jansson.h
 trap.hInterface of TRAP library
 trap_module_info.hStructures containing information about Nemea modules and macros for initialization and release of these structures
+
+
+ + + + diff --git a/doc/libtrap/folderclosed.png b/doc/libtrap/folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/doc/libtrap/folderclosed.png differ diff --git a/doc/libtrap/folderopen.png b/doc/libtrap/folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/doc/libtrap/folderopen.png differ diff --git a/doc/libtrap/functions.html b/doc/libtrap/functions.html new file mode 100644 index 00000000..ba8a2e04 --- /dev/null +++ b/doc/libtrap/functions.html @@ -0,0 +1,105 @@ + + + + + + + +libtrap: Data Fields + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+
+ + + + diff --git a/doc/libtrap/functions_vars.html b/doc/libtrap/functions_vars.html new file mode 100644 index 00000000..e8e67d8f --- /dev/null +++ b/doc/libtrap/functions_vars.html @@ -0,0 +1,105 @@ + + + + + + + +libtrap: Data Fields - Variables + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+ + + + diff --git a/doc/libtrap/globals.html b/doc/libtrap/globals.html new file mode 100644 index 00000000..08df230c --- /dev/null +++ b/doc/libtrap/globals.html @@ -0,0 +1,66 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- a -

+
+ + + + diff --git a/doc/libtrap/globals_c.html b/doc/libtrap/globals_c.html new file mode 100644 index 00000000..aee0b519 --- /dev/null +++ b/doc/libtrap/globals_c.html @@ -0,0 +1,57 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- c -

+
+ + + + diff --git a/doc/libtrap/globals_defs.html b/doc/libtrap/globals_defs.html new file mode 100644 index 00000000..87224651 --- /dev/null +++ b/doc/libtrap/globals_defs.html @@ -0,0 +1,366 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+  + +

- a -

+ + +

- c -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- j -

+ + +

- t -

    +
  • trap_ctx_t +: trap.h +
  • +
  • TRAP_DEFAULT_FINALIZATION +: trap.h +
  • +
  • TRAP_DEFAULT_GET_DATA_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_INITIALIZATION +: trap.h +
  • +
  • TRAP_DEFAULT_RECV_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SEND_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SIGNAL_HANDLER +: trap.h +
  • +
  • TRAP_E_BAD_CERT +: trap.h +
  • +
  • TRAP_E_BAD_FPARAMS +: trap.h +
  • +
  • TRAP_E_BAD_IFC_INDEX +: trap.h +
  • +
  • TRAP_E_BADPARAMS +: trap.h +
  • +
  • TRAP_E_FIELDS_MISMATCH +: trap.h +
  • +
  • TRAP_E_FIELDS_SUBSET +: trap.h +
  • +
  • TRAP_E_FORMAT_CHANGED +: trap.h +
  • +
  • TRAP_E_FORMAT_MISMATCH +: trap.h +
  • +
  • TRAP_E_HELP +: trap.h +
  • +
  • TRAP_E_INITIALIZED +: trap.h +
  • +
  • TRAP_E_IO_ERROR +: trap.h +
  • +
  • TRAP_E_MEMORY +: trap.h +
  • +
  • TRAP_E_NEGOTIATION_FAILED +: trap.h +
  • +
  • TRAP_E_NOT_INITIALIZED +: trap.h +
  • +
  • TRAP_E_NOT_SELECTED +: trap.h +
  • +
  • TRAP_E_OK +: trap.h +
  • +
  • TRAP_E_TERMINATED +: trap.h +
  • +
  • TRAP_E_TIMEOUT +: trap.h +
  • +
  • TRAP_HALFWAIT +: trap.h +
  • +
  • TRAP_IFC_DELIMITER +: trap.h +
  • +
  • TRAP_IFC_MESSAGEQ_SIZE +: trap.h +
  • +
  • TRAP_IFC_PARAM_DELIMITER +: trap.h +
  • +
  • TRAP_IFC_TYPE_BLACKHOLE +: trap.h +
  • +
  • TRAP_IFC_TYPE_FILE +: trap.h +
  • +
  • TRAP_IFC_TYPE_GENERATOR +: trap.h +
  • +
  • TRAP_IFC_TYPE_SERVICE +: trap.h +
  • +
  • TRAP_IFC_TYPE_TCPIP +: trap.h +
  • +
  • TRAP_IFC_TYPE_TLS +: trap.h +
  • +
  • TRAP_IFC_TYPE_UNIX +: trap.h +
  • +
  • TRAP_NO_AUTO_FLUSH +: trap.h +
  • +
  • TRAP_NO_WAIT +: trap.h +
  • +
  • TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER +: trap.h +
  • +
  • TRAP_TIMEOUT_STR +: trap.h +
  • +
  • TRAP_WAIT +: trap.h +
  • +
+
+ + + + diff --git a/doc/libtrap/globals_enum.html b/doc/libtrap/globals_enum.html new file mode 100644 index 00000000..762582f1 --- /dev/null +++ b/doc/libtrap/globals_enum.html @@ -0,0 +1,67 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+ + + + diff --git a/doc/libtrap/globals_eval.html b/doc/libtrap/globals_eval.html new file mode 100644 index 00000000..78a0c9b5 --- /dev/null +++ b/doc/libtrap/globals_eval.html @@ -0,0 +1,115 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+ + + + diff --git a/doc/libtrap/globals_f.html b/doc/libtrap/globals_f.html new file mode 100644 index 00000000..c6206806 --- /dev/null +++ b/doc/libtrap/globals_f.html @@ -0,0 +1,75 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- f -

+
+ + + + diff --git a/doc/libtrap/globals_func.html b/doc/libtrap/globals_func.html new file mode 100644 index 00000000..3f1393d0 --- /dev/null +++ b/doc/libtrap/globals_func.html @@ -0,0 +1,417 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+  + +

- i -

    +
  • input_ifc_negotiation() +: trap.h +
  • +
+ + +

- j -

+ + +

- o -

    +
  • output_ifc_negotiation() +: trap.h +
  • +
+ + +

- t -

    +
  • trap_check_buffer_content() +: trap.h +
  • +
  • trap_create_module_info() +: trap_module_info.h +
  • +
  • trap_ctx_cmp_data_fmt() +: trap.h +
  • +
  • trap_ctx_create_ifc_dump() +: trap.h +
  • +
  • trap_ctx_finalize() +: trap.h +
  • +
  • trap_ctx_get_client_count() +: trap.h +
  • +
  • trap_ctx_get_data_fmt() +: trap.h +
  • +
  • trap_ctx_get_in_ifc_state() +: trap.h +
  • +
  • trap_ctx_get_last_error() +: trap.h +
  • +
  • trap_ctx_get_last_error_msg() +: trap.h +
  • +
  • trap_ctx_get_verbose_level() +: trap.h +
  • +
  • trap_ctx_ifcctl() +: trap.h +
  • +
  • trap_ctx_init() +: trap.h +
  • +
  • trap_ctx_init2() +: trap.h +
  • +
  • trap_ctx_init3() +: trap.h +
  • +
  • trap_ctx_recv() +: trap.h +
  • +
  • trap_ctx_send() +: trap.h +
  • +
  • trap_ctx_send_flush() +: trap.h +
  • +
  • trap_ctx_set_data_fmt() +: trap.h +
  • +
  • trap_ctx_set_required_fmt() +: trap.h +
  • +
  • trap_ctx_set_verbose_level() +: trap.h +
  • +
  • trap_ctx_terminate() +: trap.h +
  • +
  • trap_ctx_vifcctl() +: trap.h +
  • +
  • trap_ctx_vset_data_fmt() +: trap.h +
  • +
  • trap_ctx_vset_required_fmt() +: trap.h +
  • +
  • trap_finalize() +: trap.h +
  • +
  • trap_free_ifc_spec() +: trap.h +
  • +
  • trap_get_data_fmt() +: trap.h +
  • +
  • trap_get_global_ctx() +: trap.h +
  • +
  • trap_get_in_ifc_state() +: trap.h +
  • +
  • trap_get_param_by_delimiter() +: trap.h +
  • +
  • trap_get_type_and_name_from_string() +: trap.h +
  • +
  • trap_get_verbose_level() +: trap.h +
  • +
  • trap_ifcctl() +: trap.h +
  • +
  • trap_init() +: trap.h +
  • +
  • trap_parse_params() +: trap.h +
  • +
  • trap_print_help() +: trap.h +
  • +
  • trap_print_ifc_spec_help() +: trap.h +
  • +
  • trap_recv() +: trap.h +
  • +
  • trap_send() +: trap.h +
  • +
  • trap_send_data() +: trap.h +
  • +
  • trap_send_flush() +: trap.h +
  • +
  • trap_set_data_fmt() +: trap.h +
  • +
  • trap_set_help_section() +: trap.h +
  • +
  • trap_set_required_fmt() +: trap.h +
  • +
  • trap_set_verbose_level() +: trap.h +
  • +
  • trap_terminate() +: trap.h +
  • +
  • trap_update_module_param() +: trap_module_info.h +
  • +
+
+ + + + diff --git a/doc/libtrap/globals_g.html b/doc/libtrap/globals_g.html new file mode 100644 index 00000000..65f73fd8 --- /dev/null +++ b/doc/libtrap/globals_g.html @@ -0,0 +1,63 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- g -

+
+ + + + diff --git a/doc/libtrap/globals_i.html b/doc/libtrap/globals_i.html new file mode 100644 index 00000000..f2c05a35 --- /dev/null +++ b/doc/libtrap/globals_i.html @@ -0,0 +1,60 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- i -

+
+ + + + diff --git a/doc/libtrap/globals_j.html b/doc/libtrap/globals_j.html new file mode 100644 index 00000000..f02c6530 --- /dev/null +++ b/doc/libtrap/globals_j.html @@ -0,0 +1,426 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- j -

+
+ + + + diff --git a/doc/libtrap/globals_o.html b/doc/libtrap/globals_o.html new file mode 100644 index 00000000..28e61cb5 --- /dev/null +++ b/doc/libtrap/globals_o.html @@ -0,0 +1,57 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- o -

    +
  • output_ifc_negotiation() +: trap.h +
  • +
+
+ + + + diff --git a/doc/libtrap/globals_t.html b/doc/libtrap/globals_t.html new file mode 100644 index 00000000..75a78389 --- /dev/null +++ b/doc/libtrap/globals_t.html @@ -0,0 +1,390 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- t -

    +
  • trap_check_buffer_content() +: trap.h +
  • +
  • trap_create_module_info() +: trap_module_info.h +
  • +
  • trap_ctx_cmp_data_fmt() +: trap.h +
  • +
  • trap_ctx_create_ifc_dump() +: trap.h +
  • +
  • trap_ctx_finalize() +: trap.h +
  • +
  • trap_ctx_get_client_count() +: trap.h +
  • +
  • trap_ctx_get_data_fmt() +: trap.h +
  • +
  • trap_ctx_get_in_ifc_state() +: trap.h +
  • +
  • trap_ctx_get_last_error() +: trap.h +
  • +
  • trap_ctx_get_last_error_msg() +: trap.h +
  • +
  • trap_ctx_get_verbose_level() +: trap.h +
  • +
  • trap_ctx_ifcctl() +: trap.h +
  • +
  • trap_ctx_init() +: trap.h +
  • +
  • trap_ctx_init2() +: trap.h +
  • +
  • trap_ctx_init3() +: trap.h +
  • +
  • trap_ctx_recv() +: trap.h +
  • +
  • trap_ctx_send() +: trap.h +
  • +
  • trap_ctx_send_flush() +: trap.h +
  • +
  • trap_ctx_set_data_fmt() +: trap.h +
  • +
  • trap_ctx_set_required_fmt() +: trap.h +
  • +
  • trap_ctx_set_verbose_level() +: trap.h +
  • +
  • trap_ctx_t +: trap.h +
  • +
  • trap_ctx_terminate() +: trap.h +
  • +
  • trap_ctx_vifcctl() +: trap.h +
  • +
  • trap_ctx_vset_data_fmt() +: trap.h +
  • +
  • trap_ctx_vset_required_fmt() +: trap.h +
  • +
  • trap_data_format_t +: trap.h +
  • +
  • TRAP_DEFAULT_FINALIZATION +: trap.h +
  • +
  • TRAP_DEFAULT_GET_DATA_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_INITIALIZATION +: trap.h +
  • +
  • TRAP_DEFAULT_RECV_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SEND_ERROR_HANDLING +: trap.h +
  • +
  • TRAP_DEFAULT_SIGNAL_HANDLER +: trap.h +
  • +
  • trap_default_socket_path_format +: trap.h +
  • +
  • TRAP_E_BAD_CERT +: trap.h +
  • +
  • TRAP_E_BAD_FPARAMS +: trap.h +
  • +
  • TRAP_E_BAD_IFC_INDEX +: trap.h +
  • +
  • TRAP_E_BADPARAMS +: trap.h +
  • +
  • TRAP_E_FIELDS_MISMATCH +: trap.h +
  • +
  • TRAP_E_FIELDS_SUBSET +: trap.h +
  • +
  • TRAP_E_FORMAT_CHANGED +: trap.h +
  • +
  • TRAP_E_FORMAT_MISMATCH +: trap.h +
  • +
  • TRAP_E_HELP +: trap.h +
  • +
  • TRAP_E_INITIALIZED +: trap.h +
  • +
  • TRAP_E_IO_ERROR +: trap.h +
  • +
  • TRAP_E_MEMORY +: trap.h +
  • +
  • TRAP_E_NEGOTIATION_FAILED +: trap.h +
  • +
  • TRAP_E_NOT_INITIALIZED +: trap.h +
  • +
  • TRAP_E_NOT_SELECTED +: trap.h +
  • +
  • TRAP_E_OK +: trap.h +
  • +
  • TRAP_E_TERMINATED +: trap.h +
  • +
  • TRAP_E_TIMEOUT +: trap.h +
  • +
  • trap_finalize() +: trap.h +
  • +
  • TRAP_FMT_JSON +: trap.h +
  • +
  • TRAP_FMT_RAW +: trap.h +
  • +
  • TRAP_FMT_UNIREC +: trap.h +
  • +
  • TRAP_FMT_UNKNOWN +: trap.h +
  • +
  • trap_free_ifc_spec() +: trap.h +
  • +
  • trap_get_data_fmt() +: trap.h +
  • +
  • trap_get_global_ctx() +: trap.h +
  • +
  • trap_get_in_ifc_state() +: trap.h +
  • +
  • trap_get_param_by_delimiter() +: trap.h +
  • +
  • trap_get_type_and_name_from_string() +: trap.h +
  • +
  • trap_get_verbose_level() +: trap.h +
  • +
  • trap_git_version +: trap.h +
  • +
  • TRAP_HALFWAIT +: trap.h +
  • +
  • TRAP_IFC_DELIMITER +: trap.h +
  • +
  • TRAP_IFC_MESSAGEQ_SIZE +: trap.h +
  • +
  • TRAP_IFC_PARAM_DELIMITER +: trap.h +
  • +
  • trap_ifc_spec_t +: trap.h +
  • +
  • trap_ifc_type +: trap.h +
  • +
  • TRAP_IFC_TYPE_BLACKHOLE +: trap.h +
  • +
  • TRAP_IFC_TYPE_FILE +: trap.h +
  • +
  • TRAP_IFC_TYPE_GENERATOR +: trap.h +
  • +
  • TRAP_IFC_TYPE_SERVICE +: trap.h +
  • +
  • trap_ifc_type_supported +: trap.h +
  • +
  • TRAP_IFC_TYPE_TCPIP +: trap.h +
  • +
  • TRAP_IFC_TYPE_TLS +: trap.h +
  • +
  • TRAP_IFC_TYPE_UNIX +: trap.h +
  • +
  • trap_ifcctl() +: trap.h +
  • +
  • trap_ifcctl_request +: trap.h +
  • +
  • trap_in_ifc_state_t +: trap.h +
  • +
  • trap_init() +: trap.h +
  • +
  • trap_last_error +: trap.h +
  • +
  • trap_last_error_msg +: trap.h +
  • +
  • trap_module_info_parameter_t +: trap_module_info.h +
  • +
  • trap_module_info_t +: trap_module_info.h +
  • +
  • TRAP_NO_AUTO_FLUSH +: trap.h +
  • +
  • TRAP_NO_WAIT +: trap.h +
  • +
  • trap_parse_params() +: trap.h +
  • +
  • trap_print_help() +: trap.h +
  • +
  • trap_print_ifc_spec_help() +: trap.h +
  • +
  • trap_recv() +: trap.h +
  • +
  • TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER +: trap.h +
  • +
  • trap_send() +: trap.h +
  • +
  • trap_send_data() +: trap.h +
  • +
  • trap_send_flush() +: trap.h +
  • +
  • trap_set_data_fmt() +: trap.h +
  • +
  • trap_set_help_section() +: trap.h +
  • +
  • trap_set_required_fmt() +: trap.h +
  • +
  • trap_set_verbose_level() +: trap.h +
  • +
  • trap_terminate() +: trap.h +
  • +
  • TRAP_TIMEOUT_STR +: trap.h +
  • +
  • trap_update_module_param() +: trap_module_info.h +
  • +
  • trap_version +: trap.h +
  • +
  • TRAP_WAIT +: trap.h +
  • +
  • TRAPCTL_AUTOFLUSH_TIMEOUT +: trap.h +
  • +
  • TRAPCTL_BUFFERSWITCH +: trap.h +
  • +
  • TRAPCTL_SETTIMEOUT +: trap.h +
  • +
  • TRAPIFC_INPUT +: trap.h +
  • +
  • TRAPIFC_OUTPUT +: trap.h +
  • +
+
+ + + + diff --git a/doc/libtrap/globals_type.html b/doc/libtrap/globals_type.html new file mode 100644 index 00000000..2c7f828f --- /dev/null +++ b/doc/libtrap/globals_type.html @@ -0,0 +1,79 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+ + + + diff --git a/doc/libtrap/globals_vars.html b/doc/libtrap/globals_vars.html new file mode 100644 index 00000000..0cc4c8ca --- /dev/null +++ b/doc/libtrap/globals_vars.html @@ -0,0 +1,70 @@ + + + + + + + +libtrap: Globals + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
    +
  • trap_default_socket_path_format +: trap.h +
  • +
  • trap_git_version +: trap.h +
  • +
  • trap_ifc_type_supported +: trap.h +
  • +
  • trap_last_error +: trap.h +
  • +
  • trap_last_error_msg +: trap.h +
  • +
  • trap_version +: trap.h +
  • +
+
+ + + + diff --git a/doc/libtrap/graph_legend.html b/doc/libtrap/graph_legend.html new file mode 100644 index 00000000..d4198299 --- /dev/null +++ b/doc/libtrap/graph_legend.html @@ -0,0 +1,83 @@ + + + + + + + +libtrap: Graph Legend + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
Graph Legend
+
+
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };
/* Class not documented with doxygen comments */
class Undocumented { };
/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };
/*! A template class */
template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */
class ProtectedBase { };
/*! Class that is inherited using private inheritance */
class PrivateBase { };
/*! Class that is used by the Inherited class */
class Used { };
/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};

This will result in the following graph:

+
+ +
+

The boxes in the above graph have the following meaning:

+
    +
  • +A filled gray box represents the struct or class for which the graph is generated.
  • +
  • +A box with a black border denotes a documented struct or class.
  • +
  • +A box with a gray border denotes an undocumented struct or class.
  • +
  • +A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
  • +
+

The arrows have the following meaning:

+
    +
  • +A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • +
  • +A dark green arrow is used for protected inheritance.
  • +
  • +A dark red arrow is used for private inheritance.
  • +
  • +A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
  • +
  • +A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.
  • +
+
+ + + + diff --git a/doc/libtrap/graph_legend.md5 b/doc/libtrap/graph_legend.md5 new file mode 100644 index 00000000..2f2b0c86 --- /dev/null +++ b/doc/libtrap/graph_legend.md5 @@ -0,0 +1 @@ +6ba764f90c0f7463ae4482bca4fe18ee \ No newline at end of file diff --git a/doc/libtrap/graph_legend.png b/doc/libtrap/graph_legend.png new file mode 100644 index 00000000..3d2489bf Binary files /dev/null and b/doc/libtrap/graph_legend.png differ diff --git a/doc/libtrap/group__commonapi.html b/doc/libtrap/group__commonapi.html new file mode 100644 index 00000000..4ee786d1 --- /dev/null +++ b/doc/libtrap/group__commonapi.html @@ -0,0 +1,517 @@ + + + + + + + +libtrap: Common libtrap API + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Common libtrap API
+
+
+
+Collaboration diagram for Common libtrap API:
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + +

+Modules

 Error codes
 
 TRAP Timeout
 
 Specifier of TRAP interfaces
 
 Message format
 
 Parameters of modules
 
+ + + +

+Data Structures

struct  trap_ifc_spec_s
 
+ + + + +

+Macros

#define TRAP_IFC_MESSAGEQ_SIZE   100000
 size of message queue used for buffering More...
 
+ + + +

+Typedefs

typedef struct trap_ifc_spec_s trap_ifc_spec_t
 
+ + + + + + + + + + + + + + + + + +

+Functions

const char * trap_get_type_and_name_from_string (const char *source, const char **name, const char **type, int *length_name, int *length_type)
 
int trap_ctx_cmp_data_fmt (const char *sender_ifc_data_fmt, const char *receiver_ifc_data_fmt)
 
void * trap_get_global_ctx ()
 
int trap_get_in_ifc_state (uint32_t ifc_idx)
 
int trap_parse_params (int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
 
char * trap_get_param_by_delimiter (const char *source, char **dest, const char delimiter)
 Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter. More...
 
int trap_check_buffer_content (void *buffer, uint32_t buffer_size)
 Check content of buffer, iterate over message headers. More...
 
+ + + + + + + +

+Variables

const char trap_version []
 
const char trap_git_version []
 
char * trap_default_socket_path_format
 
+ + + +

+TRAP interface control request

enum  trap_ifcctl_request { TRAPCTL_AUTOFLUSH_TIMEOUT = 1, +TRAPCTL_BUFFERSWITCH = 2, +TRAPCTL_SETTIMEOUT = 3 + }
 
+

Detailed Description

+

This module declares basic public constants, structures and functions of libtrap.

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_MESSAGEQ_SIZE

+ +
+
+ + + + +
#define TRAP_IFC_MESSAGEQ_SIZE   100000
+
+ +

size of message queue used for buffering

+ +

Definition at line 206 of file trap.h.

+ +
+
+

Typedef Documentation

+ +

◆ trap_ifc_spec_t

+ +
+
+ + + + +
typedef struct trap_ifc_spec_s trap_ifc_spec_t
+
+

Structure with specification of interface types and their parameters. This can be filled by command-line parameters using trap_parse_params function.

+ +
+
+

Enumeration Type Documentation

+ +

◆ trap_ifcctl_request

+ +
+
+ + + + +
enum trap_ifcctl_request
+
+ + + + +
Enumerator
TRAPCTL_AUTOFLUSH_TIMEOUT 

Set timeout of automatic buffer flushing for interface, expects uint64_t argument with number of microseconds. It can be set to TRAP_NO_AUTO_FLUSH to disable autoflush.

+
TRAPCTL_BUFFERSWITCH 

Enable/disable buffering - could be dangerous on input interface!!! expects char argument with value 1 (default value after libtrap initialization - enabled) or 0 (for disabling buffering on interface).

+
TRAPCTL_SETTIMEOUT 

Set interface timeout (int32_t): in microseconds for non-blocking mode; timeout can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.

+
+ +

Definition at line 198 of file trap.h.

+ +
+
+

Function Documentation

+ +

◆ trap_check_buffer_content()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_check_buffer_content (void * buffer,
uint32_t buffer_size 
)
+
+ +

Check content of buffer, iterate over message headers.

+
Parameters
+ + + +
[in]bufferstart of buffer
[in]buffer_sizesize of buffer
+
+
+
Returns
0 on success, number of errors otherwise
+ +
+
+ +

◆ trap_ctx_cmp_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_cmp_data_fmt (const char * sender_ifc_data_fmt,
const char * receiver_ifc_data_fmt 
)
+
+

Compares sender_ifc template and receiver_ifc template and returns whether receivers template is subset of the senders template.

+
Parameters
+ + + +
[in]sender_ifc_data_fmtsender_ifc template (char *)
[in]receiver_ifc_data_fmtreceiver_ifc template (char *)
+
+
+
Returns
TRAP_E_OK on success (receivers template is subset of the senders template), TRAP_E_FIELDS_MISMATCH (receivers template has field which is not in senders template).
+ +
+
+ +

◆ trap_get_global_ctx()

+ +
+
+ + + + + + + +
void* trap_get_global_ctx ()
+
+

Returns global context.

+
Returns
pointer to global context.
+ +
+
+ +

◆ trap_get_in_ifc_state()

+ +
+
+ + + + + + + + +
int trap_get_in_ifc_state (uint32_t ifc_idx)
+
+

Returns current state of an input interface on specified index.

+
Parameters
+ + +
[in]ifc_idxIndex of the input interface
+
+
+
Returns
See trap_ctx_get_in_ifc_state().
+ +
+
+ +

◆ trap_get_param_by_delimiter()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
char* trap_get_param_by_delimiter (const char * source,
char ** dest,
const char delimiter 
)
+
+ +

Splitter of params string. Cut the first param, copy it into dest and returns pointer to the start of following parameter.

+
Parameters
+ + + + +
[in]sourcesource string, typically params
[out]destdestination string, target of first paramater copying
[in]delimiterseparator of values in params
+
+
+
Returns
Pointer to the start of following parameter (char after delimiter).
+
Note
If NULL, no other parameter is present or error during allocation occured.
+ +
+
+ +

◆ trap_get_type_and_name_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char* trap_get_type_and_name_from_string (const char * source,
const char ** name,
const char ** type,
int * length_name,
int * length_type 
)
+
+

Parse Fields name and types from string.

+

Function parses the source string and sets the given pointers (pointers to source string). Than it sets length of name and type

+
Parameters
+ + + + + + +
[in]sourceSource string to parse.
[in]nameouput parameter, where will be set the pointer to name of a field (pointer to source string).
[in]typeouput parameter, where will be set the pointer to type of a field (pointer to source string).
[in]length_nameouput parameter, where will be set the length of a name.
[in]length_typeouput parameter, where will be set the length of a type.
+
+
+
Returns
pointer to source string, moved to next field
+ +
+
+ +

◆ trap_parse_params()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_parse_params (int * argc,
char ** argv,
trap_ifc_spec_tifc_spec 
)
+
+

Parse command-line arguments. Extract arguments needed by TRAP to set up interfaces (-i params), verbosity level (-v/-vv/-vvv) and return the rest (argc and argv are modified, i.e. processed parameter is removed). Extracted information is stored into ifc_spec. These variables should be passed to trap_init. Data in ifc_spec must be freed by trap_free_ifc_spec. If help is requested (-h/–help) TRAP_E_HELP is returned (argc and argv are modified also).

Parameters
+ + + + +
[in,out]argcPointer to number of command-line arguments.
[in,out]argvCommand-line arguments.
[out]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Error code (0 on success)
+ +
+
+

Variable Documentation

+ +

◆ trap_default_socket_path_format

+ +
+
+ + + + +
char* trap_default_socket_path_format
+
+

Text string with default path format to sockets (UNIX IFC and service IFC). Assigned in ifc_tcpip.h

+ +
+
+ +

◆ trap_git_version

+ +
+
+ + + + +
const char trap_git_version[]
+
+

Text string with Git revision of libtrap.

+ +
+
+ +

◆ trap_version

+ +
+
+ + + + +
const char trap_version[]
+
+

Text string with libtrap version.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__commonapi.map b/doc/libtrap/group__commonapi.map new file mode 100644 index 00000000..4d9dea6c --- /dev/null +++ b/doc/libtrap/group__commonapi.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/libtrap/group__commonapi.md5 b/doc/libtrap/group__commonapi.md5 new file mode 100644 index 00000000..8a04a260 --- /dev/null +++ b/doc/libtrap/group__commonapi.md5 @@ -0,0 +1 @@ +a5f6b41dafa302537f346db92d7a32fc \ No newline at end of file diff --git a/doc/libtrap/group__commonapi.png b/doc/libtrap/group__commonapi.png new file mode 100644 index 00000000..54282278 Binary files /dev/null and b/doc/libtrap/group__commonapi.png differ diff --git a/doc/libtrap/group__contextapi.html b/doc/libtrap/group__contextapi.html new file mode 100644 index 00000000..07d37950 --- /dev/null +++ b/doc/libtrap/group__contextapi.html @@ -0,0 +1,794 @@ + + + + + + + +libtrap: Context API + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Context API
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

trap_ctx_ttrap_ctx_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init2 (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
trap_ctx_ttrap_ctx_init3 (const char *name, const char *description, int8_t i_ifcs, int8_t o_ifcs, const char *ifc_spec, const char *service_ifcname)
 Initialize and return the context of libtrap. More...
 
int trap_ctx_finalize (trap_ctx_t **ctx)
 Terminate libtrap context and free resources. More...
 
int trap_ctx_terminate (trap_ctx_t *ctx)
 Terminate libtrap context. More...
 
int trap_ctx_recv (trap_ctx_t *ctx, uint32_t ifc, const void **data, uint16_t *size)
 Read data from input interface. More...
 
int trap_ctx_send (trap_ctx_t *ctx, unsigned int ifc, const void *data, uint16_t size)
 Send data via output interface. More...
 
void trap_ctx_set_verbose_level (trap_ctx_t *ctx, int level)
 Set verbosity level of library functions. More...
 
int trap_ctx_get_verbose_level (trap_ctx_t *ctx)
 Get verbosity level. More...
 
int trap_ctx_ifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
int trap_ctx_vifcctl (trap_ctx_t *ctx, int8_t type, uint32_t ifcidx, int32_t request, va_list ap)
 Control TRAP interface. More...
 
int trap_ctx_get_last_error (trap_ctx_t *ctx)
 Get last result code from libtrap context. More...
 
const char * trap_ctx_get_last_error_msg (trap_ctx_t *ctx)
 Get last (error) message from libtrap context. More...
 
void trap_ctx_send_flush (trap_ctx_t *ctx, uint32_t ifc)
 Force flush of buffer. More...
 
int trap_ctx_get_client_count (trap_ctx_t *ctx, uint32_t ifcidx)
 Get number of connected clients. More...
 
void trap_ctx_create_ifc_dump (trap_ctx_t *ctx, const char *path)
 Create dump files. More...
 
+

Detailed Description

+

This API allows user to use multiple instances of libtrap in the same process.

+

The API is similar to Simple API. The difference is in the private context memory that is returned by trap_ctx_init() and is freed by trap_ctx_finalize(). Obtained context pointer must be passed to all functions from context API.

+

Function Documentation

+ +

◆ trap_ctx_create_ifc_dump()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_create_ifc_dump (trap_ctx_tctx,
const char * path 
)
+
+ +

Create dump files.

+

Create dump files for debug as follows: trap-i[number]-config.txt Output interface configuration. trap-i[number]-buffer.dat Output interface buffer trap-o[number]-config.txt Input interface configuration. trap-o[number]-buffer.dat Input interface buffer

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]pathOutput directory, if NULL use current working directory.
+
+
+ +
+
+ +

◆ trap_ctx_finalize()

+ +
+
+ + + + + + + + +
int trap_ctx_finalize (trap_ctx_t ** ctx)
+
+ +

Terminate libtrap context and free resources.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
TRAP_E_OK on success.
+ +
+
+ +

◆ trap_ctx_get_client_count()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_get_client_count (trap_ctx_tctx,
uint32_t ifcidx 
)
+
+ +

Get number of connected clients.

+

Output interface (TCP or UNIX) allows to send messages to multiple clients. This function reads number of connected clients from internal interface structure.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcidxIFC Index of output interface.
+
+
+
Returns
Number of connected clients. -1 on error.
+ +
+
+ +

◆ trap_ctx_get_last_error()

+ +
+
+ + + + + + + + +
int trap_ctx_get_last_error (trap_ctx_tctx)
+
+ +

Get last result code from libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Error codes
+ +
+
+ +

◆ trap_ctx_get_last_error_msg()

+ +
+
+ + + + + + + + +
const char* trap_ctx_get_last_error_msg (trap_ctx_tctx)
+
+ +

Get last (error) message from libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Text string with last (error) message from libtrap context.
+ +
+
+ +

◆ trap_ctx_get_verbose_level()

+ +
+
+ + + + + + + + +
int trap_ctx_get_verbose_level (trap_ctx_tctx)
+
+ +

Get verbosity level.

+
See also
trap_set_verbose_level for the list of levels.
+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
Verbosity level currently set in the library.
+ +
+
+ +

◆ trap_ctx_ifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_ifcctl (trap_ctx_tctx,
int8_t type,
uint32_t ifcidx,
int32_t request,
 ... 
)
+
+ +

Control TRAP interface.

+

This function is thread safe.

+
Note
Type and request types were changed from enum because of python wrapper.
+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]...arguments of request, see trap_ifcctl_request for more details on requests and their arguments.
+
+
+

Examples:

// set 4 seconds timeout
// disable auto-flush
// disable buffering
Returns
TRAP_E_OK on success
+ +
+
+ +

◆ trap_ctx_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
trap_ctx_t* trap_ctx_init (trap_module_info_tmodule_info,
trap_ifc_spec_t ifc_spec 
)
+
+ +

Initialize and return the context of libtrap.

+

This function is thread safe.

+
Parameters
+ + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +
+
+ +

◆ trap_ctx_init2()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
trap_ctx_t* trap_ctx_init2 (trap_module_info_tmodule_info,
trap_ifc_spec_t ifc_spec,
const char * service_ifcname 
)
+
+ +

Initialize and return the context of libtrap.

+

This function is thread safe.

+
Parameters
+ + + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
[in]service_ifcnameIdentifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +
+
+ +

◆ trap_ctx_init3()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trap_ctx_t* trap_ctx_init3 (const char * name,
const char * description,
int8_t i_ifcs,
int8_t o_ifcs,
const char * ifc_spec,
const char * service_ifcname 
)
+
+ +

Initialize and return the context of libtrap.

+

This function is thread safe.

+
Parameters
+ + + + + + + +
[in]nameName of the NEMEA module (libtrap context).
[in]description- Detailed description of the module, can be NULL ("" will be used in such case)
[in]i_ifcsNumber of input IFCs, it can be -1 if o_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
[in]o_ifcsNumber of output IFCs, it can be -1 if i_ifcs > -1 (-1 means variable number of IFCs, it is then computed from ifc_spec).
[in]ifc_specIFC_SPEC stringdescribed in README.ifcspec.md
[in]service_ifcnameIdentifier of the service IFC (used as a part of path to the UNIX socket). When NULL is used, no service IFC will be opened.
+
+
+
Returns
Pointer to context (context needs to be checked for error value by trap_ctx_get_last_error() function), NULL on memory error.
+ +
+
+ +

◆ trap_ctx_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_recv (trap_ctx_tctx,
uint32_t ifc,
const void ** data,
uint16_t * size 
)
+
+ +

Read data from input interface.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIndex of input interface (counted from 0).
[out]dataPointer to received data.
[out]sizeSize of received data in bytes.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ctx_ifcctl
+ +
+
+ +

◆ trap_ctx_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_send (trap_ctx_tctx,
unsigned int ifc,
const void * data,
uint16_t size 
)
+
+ +

Send data via output interface.

+

Write data of size size given by data pointer into interface ifc. If data cannot be written immediately (e.g. because of full buffer or lost connection), wait until write is possible or timeout microseconds elapses. If timeout < 0, wait indefinitely. This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIndex of interface to write into.
[in]dataPointer to data.
[in]sizeNumber of bytes of data.
+
+
+
Returns
Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ctx_ifcctl
+ +
+
+ +

◆ trap_ctx_send_flush()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_send_flush (trap_ctx_tctx,
uint32_t ifc 
)
+
+ +

Force flush of buffer.

+

This function is thread safe.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifcIFC Index of interface to write into.
+
+
+ +
+
+ +

◆ trap_ctx_set_verbose_level()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void trap_ctx_set_verbose_level (trap_ctx_tctx,
int level 
)
+
+ +

Set verbosity level of library functions.

+

Verbosity levels may be:

    +
  • -3 - errors
  • +
  • -2 - warnings
  • +
  • -1 - notices (default)
  • +
  • 0 - verbose
  • +
  • 1 - more verbose
  • +
  • 2 - even more verbose
  • +
+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]levelDesired level of verbosity.
+
+
+ +
+
+ +

◆ trap_ctx_terminate()

+ +
+
+ + + + + + + + +
int trap_ctx_terminate (trap_ctx_tctx)
+
+ +

Terminate libtrap context.

+

This function is thread safe.

+
Parameters
+ + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
+
+
+
Returns
TRAP_E_OK on success.
+ +
+
+ +

◆ trap_ctx_vifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_vifcctl (trap_ctx_tctx,
int8_t type,
uint32_t ifcidx,
int32_t request,
va_list ap 
)
+
+ +

Control TRAP interface.

+

This function is thread safe.

+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]aparguments of request.
+
+
+
Returns
TRAP_E_OK on success
+
See also
trap_ctx_ifcctl().
+ +
+
+
+ + + + diff --git a/doc/libtrap/group__errorcodes.html b/doc/libtrap/group__errorcodes.html new file mode 100644 index 00000000..c309d778 --- /dev/null +++ b/doc/libtrap/group__errorcodes.html @@ -0,0 +1,449 @@ + + + + + + + +libtrap: Error codes + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
+
+
+
+Collaboration diagram for Error codes:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_E_OK   0
 Success, no error. More...
 
#define TRAP_E_TIMEOUT   1
 Read or write operation timeout. More...
 
#define TRAP_E_INITIALIZED   10
 TRAP library already initilized. More...
 
#define TRAP_E_BADPARAMS   11
 Bad parameters passed to interface initializer. More...
 
#define TRAP_E_BAD_IFC_INDEX   12
 Interface index out of range. More...
 
#define TRAP_E_BAD_FPARAMS   13
 Bad parameters of function. More...
 
#define TRAP_E_IO_ERROR   14
 IO Error. More...
 
#define TRAP_E_TERMINATED   15
 Interface was terminated during reading/writing. More...
 
#define TRAP_E_NOT_SELECTED   16
 Interface was not selected reading/writing. More...
 
#define TRAP_E_BAD_CERT   17
 Wrong certificate given to TLS interface. More...
 
#define TRAP_E_HELP   20
 Returned by parse_parameters when help is requested. More...
 
#define TRAP_E_FIELDS_MISMATCH   21
 Returned when receiver fields are not subset of sender fields. More...
 
#define TRAP_E_FIELDS_SUBSET   22
 Returned when receivers fields are subset of senders fields and both sets are not identical. More...
 
#define TRAP_E_FORMAT_CHANGED   23
 Returned by trap_recv when format or format spec of the receivers interface has been changed. More...
 
#define TRAP_E_FORMAT_MISMATCH   24
 Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match. More...
 
#define TRAP_E_NEGOTIATION_FAILED   25
 Returned by trap_recv when negotiation of the output and input interfaces failed. More...
 
#define TRAP_E_NOT_INITIALIZED   254
 TRAP library not initilized. More...
 
#define TRAP_E_MEMORY   255
 Memory allocation error. More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ TRAP_E_BAD_CERT

+ +
+
+ + + + +
#define TRAP_E_BAD_CERT   17
+
+ +

Wrong certificate given to TLS interface.

+ +

Definition at line 96 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BAD_FPARAMS

+ +
+
+ + + + +
#define TRAP_E_BAD_FPARAMS   13
+
+ +

Bad parameters of function.

+ +

Definition at line 92 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BAD_IFC_INDEX

+ +
+
+ + + + +
#define TRAP_E_BAD_IFC_INDEX   12
+
+ +

Interface index out of range.

+ +

Definition at line 91 of file trap.h.

+ +
+
+ +

◆ TRAP_E_BADPARAMS

+ +
+
+ + + + +
#define TRAP_E_BADPARAMS   11
+
+ +

Bad parameters passed to interface initializer.

+ +

Definition at line 90 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FIELDS_MISMATCH

+ +
+
+ + + + +
#define TRAP_E_FIELDS_MISMATCH   21
+
+ +

Returned when receiver fields are not subset of sender fields.

+ +

Definition at line 98 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FIELDS_SUBSET

+ +
+
+ + + + +
#define TRAP_E_FIELDS_SUBSET   22
+
+ +

Returned when receivers fields are subset of senders fields and both sets are not identical.

+ +

Definition at line 99 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FORMAT_CHANGED

+ +
+
+ + + + +
#define TRAP_E_FORMAT_CHANGED   23
+
+ +

Returned by trap_recv when format or format spec of the receivers interface has been changed.

+ +

Definition at line 100 of file trap.h.

+ +
+
+ +

◆ TRAP_E_FORMAT_MISMATCH

+ +
+
+ + + + +
#define TRAP_E_FORMAT_MISMATCH   24
+
+ +

Returned by trap_recv when data format or data specifier of the output and input interfaces doesn't match.

+ +

Definition at line 101 of file trap.h.

+ +
+
+ +

◆ TRAP_E_HELP

+ +
+
+ + + + +
#define TRAP_E_HELP   20
+
+ +

Returned by parse_parameters when help is requested.

+ +

Definition at line 97 of file trap.h.

+ +
+
+ +

◆ TRAP_E_INITIALIZED

+ +
+
+ + + + +
#define TRAP_E_INITIALIZED   10
+
+ +

TRAP library already initilized.

+ +

Definition at line 89 of file trap.h.

+ +
+
+ +

◆ TRAP_E_IO_ERROR

+ +
+
+ + + + +
#define TRAP_E_IO_ERROR   14
+
+ +

IO Error.

+ +

Definition at line 93 of file trap.h.

+ +
+
+ +

◆ TRAP_E_MEMORY

+ +
+
+ + + + +
#define TRAP_E_MEMORY   255
+
+ +

Memory allocation error.

+ +

Definition at line 104 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NEGOTIATION_FAILED

+ +
+
+ + + + +
#define TRAP_E_NEGOTIATION_FAILED   25
+
+ +

Returned by trap_recv when negotiation of the output and input interfaces failed.

+ +

Definition at line 102 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NOT_INITIALIZED

+ +
+
+ + + + +
#define TRAP_E_NOT_INITIALIZED   254
+
+ +

TRAP library not initilized.

+ +

Definition at line 103 of file trap.h.

+ +
+
+ +

◆ TRAP_E_NOT_SELECTED

+ +
+
+ + + + +
#define TRAP_E_NOT_SELECTED   16
+
+ +

Interface was not selected reading/writing.

+ +

Definition at line 95 of file trap.h.

+ +
+
+ +

◆ TRAP_E_OK

+ +
+
+ + + + +
#define TRAP_E_OK   0
+
+ +

Success, no error.

+ +

Definition at line 87 of file trap.h.

+ +
+
+ +

◆ TRAP_E_TERMINATED

+ +
+
+ + + + +
#define TRAP_E_TERMINATED   15
+
+ +

Interface was terminated during reading/writing.

+ +

Definition at line 94 of file trap.h.

+ +
+
+ +

◆ TRAP_E_TIMEOUT

+ +
+
+ + + + +
#define TRAP_E_TIMEOUT   1
+
+ +

Read or write operation timeout.

+ +

Definition at line 88 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__errorcodes.map b/doc/libtrap/group__errorcodes.map new file mode 100644 index 00000000..6ea39bcd --- /dev/null +++ b/doc/libtrap/group__errorcodes.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/group__errorcodes.md5 b/doc/libtrap/group__errorcodes.md5 new file mode 100644 index 00000000..62ee1ff0 --- /dev/null +++ b/doc/libtrap/group__errorcodes.md5 @@ -0,0 +1 @@ +0e8e090b800d84ee03f83eaad4362893 \ No newline at end of file diff --git a/doc/libtrap/group__errorcodes.png b/doc/libtrap/group__errorcodes.png new file mode 100644 index 00000000..4844e347 Binary files /dev/null and b/doc/libtrap/group__errorcodes.png differ diff --git a/doc/libtrap/group__ifctypes.html b/doc/libtrap/group__ifctypes.html new file mode 100644 index 00000000..f6dc2920 --- /dev/null +++ b/doc/libtrap/group__ifctypes.html @@ -0,0 +1,271 @@ + + + + + + + +libtrap: Types of IFC + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+ +
+
+Collaboration diagram for Types of IFC:
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_IFC_TYPE_GENERATOR   'g'
 trap_ifc_dummy generator (input) More...
 
#define TRAP_IFC_TYPE_BLACKHOLE   'b'
 trap_ifc_dummy blackhole (output) More...
 
#define TRAP_IFC_TYPE_TCPIP   't'
 trap_ifc_tcpip (input&output part) More...
 
#define TRAP_IFC_TYPE_TLS   'T'
 trap_ifc_tls (input&output part) More...
 
#define TRAP_IFC_TYPE_UNIX   'u'
 trap_ifc_tcpip via UNIX socket(input&output part) More...
 
#define TRAP_IFC_TYPE_SERVICE   's'
 service ifc More...
 
#define TRAP_IFC_TYPE_FILE   'f'
 trap_ifc_file (input&output part) More...
 
+ + + +

+Enumerations

enum  trap_ifc_type { TRAPIFC_INPUT = 1, +TRAPIFC_OUTPUT = 2 + }
 
+ + + +

+Variables

char trap_ifc_type_supported []
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_TYPE_BLACKHOLE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_BLACKHOLE   'b'
+
+ +

trap_ifc_dummy blackhole (output)

+ +

Definition at line 172 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_FILE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_FILE   'f'
+
+ +

trap_ifc_file (input&output part)

+ +

Definition at line 177 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_GENERATOR

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_GENERATOR   'g'
+
+ +

trap_ifc_dummy generator (input)

+ +

Definition at line 171 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_SERVICE

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_SERVICE   's'
+
+ +

service ifc

+ +

Definition at line 176 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_TCPIP

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_TCPIP   't'
+
+ +

trap_ifc_tcpip (input&output part)

+ +

Definition at line 173 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_TLS

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_TLS   'T'
+
+ +

trap_ifc_tls (input&output part)

+ +

Definition at line 174 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_TYPE_UNIX

+ +
+
+ + + + +
#define TRAP_IFC_TYPE_UNIX   'u'
+
+ +

trap_ifc_tcpip via UNIX socket(input&output part)

+ +

Definition at line 175 of file trap.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ trap_ifc_type

+ +
+
+ + + + +
enum trap_ifc_type
+
+

Type of interface (direction)

+ + + +
Enumerator
TRAPIFC_INPUT 

interface acts as source of data for module

+
TRAPIFC_OUTPUT 

interface is used for sending data out of module

+
+ +

Definition at line 183 of file trap.h.

+ +
+
+

Variable Documentation

+ +

◆ trap_ifc_type_supported

+ +
+
+ + + + +
char trap_ifc_type_supported[]
+
+ +
+
+
+ + + + diff --git a/doc/libtrap/group__ifctypes.map b/doc/libtrap/group__ifctypes.map new file mode 100644 index 00000000..19a8c882 --- /dev/null +++ b/doc/libtrap/group__ifctypes.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/group__ifctypes.md5 b/doc/libtrap/group__ifctypes.md5 new file mode 100644 index 00000000..c16f8faf --- /dev/null +++ b/doc/libtrap/group__ifctypes.md5 @@ -0,0 +1 @@ +f16d8a0e182aebaaf779ed4004492c40 \ No newline at end of file diff --git a/doc/libtrap/group__ifctypes.png b/doc/libtrap/group__ifctypes.png new file mode 100644 index 00000000..38c6b50c Binary files /dev/null and b/doc/libtrap/group__ifctypes.png differ diff --git a/doc/libtrap/group__module__parameters.html b/doc/libtrap/group__module__parameters.html new file mode 100644 index 00000000..91ce9392 --- /dev/null +++ b/doc/libtrap/group__module__parameters.html @@ -0,0 +1,858 @@ + + + + + + + +libtrap: Parameters of modules + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Parameters of modules
+
+
+
+Collaboration diagram for Parameters of modules:
+
+
+ + + +
+
+ + + + + + +

+Data Structures

struct  trap_module_info_parameter_s
 
struct  trap_module_info_s
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define GEN_LONG_OPT_STRUCT_LINE(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)   {p_long_opt, p_required_argument, 0, p_short_opt},
 
#define GEN_LONG_OPT_STRUCT(PARAMS)
 
#define ALLOCATE_BASIC_INFO_2(module_info, p_name, p_description, p_input, p_output)
 
#define ALLOCATE_BASIC_INFO(p_name, p_description, p_input, p_output)   ALLOCATE_BASIC_INFO_2(module_info, p_name, p_description, p_input, p_output)
 
#define ALLOCATE_PARAM_ITEMS_2(m, param_id, p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
 
#define ALLOCATE_PARAM_ITEMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
 
#define FREE_BASIC_INFO(p_name, p_description, p_input, p_output)
 
#define FREE_PARAM_ITEMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
 
#define GENERATE_GETOPT_STRING(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
 
#define COUNT_MODULE_PARAMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)   trap_module_params_cnt++;
 
#define INIT_MODULE_INFO_STRUCT(BASIC, PARAMS)
 
#define FREE_MODULE_INFO_STRUCT(BASIC, PARAMS)
 
+ + + + + +

+Typedefs

typedef struct trap_module_info_parameter_s trap_module_info_parameter_t
 
typedef struct trap_module_info_s trap_module_info_t
 
+ + + + + +

+Functions

trap_module_info_ttrap_create_module_info (const char *mname, const char *mdesc, int8_t i_ifcs, int8_t o_ifcs, uint16_t param_count)
 
int trap_update_module_param (trap_module_info_t *m, uint16_t param_id, char shortopt, const char *longopt, const char *desc, int req_arg, const char *arg_type)
 
+

Detailed Description

+

This section contains a set of macros that should be used for definition of parameters for a module. Usage of these macros helps to generate machine readable information about module that can be read e.g. by supervisor.

+

+Example of usage of module's parameters

+

This example show the usage of macros defined in this section.

+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <getopt.h>
#include "module_info_test.h"
module_info_test_t *module_info = NULL;
// Definition of basic module information - module name, module description,
// number of input and output interfaces
#define MODULE_BASIC_INFO(BASIC) \
BASIC("name", "description", 1, 1)
// Definition of module parameters - every parameter has short_opt, long_opt,
// description, flag whether argument is required or it is optional
// and argument type which is NULL in case the parameter does not need argument
#define MODULE_PARAMS(PARAM) \
PARAM('s', "long_opt", "description", 0, NULL) \
PARAM('b', "long_opt2", "description2", 1, "argument_type") \
PARAM('d', "long_opt3", "description3", 1, "argument_type") \
PARAM('u', "long_opt4", "description4", 0, NULL) \
PARAM('i', "long_opt5", "description5", 1, "argument_type") \
PARAM('c', "long_opt6", "description6", 1, "argument_type")
int main()
{
uint32_t x = 0;
// Allocate and initialize module_info structure and all its members
// according to the MODULE_BASIC_INFO and MODULE_PARAMS definitions
INIT_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS);
printf("--- Module_info structure after initialization ---\n");
printf("Basic info: %s %s %d %d\nParams:\n", module_info->name,
module_info->description, module_info->num_in_ifc,
module_info->num_out_ifc);
for (x = 0; x < trap_module_params_cnt; x++) {
printf("-%c --%s %s %d %s\n", module_info->params[x].short_opt,
module_info->params[x].long_opt,
module_info->params[x].description,
module_info->params[x].param_required_argument,
module_info->params[x].argument_type);
}
// Generate long_options array of structures for getopt_long function
GEN_LONG_OPT_STRUCT(MODULE_PARAMS);
x = 0;
printf("\n--- Long_options structure after initialization ---\n");
while (long_options[x].name != 0) {
printf("{%s, %d, 0, %c}\n", long_options[x].name,
long_options[x].has_arg, (char)long_options[x].val);
x++;
}
// Release allocated memory for module_info structure
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS);
return 0;
}

Macro Definition Documentation

+ +

◆ ALLOCATE_BASIC_INFO

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ALLOCATE_BASIC_INFO( p_name,
 p_description,
 p_input,
 p_output 
)   ALLOCATE_BASIC_INFO_2(module_info, p_name, p_description, p_input, p_output)
+
+

Macro for allocation and initialization of module basic information in global module_info

+
Parameters
+ + + + + +
[in]p_namemodule's name
[in]p_descriptionmodule's description
[in]p_inputnumber of input IFCs
[in]p_outputnumber of output IFCs
+
+
+ +

Definition at line 202 of file trap_module_info.h.

+ +
+
+ +

◆ ALLOCATE_BASIC_INFO_2

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ALLOCATE_BASIC_INFO_2( module_info,
 p_name,
 p_description,
 p_input,
 p_output 
)
+
+Value:
if (module_info != NULL) { \
if (p_name != NULL) { \
module_info->name = strdup(p_name); \
} else { \
module_info->name = NULL; \
} \
if (p_description != NULL) { \
module_info->description = strdup(p_description); \
} else { \
module_info->description = NULL; \
} \
module_info->num_ifc_in = p_input; \
module_info->num_ifc_out = p_output; \
}

Macro for allocation and initialization of module basic information

+
Parameters
+ + + + + + +
[in,out]module_infopointer to module_info
[in]p_namemodule's name
[in]p_descriptionmodule's description
[in]p_inputnumber of input IFCs
[in]p_outputnumber of output IFCs
+
+
+ +

Definition at line 179 of file trap_module_info.h.

+ +
+
+ +

◆ ALLOCATE_PARAM_ITEMS

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ALLOCATE_PARAM_ITEMS( p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)
+
+Value:
ALLOCATE_PARAM_ITEMS_2(module_info, trap_module_params_cnt, p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type) \
trap_module_params_cnt++;
#define ALLOCATE_PARAM_ITEMS_2(m, param_id, p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+

Macro for allocation and initialization of module parameters information in global module_info

+
Parameters
+ + + + + + +
[in]p_short_optshort option
[in]p_long_optlong option
[in]p_descriptionoption description
[in]p_required_argumentno_argument | required_argument | optional_argument
[in]p_argument_typedata type of option argument
+
+
+ +

Definition at line 257 of file trap_module_info.h.

+ +
+
+ +

◆ ALLOCATE_PARAM_ITEMS_2

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ALLOCATE_PARAM_ITEMS_2( m,
 param_id,
 p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)
+
+

Macro for allocation and initialization of module parameters information

+
Parameters
+ + + + + + + + +
[in]mmodule_info pointer
[in]param_idindex of parameter to set
[in]p_short_optshort option
[in]p_long_optlong option
[in]p_descriptionoption description
[in]p_required_argumentno_argument | required_argument | optional_argument
[in]p_argument_typedata type of option argument
+
+
+ +

Definition at line 215 of file trap_module_info.h.

+ +
+
+ +

◆ COUNT_MODULE_PARAMS

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define COUNT_MODULE_PARAMS( p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)   trap_module_params_cnt++;
+
+

Macro counting number of module parameters - memory allocation purpose

+ +

Definition at line 308 of file trap_module_info.h.

+ +
+
+ +

◆ FREE_BASIC_INFO

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define FREE_BASIC_INFO( p_name,
 p_description,
 p_input,
 p_output 
)
+
+Value:
if (module_info->name != NULL) { \
free(module_info->name); \
module_info->name = NULL; \
} \
if (module_info->description != NULL) { \
free(module_info->description); \
module_info->description = NULL; \
}

Macro releasing memory allocated for module basic information in global variable module_info

+ +

Definition at line 263 of file trap_module_info.h.

+ +
+
+ +

◆ FREE_MODULE_INFO_STRUCT

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define FREE_MODULE_INFO_STRUCT( BASIC,
 PARAMS 
)
+
+Value:
if (module_info != NULL) { \
trap_module_params_cnt = 0; \
BASIC(FREE_BASIC_INFO) \
if (module_info->params != NULL) { \
PARAMS(FREE_PARAM_ITEMS) \
free(module_info->params); \
module_info->params = NULL; \
} \
free(module_info); \
module_info = NULL; \
if (module_getopt_string != NULL) { \
free(module_getopt_string); \
} \
}
#define FREE_PARAM_ITEMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+
#define FREE_BASIC_INFO(p_name, p_description, p_input, p_output)
+

Macro releasing whole module_info structure allocated in global variable module_info First argument is macro defining module basic information (name, description, number of input/output interfaces) Second argument is macro defining all module parameters and their values

+ +

Definition at line 361 of file trap_module_info.h.

+ +
+
+ +

◆ FREE_PARAM_ITEMS

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define FREE_PARAM_ITEMS( p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)
+
+Value:
if (module_info->params[trap_module_params_cnt] != NULL) { \
if (module_info->params[trap_module_params_cnt]->long_opt != NULL) { \
free(module_info->params[trap_module_params_cnt]->long_opt); \
module_info->params[trap_module_params_cnt]->long_opt= NULL; \
} \
if (module_info->params[trap_module_params_cnt]->description != NULL) { \
free(module_info->params[trap_module_params_cnt]->description); \
module_info->params[trap_module_params_cnt]->description= NULL; \
} \
if (module_info->params[trap_module_params_cnt]->argument_type != NULL) { \
free(module_info->params[trap_module_params_cnt]->argument_type); \
module_info->params[trap_module_params_cnt]->argument_type= NULL; \
} \
if (module_info->params[trap_module_params_cnt] != NULL) { \
free(module_info->params[trap_module_params_cnt]); \
} \
trap_module_params_cnt++; \
}

Macro releasing memory allocated for module parameters information in global variable module_info

+ +

Definition at line 275 of file trap_module_info.h.

+ +
+
+ +

◆ GEN_LONG_OPT_STRUCT

+ +
+
+ + + + + + + + +
#define GEN_LONG_OPT_STRUCT( PARAMS)
+
+Value:
static struct option long_options[] __attribute__((used)) = { \
{0, 0, 0, 0} \
};
#define GEN_LONG_OPT_STRUCT_LINE(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+

Macro generating long_options field for getopt_long function according to given macro with parameters

+ +

Definition at line 165 of file trap_module_info.h.

+ +
+
+ +

◆ GEN_LONG_OPT_STRUCT_LINE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define GEN_LONG_OPT_STRUCT_LINE( p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)   {p_long_opt, p_required_argument, 0, p_short_opt},
+
+

Macro generating one line of long_options field for getopt_long function

+ +

Definition at line 161 of file trap_module_info.h.

+ +
+
+ +

◆ GENERATE_GETOPT_STRING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define GENERATE_GETOPT_STRING( p_short_opt,
 p_long_opt,
 p_description,
 p_required_argument,
 p_argument_type 
)
+
+Value:
if (module_getopt_string_size <= (strlen(module_getopt_string) + 2)) { \
module_getopt_string_size += module_getopt_string_size/2; \
module_getopt_string = (char *) realloc(module_getopt_string, module_getopt_string_size * sizeof(char)); \
memset(module_getopt_string + (2*module_getopt_string_size)/3, 0, module_getopt_string_size/3); \
} \
module_getopt_string[strlen(module_getopt_string)] = p_short_opt; \
if (p_required_argument == required_argument) { \
module_getopt_string[strlen(module_getopt_string)] = ':'; \
}
+

Definition at line 295 of file trap_module_info.h.

+ +
+
+ +

◆ INIT_MODULE_INFO_STRUCT

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define INIT_MODULE_INFO_STRUCT( BASIC,
 PARAMS 
)
+
+Value:
int trap_module_params_cnt = 0; \
size_t module_getopt_string_size = 50; \
char * module_getopt_string = (char *) calloc(module_getopt_string_size, sizeof(char)); \
module_info = (trap_module_info_t *) calloc(1, sizeof(trap_module_info_t)); \
GEN_LONG_OPT_STRUCT(PARAMS); \
if (module_info != NULL) { \
module_info->params = (trap_module_info_parameter_t **) calloc(trap_module_params_cnt + 1, sizeof(trap_module_info_parameter_t *)); \
if (module_info->params != NULL) { \
trap_module_params_cnt = 0; \
} \
}
#define ALLOCATE_PARAM_ITEMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+
#define COUNT_MODULE_PARAMS(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+
#define GENERATE_GETOPT_STRING(p_short_opt, p_long_opt, p_description, p_required_argument, p_argument_type)
+ + +
#define ALLOCATE_BASIC_INFO(p_name, p_description, p_input, p_output)
+

Macro initializing whole module_info structure in global variable module_info First argument is macro defining module basic information (name, description, number of input/output interfaces) Second argument is macro defining all module parameters and their values Last pointer of module info parameters array is NULL to detect end of the array without any counter

+ +

Definition at line 315 of file trap_module_info.h.

+ +
+
+

Typedef Documentation

+ +

◆ trap_module_info_parameter_t

+ +
+
+

Structure with information about one module parameter Every parameter contains short_opt, long_opt, description, flag whether the parameter requires argument and argument type.

+ +
+
+ +

◆ trap_module_info_t

+ +
+
+ + + + +
typedef struct trap_module_info_s trap_module_info_t
+
+

Structure with information about module This struct contains basic information about the module, such as module's name, number of interfaces etc. It's supposed to be filled with static data and passed to trap_init function.

+ +
+
+

Function Documentation

+ +

◆ trap_create_module_info()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trap_module_info_t* trap_create_module_info (const char * mname,
const char * mdesc,
int8_t i_ifcs,
int8_t o_ifcs,
uint16_t param_count 
)
+
+

Allocate module info with empty parameters array.

+
Parameters
+ + + + + + +
[in]mnamename of Nemea module
[in]mdescdescription of Nemea module
[in]i_ifcsnumber of input IFCs
[in]o_ifcsnumber of output IFCs
[in]param_countnumber of parameters
+
+
+
Returns
pointer to module_info with allocated parameters, NULL otherwise.
+ +
+
+ +

◆ trap_update_module_param()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_update_module_param (trap_module_info_tm,
uint16_t param_id,
char shortopt,
const char * longopt,
const char * desc,
int req_arg,
const char * arg_type 
)
+
+

Set module's parameter in the allocated module_info structure.

+
Parameters
+ + + + + + + + +
[in,out]mpointer to allocated module_info
[in]param_idindex of parameter which is set
[in]shortoptshort form of the parameter e.g. 'f' for -f
[in]longoptlong form of the parameter e.g. "file" for –file
[in]descdescription of the parameter
[in]req_argrequirement of argument, use standard required_argument, no_argument, optional_argument
[in]arg_typedata type of argument
+
+
+ +
+
+
+ + + + diff --git a/doc/libtrap/group__module__parameters.map b/doc/libtrap/group__module__parameters.map new file mode 100644 index 00000000..c5fb91b8 --- /dev/null +++ b/doc/libtrap/group__module__parameters.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/group__module__parameters.md5 b/doc/libtrap/group__module__parameters.md5 new file mode 100644 index 00000000..cb58aa31 --- /dev/null +++ b/doc/libtrap/group__module__parameters.md5 @@ -0,0 +1 @@ +8d0fdfde441a4fb245ec726c71d7d0fe \ No newline at end of file diff --git a/doc/libtrap/group__module__parameters.png b/doc/libtrap/group__module__parameters.png new file mode 100644 index 00000000..98a23142 Binary files /dev/null and b/doc/libtrap/group__module__parameters.png differ diff --git a/doc/libtrap/group__modulemacros.html b/doc/libtrap/group__modulemacros.html new file mode 100644 index 00000000..81267714 --- /dev/null +++ b/doc/libtrap/group__modulemacros.html @@ -0,0 +1,417 @@ + + + + + + + +libtrap: Nemea module macros + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Nemea module macros
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define TRAP_DEFAULT_SIGNAL_HANDLER(stop_cmd)
 Define default signal handler function Defines function to handle SIGTERM and SIGINT signals. When a signal is received, it runs the specified command and calls trap_terminate(). Place this macro before your main function. More...
 
#define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER()
 Register default signal handler. Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of SIGTERM and SIGINT signals. Place this macro between TRAP initialization and the main loop. More...
 
#define TRAP_DEFAULT_INITIALIZATION(argc, argv, module_info)
 Initialize TRAP using command-line parameters and handle errors. Generates code that parses command-line parameters using trap_parse_params, intializes TRAP library using trap_init and handle possible errors. It calls exit(1) when an error has occured. Place this macro at the beginning of your main function. More...
 
#define TRAP_DEFAULT_FINALIZATION()   trap_finalize();
 Generate TRAP cleanup code. Only calls trap_finalize function. Place this macro at the end of your main function. More...
 
#define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv(). More...
 
#define TRAP_DEFAULT_RECV_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_recv. More...
 
#define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send_data. More...
 
#define TRAP_DEFAULT_SEND_ERROR_HANDLING(ret_code, timeout_cmd, error_cmd)
 Handle possible errors after call to trap_send. More...
 
+

Detailed Description

+

Set of preprocessor macros for rapid NEMEA module development.

+

Macro Definition Documentation

+ +

◆ TRAP_DEFAULT_FINALIZATION

+ +
+
+ + + + + + + +
#define TRAP_DEFAULT_FINALIZATION()   trap_finalize();
+
+ +

Generate TRAP cleanup code. Only calls trap_finalize function. Place this macro at the end of your main function.

+ +

Definition at line 954 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_GET_DATA_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_GET_DATA_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
/* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
/* (module can perform some special operations with templates after trap_recv() signals format change) */ \
} else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
error_cmd; \
} else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
error_cmd; \
} else {\
fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
#define TRAP_E_FORMAT_CHANGED
Returned by trap_recv when format or format spec of the receivers interface has been changed...
Definition: trap.h:100
+
const char * trap_last_error_msg
Human-readable message about last error.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_recv().

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_recv().
timeout_cmdCommand to run when a timeout has occured, e.g. "continue".
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+
Deprecated:
This macro should be replaced by TRAP_DEFAULT_RECV_ERROR_HANDLING.
+ +

Definition at line 964 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_INITIALIZATION

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_INITIALIZATION( argc,
 argv,
 module_info 
)
+
+Value:
{\
trap_ifc_spec_t ifc_spec;\
int ret = trap_parse_params(&argc, argv, &ifc_spec);\
if (ret != TRAP_E_OK) {\
if (ret == TRAP_E_HELP) {\
trap_print_help(&module_info);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 0;\
}\
trap_free_ifc_spec(ifc_spec);\
fprintf(stderr, "ERROR in parsing of parameters for TRAP: %s\n", trap_last_error_msg);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 1;\
}\
ret = trap_init(&module_info, ifc_spec);\
if (ret != TRAP_E_OK) {\
trap_free_ifc_spec(ifc_spec);\
fprintf(stderr, "ERROR in TRAP initialization: %s\n", trap_last_error_msg);\
FREE_MODULE_INFO_STRUCT(MODULE_BASIC_INFO, MODULE_PARAMS) \
return 1;\
}\
trap_free_ifc_spec(ifc_spec);\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
+
#define TRAP_E_HELP
Returned by parse_parameters when help is requested.
Definition: trap.h:97
+
int trap_init(trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
+
int trap_parse_params(int *argc, char **argv, trap_ifc_spec_t *ifc_spec)
+
+

Initialize TRAP using command-line parameters and handle errors. Generates code that parses command-line parameters using trap_parse_params, intializes TRAP library using trap_init and handle possible errors. It calls exit(1) when an error has occured. Place this macro at the beginning of your main function.

+
Parameters
+ + + + +
[in,out]argcNumber of command-line parameters.
[in,out]argvList of command-line parameters.
[in]module_infotrap_module_info_t structure containing information about the module.
+
+
+ +

Definition at line 925 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_RECV_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_RECV_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else if (ret_code == TRAP_E_FORMAT_CHANGED) { \
/* Nothing to do here, TRAP_E_FORMAT_CHANGED has to be skipped by this macro */ \
/* (module can perform some special operations with templates after trap_recv() signals format change) */ \
} else if (ret_code == TRAP_E_FORMAT_MISMATCH) { \
fprintf(stderr, "trap_recv() error: output and input interfaces data formats or data specifiers mismatch.\n"); \
error_cmd; \
} else if (ret_code == TRAP_E_NEGOTIATION_FAILED) { \
fprintf(stderr, "trap_recv() error: interface negotiation failed (caused by invalid reply from a remote module, corrupted file or an unknown error).\n"); \
error_cmd; \
} else {\
fprintf(stderr, "Error: trap_recv() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
#define TRAP_E_FORMAT_CHANGED
Returned by trap_recv when format or format spec of the receivers interface has been changed...
Definition: trap.h:100
+
const char * trap_last_error_msg
Human-readable message about last error.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_NEGOTIATION_FAILED
Returned by trap_recv when negotiation of the output and input interfaces failed. ...
Definition: trap.h:102
+
#define TRAP_E_FORMAT_MISMATCH
Returned by trap_recv when data format or data specifier of the output and input interfaces doesn&#39;t m...
Definition: trap.h:101
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_recv.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_recv.
timeout_cmdCommand to run when a timeout has occured, e.g. "continue".
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+ +

Definition at line 991 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_SEND_DATA_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else {\
fprintf(stderr, "Error: trap_send_data() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_send_data.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_send_data.
timeout_cmdCommand to run when a timeout has occured, e.g. "0" to do nothing.
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+
Deprecated:
This macro should be replaced by TRAP_DEFAULT_SEND_ERROR_HANDLING.
+ +

Definition at line 1021 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SEND_ERROR_HANDLING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_DEFAULT_SEND_ERROR_HANDLING( ret_code,
 timeout_cmd,
 error_cmd 
)
+
+Value:
if ((ret_code) != TRAP_E_OK) {\
if ((ret_code) == TRAP_E_TIMEOUT) {\
timeout_cmd;\
} else if ((ret_code) == TRAP_E_TERMINATED) {\
error_cmd;\
} else {\
fprintf(stderr, "Error: trap_send() returned %i (%s)\n", (ret_code), trap_last_error_msg);\
error_cmd;\
}\
}
#define TRAP_E_OK
Success, no error.
Definition: trap.h:87
+
const char * trap_last_error_msg
Human-readable message about last error.
+
#define TRAP_E_TERMINATED
Interface was terminated during reading/writing.
Definition: trap.h:94
+
#define TRAP_E_TIMEOUT
Read or write operation timeout.
Definition: trap.h:88
+
+

Handle possible errors after call to trap_send.

+
Parameters
+ + + + +
[in]ret_codeReturn code of trap_send.
timeout_cmdCommand to run when a timeout has occured, e.g. "0" to do nothing.
error_cmdCommand to run when an error has occured or interface was terminated, e.g. "break".
+
+
+ +

Definition at line 1040 of file trap.h.

+ +
+
+ +

◆ TRAP_DEFAULT_SIGNAL_HANDLER

+ +
+
+ + + + + + + + +
#define TRAP_DEFAULT_SIGNAL_HANDLER( stop_cmd)
+
+Value:
void trap_default_signal_handler(int signal)\
{\
if (signal == SIGTERM || signal == SIGINT) { \
stop_cmd;\
trap_terminate();\
}\
}
+

Define default signal handler function Defines function to handle SIGTERM and SIGINT signals. When a signal is received, it runs the specified command and calls trap_terminate(). Place this macro before your main function.

+
Parameters
+ + +
[in]stop_cmdCommand which stops operation of a module. Usually setting a variable which is tested in module's main loop.
+
+
+ +

Definition at line 872 of file trap.h.

+ +
+
+ +

◆ TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER

+ +
+
+ + + + + + + +
#define TRAP_REGISTER_DEFAULT_SIGNAL_HANDLER()
+
+Value:
do {\
printf("Setting signal handler for SIGINT and SIGTERM using 'signal' function.\n");\
signal(SIGTERM, trap_default_signal_handler);\
signal(SIGINT, trap_default_signal_handler);\
} while(0)
int trap_get_verbose_level()
+
+

Register default signal handler. Register function defined by TRAP_DEFAULT_SIGNAL_HANDLER as handler of SIGTERM and SIGINT signals. Place this macro between TRAP initialization and the main loop.

+ +

Definition at line 904 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__simpleapi.html b/doc/libtrap/group__simpleapi.html new file mode 100644 index 00000000..d2eb4c3a --- /dev/null +++ b/doc/libtrap/group__simpleapi.html @@ -0,0 +1,577 @@ + + + + + + + +libtrap: Simple API + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Simple API
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
 
int trap_init (trap_module_info_t *module_info, trap_ifc_spec_t ifc_spec)
 
int trap_terminate ()
 
int trap_finalize ()
 
int trap_send_data (unsigned int ifcidx, const void *data, uint16_t size, int timeout)
 
int trap_recv (uint32_t ifcidx, const void **data, uint16_t *size)
 Receive data from input interface. More...
 
int trap_send (uint32_t ifcidx, const void *data, uint16_t size)
 Send data via output interface. More...
 
void trap_set_verbose_level (int level)
 
int trap_get_verbose_level ()
 
void trap_set_help_section (int level)
 
void trap_print_help (const trap_module_info_t *module_info)
 
void trap_print_ifc_spec_help ()
 
int trap_ifcctl (int8_t type, uint32_t ifcidx, int32_t request,...)
 Control TRAP interface. More...
 
void trap_send_flush (uint32_t ifc)
 Force flush of buffer. More...
 
+ + + + + + + +

+Variables

int trap_last_error
 Code of last error (one of the codes above) More...
 
const char * trap_last_error_msg
 Human-readable message about last error. More...
 
+

Detailed Description

+

Function Documentation

+ +

◆ trap_finalize()

+ +
+
+ + + + + + + +
int trap_finalize ()
+
+

Cleanup function. Disconnect all interfaces and do all necessary cleanup.

Returns
Error code
+ +
+
+ +

◆ trap_free_ifc_spec()

+ +
+
+ + + + + + + + +
int trap_free_ifc_spec (trap_ifc_spec_t ifc_spec)
+
+

Destructor of trap_ifc_spec_t structure.

Parameters
+ + +
[in]ifc_spectrap_ifc_spec_t structure to clear.
+
+
+
Returns
Error code (0 on success)
+ +
+
+ +

◆ trap_get_verbose_level()

+ +
+
+ + + + + + + +
int trap_get_verbose_level ()
+
+

Get verbosity level. See trap_set_verbose_level for list of levels.

Returns
Verbosity level currently set in the library.
+ +
+
+ +

◆ trap_ifcctl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ifcctl (int8_t type,
uint32_t ifcidx,
int32_t request,
 ... 
)
+
+ +

Control TRAP interface.

+
Note
Type and request types were changed from enum because of python wrapper.
+
Parameters
+ + + + + +
[in]typetrap_ifc_type direction of interface
[in]ifcidxindex of TRAP interface
[in]requesttrap_ifcctl_request type of operation
[in,out]...arguments of request, see trap_ifcctl_request for more details on requests and their arguments.
+
+
+

Examples:

Returns
TRAP_E_OK on success
+ +
+
+ +

◆ trap_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_init (trap_module_info_tmodule_info,
trap_ifc_spec_t ifc_spec 
)
+
+

Initialization function. Create and initialize all interfaces.

Parameters
+ + + +
[in]module_infoPointer to struct containing info about the module.
[in]ifc_specStructure with specification of interface types and their parameters.
+
+
+
Returns
Error code (0 on success)
+ +
+
+ +

◆ trap_print_help()

+ +
+
+ + + + + + + + +
void trap_print_help (const trap_module_info_tmodule_info)
+
+

Print common TRAP help message. The help message contains information from module_info and describes common TRAP command-line parameters.

Parameters
+ + +
[in]module_infoPointer to struct containing info about the module.
+
+
+ +
+
+ +

◆ trap_print_ifc_spec_help()

+ +
+
+ + + + + + + +
void trap_print_ifc_spec_help ()
+
+

Print help about interface specifier. Prints help message about format of interface specifier and description of all available interface types. This message is normally a part of help printed by trap_print_help, this function is useful when you don't use standard TRAP command-line parameters but you still use the same format of interface specifier.

+ +
+
+ +

◆ trap_recv()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_recv (uint32_t ifcidx,
const void ** data,
uint16_t * size 
)
+
+ +

Receive data from input interface.

+

Receive a message from interface specified by ifcidx and set pointer to the data. When function returns due to timeout, contents of data and size are undefined.

+
Parameters
+ + + + +
[in]ifcidxIndex of input IFC.
[out]dataPointer to received data.
[out]sizeSize of received data in bytes of data.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
Note
Data must not be freed! Library stores incomming data into static array and rewrites it during every trap_recv() call.
+
See also
trap_ifcctl() to set timeout (TRAPCTL_SETTIMEOUT)
+ +
+
+ +

◆ trap_send()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_send (uint32_t ifcidx,
const void * data,
uint16_t size 
)
+
+ +

Send data via output interface.

+

Send a message given by data pointer of size message size via interface specified by ifcidx that is the index of output interfaces (counted from 0).

+
Parameters
+ + + + +
[in]ifcidxIndex of input IFC.
[out]dataPointer to message to send.
[out]sizeSize of message in bytes.
+
+
+
Returns
Error code - TRAP_E_OK on success, TRAP_E_TIMEOUT if timeout elapses.
+
See also
trap_ifcctl() to set timeout (TRAPCTL_SETTIMEOUT)
+ +
+
+ +

◆ trap_send_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_send_data (unsigned int ifcidx,
const void * data,
uint16_t size,
int timeout 
)
+
+

Send data to output interface. Write data of size size given by data pointer into interface ifc. If data cannot be written immediately (e.g. because of full buffer or lost connection), wait until write is possible or timeout microseconds elapses. If timeout < 0, wait indefinitely.

Parameters
+ + + + + +
[in]ifcidxIndex of interface to write into.
[in]dataPointer to data.
[in]sizeNumber of bytes of data.
[in]timeoutTimeout in microseconds for non-blocking mode; timeout can be also: TRAP_WAIT, TRAP_HALFWAIT, or TRAP_NO_WAIT.
+
+
+
Returns
Error code - 0 on success, TRAP_E_TIMEOUT if timeout elapses.
+
Deprecated:
This function should be replaced by trap_send().
+ +
+
+ +

◆ trap_send_flush()

+ +
+
+ + + + + + + + +
void trap_send_flush (uint32_t ifc)
+
+ +

Force flush of buffer.

+
Parameters
+ + +
[in]ifcIFC Index of interface to write into.
+
+
+ +
+
+ +

◆ trap_set_help_section()

+ +
+
+ + + + + + + + +
void trap_set_help_section (int level)
+
+

Set section for trap_print_help()

+
Parameters
+ + +
[in]level0 for default info about module, 1 for info about IFC specifier
+
+
+ +
+
+ +

◆ trap_set_verbose_level()

+ +
+
+ + + + + + + + +
void trap_set_verbose_level (int level)
+
+

Set verbosity level of library functions. Verbosity levels may be:

    +
  • -3 - errors
  • +
  • -2 - warnings
  • +
  • -1 - notices (default)
  • +
  • 0 - verbose
  • +
  • 1 - more verbose
  • +
  • 2 - even more verbose
  • +
+
Parameters
+ + +
[in]levelDesired level of verbosity.
+
+
+ +
+
+ +

◆ trap_terminate()

+ +
+
+ + + + + + + +
int trap_terminate ()
+
+

Function to terminate module's operation. This function stops all read/write operations on all interfaces. Any waiting in trap_recv() and trap_send()_data is interrupted and these functions return immediately with TRAP_E_TERMINATED. Any call of trap_recv() or trap_send() after call of this function returns TRAP_E_TERMINATED.

+

This function is used to terminate module's operation (asynchronously), e.g. in SIGTERM handler.

Returns
Always TRAP_E_OK (0).
+ +
+
+

Variable Documentation

+ +

◆ trap_last_error

+ +
+
+ + + + +
int trap_last_error
+
+ +

Code of last error (one of the codes above)

+ +
+
+ +

◆ trap_last_error_msg

+ +
+
+ + + + +
const char* trap_last_error_msg
+
+ +

Human-readable message about last error.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__trap__mess__fmt.html b/doc/libtrap/group__trap__mess__fmt.html new file mode 100644 index 00000000..d1733dcc --- /dev/null +++ b/doc/libtrap/group__trap__mess__fmt.html @@ -0,0 +1,602 @@ + + + + + + + +libtrap: Message format + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Message format
+
+
+
+Collaboration diagram for Message format:
+
+
+ + + +
+
+ + + + + + +

+Enumerations

enum  trap_data_format_t { TRAP_FMT_UNKNOWN = 0, +TRAP_FMT_RAW = 1, +TRAP_FMT_UNIREC = 2, +TRAP_FMT_JSON = 3 + }
 
enum  trap_in_ifc_state_t { FMT_WAITING = 0, +FMT_OK = 1, +FMT_MISMATCH = 2, +FMT_CHANGED = 3 + }
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

void trap_set_data_fmt (uint32_t out_ifc_idx, uint8_t data_type,...)
 
int trap_set_required_fmt (uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_get_data_fmt (uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
 
void trap_ctx_set_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...)
 
void trap_ctx_vset_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_get_in_ifc_state (trap_ctx_t *ctx, uint32_t ifc_idx)
 
int trap_ctx_set_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...)
 
int trap_ctx_vset_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap)
 
int trap_ctx_get_data_fmt (trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec)
 
+

Detailed Description

+

Enumeration Type Documentation

+ +

◆ trap_data_format_t

+ +
+
+ + + + +
enum trap_data_format_t
+
+

Type of messages that are sent via IFC

+ + + + + +
Enumerator
TRAP_FMT_UNKNOWN 

unknown - message format was not specified yet

+
TRAP_FMT_RAW 

raw data, no format specified

+
TRAP_FMT_UNIREC 

UniRec records

+
TRAP_FMT_JSON 

structured data serialized using JSON

+
+ +

Definition at line 225 of file trap.h.

+ +
+
+ +

◆ trap_in_ifc_state_t

+ +
+
+ + + + +
enum trap_in_ifc_state_t
+
+

Possible states of an IFC during data format negotiation.

+ + + + + +
Enumerator
FMT_WAITING 

Negotiation is not completed

+
FMT_OK 

Negotiation was successful

+
FMT_MISMATCH 

Negotiation failed, format mismatch

+
FMT_CHANGED 

Negotiation was successful, but receivers (input ifc) template is subset of senders (output ifc) template and missing fields has to be defined

+
+ +

Definition at line 242 of file trap.h.

+ +
+
+

Function Documentation

+ +

◆ trap_ctx_get_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_get_data_fmt (trap_ctx_tctx,
uint8_t ifc_dir,
uint32_t ifc_idx,
uint8_t * data_type,
const char ** spec 
)
+
+

Get message format and template that is set on IFC.

+

On output IFC it should return the values that were set. On input IFC it should return format and template that was received. This function is thread safe.

+
Parameters
+ + + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifc_dirtrap_ifc_type direction of interface
[in]ifc_idxIndex of IFC.
[out]data_typeFormat of messages defined by trap_data_format_t.
[out]specSpecifier of data format specifies the template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED if libtrap context is not initialized or negotiation is not successful yet for input IFC, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
+ +
+
+ +

◆ trap_ctx_get_in_ifc_state()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int trap_ctx_get_in_ifc_state (trap_ctx_tctx,
uint32_t ifc_idx 
)
+
+

Returns current state of an input interface on specified index.

+

This function is thread safe.

+
Parameters
+ + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]ifc_idxIndex of the input interface
+
+
+
Returns
Value of trap_in_ifc_state_t on success, otherwise TRAP_E_NOT_INITIALIZED when libtrap context is not initialized or TRAP_E_BAD_IFC_INDEX (ifc_idx >= number of input ifcs).
+ +
+
+ +

◆ trap_ctx_set_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void trap_ctx_set_data_fmt (trap_ctx_tctx,
uint32_t out_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages on output IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]out_ifc_idxIndex of output IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]...If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+ +
+
+ +

◆ trap_ctx_set_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_set_required_fmt (trap_ctx_tctx,
uint32_t in_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages expected on input IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]in_ifc_idxIndex of input IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]...If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, on error see trap_ctx_vset_required_fmt().
+ +
+
+ +

◆ trap_ctx_vset_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void trap_ctx_vset_data_fmt (trap_ctx_tctx,
uint32_t out_ifc_idx,
uint8_t data_type,
va_list ap 
)
+
+

Set format of messages on output IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]out_ifc_idxIndex of output IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]apIf data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+ +
+
+ +

◆ trap_ctx_vset_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_ctx_vset_required_fmt (trap_ctx_tctx,
uint32_t in_ifc_idx,
uint8_t data_type,
va_list ap 
)
+
+

Set format of messages expected on input IFC.

+

This function is thread safe.

+
Parameters
+ + + + + +
[in]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]in_ifc_idxIndex of input IFC.
[in]data_typeFormat of messages defined by trap_data_format_t.
[in]apIf data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected.
+
+
+
Returns
TRAP_E_OK on success, TRAP_E_NOT_INITIALIZED when libtrap context is not initialized, TRAP_E_BAD_IFC_INDEX or TRAP_E_BADPARAMS on error.
+ +
+
+ +

◆ trap_get_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trap_get_data_fmt (uint8_t ifc_dir,
uint32_t ifc_idx,
uint8_t * data_type,
const char ** spec 
)
+
+

Get message format and template that is set on IFC.

+

On output IFC it should return the values that were set. On input IFC it should return format and template that was received.

+
Parameters
+ + + + + +
[in]ifc_dirtrap_ifc_type direction of interface
[in]ifc_idxindex of IFC
[out]data_typeformat of messages defined by trap_data_format_t
[out]specTemplate specifier - UniRec specifier in case of TRAP_FMT_UNIREC data_type, otherwise, it can be any string.
+
+
+
Returns
TRAP_E_OK on success, on error see trap_ctx_get_data_fmt().
+ +
+
+ +

◆ trap_set_data_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void trap_set_data_fmt (uint32_t out_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages on output IFC.

+
Parameters
+ + + + +
[in]out_ifc_idxindex of output IFC
[in]data_typeformat of messages defined by trap_data_format_t
[in]...if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected
+
+
+ +
+
+ +

◆ trap_set_required_fmt()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int trap_set_required_fmt (uint32_t in_ifc_idx,
uint8_t data_type,
 ... 
)
+
+

Set format of messages expected on input IFC.

+
Parameters
+ + + + +
[in]in_ifc_idxindex of input IFC
[in]data_typeformat of messages defined by trap_data_format_t
[in]...if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected
+
+
+
Returns
TRAP_E_OK on success
+ +
+
+
+ + + + diff --git a/doc/libtrap/group__trap__mess__fmt.map b/doc/libtrap/group__trap__mess__fmt.map new file mode 100644 index 00000000..5c56b740 --- /dev/null +++ b/doc/libtrap/group__trap__mess__fmt.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/group__trap__mess__fmt.md5 b/doc/libtrap/group__trap__mess__fmt.md5 new file mode 100644 index 00000000..1bffcb56 --- /dev/null +++ b/doc/libtrap/group__trap__mess__fmt.md5 @@ -0,0 +1 @@ +900f8cbc9f3a3f599086a4b511499232 \ No newline at end of file diff --git a/doc/libtrap/group__trap__mess__fmt.png b/doc/libtrap/group__trap__mess__fmt.png new file mode 100644 index 00000000..66f5456a Binary files /dev/null and b/doc/libtrap/group__trap__mess__fmt.png differ diff --git a/doc/libtrap/group__trap__timeout.html b/doc/libtrap/group__trap__timeout.html new file mode 100644 index 00000000..e4151549 --- /dev/null +++ b/doc/libtrap/group__trap__timeout.html @@ -0,0 +1,172 @@ + + + + + + + +libtrap: TRAP Timeout + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
TRAP Timeout
+
+
+
+Collaboration diagram for TRAP Timeout:
+
+
+ + + +
+
+ + + + + + + + + + + + + +

+Macros

#define TRAP_NO_WAIT   0
 
#define TRAP_WAIT   -1
 
#define TRAP_HALFWAIT   -2
 
#define TRAP_TIMEOUT_STR(t)   (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
 
#define TRAP_NO_AUTO_FLUSH   (-1l)
 value to disable autoflushing on output interface More...
 
+

Detailed Description

+

TRAP IFC works with timeout to decide wether it should block or just wait for some time. The timeout is usually in microseconds. This section lists some special timeout values.

+

Macro Definition Documentation

+ +

◆ TRAP_HALFWAIT

+ +
+
+ + + + +
#define TRAP_HALFWAIT   -2
+
+

Blocking mode, do not wait for client's connection, clients do not try to reconnect, there is no recovering of clients during get_data/send_data in this mode. For input ifc it is the same as TRAP_NO_WAIT.

+ +

Definition at line 130 of file trap.h.

+ +
+
+ +

◆ TRAP_NO_AUTO_FLUSH

+ +
+
+ + + + +
#define TRAP_NO_AUTO_FLUSH   (-1l)
+
+ +

value to disable autoflushing on output interface

+ +

Definition at line 134 of file trap.h.

+ +
+
+ +

◆ TRAP_NO_WAIT

+ +
+
+ + + + +
#define TRAP_NO_WAIT   0
+
+

Non-Blocking mode, do not wait ever.

+ +

Definition at line 119 of file trap.h.

+ +
+
+ +

◆ TRAP_TIMEOUT_STR

+ +
+
+ + + + + + + + +
#define TRAP_TIMEOUT_STR( t)   (t==TRAP_WAIT?"TRAP_WAIT":(t==TRAP_NO_WAIT?"TRAP_NO_WAIT":(t==TRAP_HALFWAIT?"TRAP_HALFWAIT":"")))
+
+ +

Definition at line 132 of file trap.h.

+ +
+
+ +

◆ TRAP_WAIT

+ +
+
+ + + + +
#define TRAP_WAIT   -1
+
+

Blocking mode, wait for client's connection, for message transport to/from internal system buffer.

+ +

Definition at line 124 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__trap__timeout.map b/doc/libtrap/group__trap__timeout.map new file mode 100644 index 00000000..4df7f77f --- /dev/null +++ b/doc/libtrap/group__trap__timeout.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/group__trap__timeout.md5 b/doc/libtrap/group__trap__timeout.md5 new file mode 100644 index 00000000..2577b183 --- /dev/null +++ b/doc/libtrap/group__trap__timeout.md5 @@ -0,0 +1 @@ +21bcb000c19ccc17d64cb5698f352cc9 \ No newline at end of file diff --git a/doc/libtrap/group__trap__timeout.png b/doc/libtrap/group__trap__timeout.png new file mode 100644 index 00000000..579bd8d9 Binary files /dev/null and b/doc/libtrap/group__trap__timeout.png differ diff --git a/doc/libtrap/group__trapifcspec.html b/doc/libtrap/group__trapifcspec.html new file mode 100644 index 00000000..73a80b08 --- /dev/null +++ b/doc/libtrap/group__trapifcspec.html @@ -0,0 +1,123 @@ + + + + + + + +libtrap: Specifier of TRAP interfaces + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+ +
+
Specifier of TRAP interfaces
+
+
+
+Collaboration diagram for Specifier of TRAP interfaces:
+
+
+ + + + +
+
+ + + + +

+Modules

 Types of IFC
 
+ + + + + +

+Macros

#define TRAP_IFC_DELIMITER   ','
 
#define TRAP_IFC_PARAM_DELIMITER   ':'
 
+

Detailed Description

+

The format of -i parameter of modules sets up TRAP interfaces. TRAP_IFC_DELIMITER divides specifier into interfaces. TRAP_IFC_PARAM_DELIMITER divides parameters of one interface.

+

Each TRAP interface must have the type (Types of IFC) as the first parameter. The following parameters are passed to the interface and they are interface-dependent.

+

The format example, let's assume the module has 1 input IFC and 1 output IFC:

+
+

-i t:localhost:7600,u:my_socket

+
+

This sets the input IFC to TCP type and it will connect to localhost, port 7600. The output IFC will listen on UNIX socket with identifier my_socket.

+

Macro Definition Documentation

+ +

◆ TRAP_IFC_DELIMITER

+ +
+
+ + + + +
#define TRAP_IFC_DELIMITER   ','
+
+

Delimiter of TRAP interfaces in IFC specifier

+ +

Definition at line 160 of file trap.h.

+ +
+
+ +

◆ TRAP_IFC_PARAM_DELIMITER

+ +
+
+ + + + +
#define TRAP_IFC_PARAM_DELIMITER   ':'
+
+

Delimiter of TRAP interface's parameters in IFC specifier

+ +

Definition at line 165 of file trap.h.

+ +
+
+
+ + + + diff --git a/doc/libtrap/group__trapifcspec.map b/doc/libtrap/group__trapifcspec.map new file mode 100644 index 00000000..88e33da3 --- /dev/null +++ b/doc/libtrap/group__trapifcspec.map @@ -0,0 +1,4 @@ + + + + diff --git a/doc/libtrap/group__trapifcspec.md5 b/doc/libtrap/group__trapifcspec.md5 new file mode 100644 index 00000000..ac87ea13 --- /dev/null +++ b/doc/libtrap/group__trapifcspec.md5 @@ -0,0 +1 @@ +d7b32092026795fc9e0ae3111da02271 \ No newline at end of file diff --git a/doc/libtrap/group__trapifcspec.png b/doc/libtrap/group__trapifcspec.png new file mode 100644 index 00000000..860fa1cc Binary files /dev/null and b/doc/libtrap/group__trapifcspec.png differ diff --git a/doc/libtrap/history_8txt.html b/doc/libtrap/history_8txt.html new file mode 100644 index 00000000..66dd39ba --- /dev/null +++ b/doc/libtrap/history_8txt.html @@ -0,0 +1,54 @@ + + + + + + + +libtrap: doc/history.txt File Reference + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
doc/history.txt File Reference
+
+
+
+ + + + diff --git a/doc/libtrap/index.html b/doc/libtrap/index.html new file mode 100644 index 00000000..13b8a704 --- /dev/null +++ b/doc/libtrap/index.html @@ -0,0 +1,68 @@ + + + + + + + +libtrap: Libtrap + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
Libtrap
+
+
+

TRAP is represented by a shared object called libtrap. It is dynamically linked with every Nemea module. This library implements the communication interfaces used by all Nemea modules to exchange data. There are different types of interfaces using various underlying methods of communication (TCP/IP, Unix domain socket, shared memory) and each interface has several parameters. However, libtrap abstracts a module from the underlying interface and its specifics. The main features of libtrap are:

    +
  • +Blocking or non-blocking mode of transmission based on configuration parameters
  • +
  • +Buffering for throughput increase
  • +
  • +Automatic reconnection after failure
  • +
  • +Local or remote machine communication
  • +
+

The interface type and behaviour is fully configurable by module and is usually set by user when module starts. Because some interface types support communication over a network, the system may be easily distributed on several hosts.

+

Libtrap supplies Simple API and Context API, both using Common libtrap API. For writing new Nemea modules, Nemea module macros can be useful.

+

The example of usage in pseudocode:

trap_ctx_t *ctx = NULL;
int res;
ctx = trap_ctx_init(...);
if (ctx != NULL) {
trap_ctx_ifcctl(ctx, TRAPIFC_OUTPUT /* direction */,
0 /* ifc index */, TRAPCTL_SETTIMEOUT,
res = trap_ctx_recv(ctx, 0 /* in ifc idx */, &d, &ds);
if (res != TRAP_E_OK) {
/* recv failed */
}
res = trap_ctx_send(ctx, 0 /* out ifc idx */, d, ds);
if (res != TRAP_E_OK) {
/* send failed */
}
}

To initialize libtrap, module_info and ifc_spec must be provided. The trap_parse_params() function can be used to prepare ifc_spec from process arguments.

+

The trap_module_info_s parameter is usually defined in the beginning of Nemea modules. It contains module's name and description.

+
+ + + + diff --git a/doc/libtrap/index_8txt.html b/doc/libtrap/index_8txt.html new file mode 100644 index 00000000..9d5d1c5d --- /dev/null +++ b/doc/libtrap/index_8txt.html @@ -0,0 +1,54 @@ + + + + + + + +libtrap: doc/index.txt File Reference + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + +
+
+
+
doc/index.txt File Reference
+
+
+
+ + + + diff --git a/doc/libtrap/jansson_8h.html b/doc/libtrap/jansson_8h.html new file mode 100644 index 00000000..0d9621e9 --- /dev/null +++ b/doc/libtrap/jansson_8h.html @@ -0,0 +1,3039 @@ + + + + + + + +libtrap: include/libtrap/jansson.h File Reference + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + + +
+
+ +
+
jansson.h File Reference
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+Include dependency graph for jansson.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + + +
+
+

Go to the source code of this file.

+ + + + + + +

+Data Structures

struct  json_t
 
struct  json_error_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define JSON_INLINE   inline
 
#define JSON_INTEGER_IS_LONG_LONG   1
 
#define JSON_HAVE_LOCALECONV   1
 
#define JANSSON_MAJOR_VERSION   2
 
#define JANSSON_MINOR_VERSION   7
 
#define JANSSON_MICRO_VERSION   0
 
#define JANSSON_VERSION   "2.7"
 
#define JANSSON_VERSION_HEX
 
#define JSON_INTEGER_FORMAT   "lld"
 
#define json_typeof(json)   ((json)->type)
 
#define json_is_object(json)   ((json) && json_typeof(json) == JSON_OBJECT)
 
#define json_is_array(json)   ((json) && json_typeof(json) == JSON_ARRAY)
 
#define json_is_string(json)   ((json) && json_typeof(json) == JSON_STRING)
 
#define json_is_integer(json)   ((json) && json_typeof(json) == JSON_INTEGER)
 
#define json_is_real(json)   ((json) && json_typeof(json) == JSON_REAL)
 
#define json_is_number(json)   (json_is_integer(json) || json_is_real(json))
 
#define json_is_true(json)   ((json) && json_typeof(json) == JSON_TRUE)
 
#define json_is_false(json)   ((json) && json_typeof(json) == JSON_FALSE)
 
#define json_boolean_value   json_is_true
 
#define json_is_boolean(json)   (json_is_true(json) || json_is_false(json))
 
#define json_is_null(json)   ((json) && json_typeof(json) == JSON_NULL)
 
#define json_boolean(val)   ((val) ? json_true() : json_false())
 
#define JSON_ERROR_TEXT_LENGTH   160
 
#define JSON_ERROR_SOURCE_LENGTH   80
 
#define json_object_foreach(object, key, value)
 
#define json_array_foreach(array, index, value)
 
#define JSON_VALIDATE_ONLY   0x1
 
#define JSON_STRICT   0x2
 
#define JSON_REJECT_DUPLICATES   0x1
 
#define JSON_DISABLE_EOF_CHECK   0x2
 
#define JSON_DECODE_ANY   0x4
 
#define JSON_DECODE_INT_AS_REAL   0x8
 
#define JSON_ALLOW_NUL   0x10
 
#define JSON_MAX_INDENT   0x1F
 
#define JSON_INDENT(n)   ((n) & JSON_MAX_INDENT)
 
#define JSON_COMPACT   0x20
 
#define JSON_ENSURE_ASCII   0x40
 
#define JSON_SORT_KEYS   0x80
 
#define JSON_PRESERVE_ORDER   0x100
 
#define JSON_ENCODE_ANY   0x200
 
#define JSON_ESCAPE_SLASH   0x400
 
#define JSON_REAL_PRECISION(n)   (((n) & 0x1F) << 11)
 
+ + + + + + + + + + + + + +

+Typedefs

typedef struct json_t json_t
 
typedef long long json_int_t
 
typedef size_t(* json_load_callback_t) (void *buffer, size_t buflen, void *data)
 
typedef int(* json_dump_callback_t) (const char *buffer, size_t size, void *data)
 
typedef void *(* json_malloc_t) (size_t)
 
typedef void(* json_free_t) (void *)
 
+ + + +

+Enumerations

enum  json_type {
+  JSON_OBJECT, +JSON_ARRAY, +JSON_STRING, +JSON_INTEGER, +
+  JSON_REAL, +JSON_TRUE, +JSON_FALSE, +JSON_NULL +
+ }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

json_tjson_object (void)
 
json_tjson_array (void)
 
json_tjson_string (const char *value)
 
json_tjson_stringn (const char *value, size_t len)
 
json_tjson_string_nocheck (const char *value)
 
json_tjson_stringn_nocheck (const char *value, size_t len)
 
json_tjson_integer (json_int_t value)
 
json_tjson_real (double value)
 
json_tjson_true (void)
 
json_tjson_false (void)
 
json_tjson_null (void)
 
void json_delete (json_t *json)
 
void json_object_seed (size_t seed)
 
size_t json_object_size (const json_t *object)
 
json_tjson_object_get (const json_t *object, const char *key)
 
int json_object_set_new (json_t *object, const char *key, json_t *value)
 
int json_object_set_new_nocheck (json_t *object, const char *key, json_t *value)
 
int json_object_del (json_t *object, const char *key)
 
int json_object_clear (json_t *object)
 
int json_object_update (json_t *object, json_t *other)
 
int json_object_update_existing (json_t *object, json_t *other)
 
int json_object_update_missing (json_t *object, json_t *other)
 
void * json_object_iter (json_t *object)
 
void * json_object_iter_at (json_t *object, const char *key)
 
void * json_object_key_to_iter (const char *key)
 
void * json_object_iter_next (json_t *object, void *iter)
 
const char * json_object_iter_key (void *iter)
 
json_tjson_object_iter_value (void *iter)
 
int json_object_iter_set_new (json_t *object, void *iter, json_t *value)
 
size_t json_array_size (const json_t *array)
 
json_tjson_array_get (const json_t *array, size_t index)
 
int json_array_set_new (json_t *array, size_t index, json_t *value)
 
int json_array_append_new (json_t *array, json_t *value)
 
int json_array_insert_new (json_t *array, size_t index, json_t *value)
 
int json_array_remove (json_t *array, size_t index)
 
int json_array_clear (json_t *array)
 
int json_array_extend (json_t *array, json_t *other)
 
const char * json_string_value (const json_t *string)
 
size_t json_string_length (const json_t *string)
 
json_int_t json_integer_value (const json_t *integer)
 
double json_real_value (const json_t *real)
 
double json_number_value (const json_t *json)
 
int json_string_set (json_t *string, const char *value)
 
int json_string_setn (json_t *string, const char *value, size_t len)
 
int json_string_set_nocheck (json_t *string, const char *value)
 
int json_string_setn_nocheck (json_t *string, const char *value, size_t len)
 
int json_integer_set (json_t *integer, json_int_t value)
 
int json_real_set (json_t *real, double value)
 
json_tjson_pack (const char *fmt,...)
 
json_tjson_pack_ex (json_error_t *error, size_t flags, const char *fmt,...)
 
json_tjson_vpack_ex (json_error_t *error, size_t flags, const char *fmt, va_list ap)
 
int json_unpack (json_t *root, const char *fmt,...)
 
int json_unpack_ex (json_t *root, json_error_t *error, size_t flags, const char *fmt,...)
 
int json_vunpack_ex (json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap)
 
int json_equal (json_t *value1, json_t *value2)
 
json_tjson_copy (json_t *value)
 
json_tjson_deep_copy (const json_t *value)
 
json_tjson_loads (const char *input, size_t flags, json_error_t *error)
 
json_tjson_loadb (const char *buffer, size_t buflen, size_t flags, json_error_t *error)
 
json_tjson_loadf (FILE *input, size_t flags, json_error_t *error)
 
json_tjson_load_file (const char *path, size_t flags, json_error_t *error)
 
json_tjson_load_callback (json_load_callback_t callback, void *data, size_t flags, json_error_t *error)
 
char * json_dumps (const json_t *json, size_t flags)
 
int json_dumpf (const json_t *json, FILE *output, size_t flags)
 
int json_dump_file (const json_t *json, const char *path, size_t flags)
 
int json_dump_callback (const json_t *json, json_dump_callback_t callback, void *data, size_t flags)
 
void json_set_alloc_funcs (json_malloc_t malloc_fn, json_free_t free_fn)
 
+

Macro Definition Documentation

+ +

◆ JANSSON_MAJOR_VERSION

+ +
+
+ + + + +
#define JANSSON_MAJOR_VERSION   2
+
+ +

Definition at line 42 of file jansson.h.

+ +
+
+ +

◆ JANSSON_MICRO_VERSION

+ +
+
+ + + + +
#define JANSSON_MICRO_VERSION   0
+
+ +

Definition at line 44 of file jansson.h.

+ +
+
+ +

◆ JANSSON_MINOR_VERSION

+ +
+
+ + + + +
#define JANSSON_MINOR_VERSION   7
+
+ +

Definition at line 43 of file jansson.h.

+ +
+
+ +

◆ JANSSON_VERSION

+ +
+
+ + + + +
#define JANSSON_VERSION   "2.7"
+
+ +

Definition at line 47 of file jansson.h.

+ +
+
+ +

◆ JANSSON_VERSION_HEX

+ +
+
+ + + + +
#define JANSSON_VERSION_HEX
+
+Value:
#define JANSSON_MINOR_VERSION
Definition: jansson.h:43
+
#define JANSSON_MICRO_VERSION
Definition: jansson.h:44
+
#define JANSSON_MAJOR_VERSION
Definition: jansson.h:42
+
+

Definition at line 51 of file jansson.h.

+ +
+
+ +

◆ JSON_ALLOW_NUL

+ +
+
+ + + + +
#define JSON_ALLOW_NUL   0x10
+
+ +

Definition at line 264 of file jansson.h.

+ +
+
+ +

◆ json_array_foreach

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define json_array_foreach( array,
 index,
 value 
)
+
+Value:
for(index = 0; \
index < json_array_size(array) && (value = json_array_get(array, index)); \
index++)
size_t json_array_size(const json_t *array)
+
json_t * json_array_get(const json_t *array, size_t index)
+
+

Definition at line 170 of file jansson.h.

+ +
+
+ +

◆ json_boolean

+ +
+
+ + + + + + + + +
#define json_boolean( val)   ((val) ? json_true() : json_false())
+
+ +

Definition at line 109 of file jansson.h.

+ +
+
+ +

◆ json_boolean_value

+ +
+
+ + + + +
#define json_boolean_value   json_is_true
+
+ +

Definition at line 93 of file jansson.h.

+ +
+
+ +

◆ JSON_COMPACT

+ +
+
+ + + + +
#define JSON_COMPACT   0x20
+
+ +

Definition at line 279 of file jansson.h.

+ +
+
+ +

◆ JSON_DECODE_ANY

+ +
+
+ + + + +
#define JSON_DECODE_ANY   0x4
+
+ +

Definition at line 262 of file jansson.h.

+ +
+
+ +

◆ JSON_DECODE_INT_AS_REAL

+ +
+
+ + + + +
#define JSON_DECODE_INT_AS_REAL   0x8
+
+ +

Definition at line 263 of file jansson.h.

+ +
+
+ +

◆ JSON_DISABLE_EOF_CHECK

+ +
+
+ + + + +
#define JSON_DISABLE_EOF_CHECK   0x2
+
+ +

Definition at line 261 of file jansson.h.

+ +
+
+ +

◆ JSON_ENCODE_ANY

+ +
+
+ + + + +
#define JSON_ENCODE_ANY   0x200
+
+ +

Definition at line 283 of file jansson.h.

+ +
+
+ +

◆ JSON_ENSURE_ASCII

+ +
+
+ + + + +
#define JSON_ENSURE_ASCII   0x40
+
+ +

Definition at line 280 of file jansson.h.

+ +
+
+ +

◆ JSON_ERROR_SOURCE_LENGTH

+ +
+
+ + + + +
#define JSON_ERROR_SOURCE_LENGTH   80
+
+ +

Definition at line 134 of file jansson.h.

+ +
+
+ +

◆ JSON_ERROR_TEXT_LENGTH

+ +
+
+ + + + +
#define JSON_ERROR_TEXT_LENGTH   160
+
+ +

Definition at line 133 of file jansson.h.

+ +
+
+ +

◆ JSON_ESCAPE_SLASH

+ +
+
+ + + + +
#define JSON_ESCAPE_SLASH   0x400
+
+ +

Definition at line 284 of file jansson.h.

+ +
+
+ +

◆ JSON_HAVE_LOCALECONV

+ +
+
+ + + + +
#define JSON_HAVE_LOCALECONV   1
+
+ +

Definition at line 33 of file jansson.h.

+ +
+
+ +

◆ JSON_INDENT

+ +
+
+ + + + + + + + +
#define JSON_INDENT( n)   ((n) & JSON_MAX_INDENT)
+
+ +

Definition at line 278 of file jansson.h.

+ +
+
+ +

◆ JSON_INLINE

+ +
+
+ + + + +
#define JSON_INLINE   inline
+
+ +

Definition at line 19 of file jansson.h.

+ +
+
+ +

◆ JSON_INTEGER_FORMAT

+ +
+
+ + + + +
#define JSON_INTEGER_FORMAT   "lld"
+
+ +

Definition at line 76 of file jansson.h.

+ +
+
+ +

◆ JSON_INTEGER_IS_LONG_LONG

+ +
+
+ + + + +
#define JSON_INTEGER_IS_LONG_LONG   1
+
+ +

Definition at line 27 of file jansson.h.

+ +
+
+ +

◆ json_is_array

+ +
+
+ + + + + + + + +
#define json_is_array( json)   ((json) && json_typeof(json) == JSON_ARRAY)
+
+ +

Definition at line 86 of file jansson.h.

+ +
+
+ +

◆ json_is_boolean

+ +
+
+ + + + + + + + +
#define json_is_boolean( json)   (json_is_true(json) || json_is_false(json))
+
+ +

Definition at line 94 of file jansson.h.

+ +
+
+ +

◆ json_is_false

+ +
+
+ + + + + + + + +
#define json_is_false( json)   ((json) && json_typeof(json) == JSON_FALSE)
+
+ +

Definition at line 92 of file jansson.h.

+ +
+
+ +

◆ json_is_integer

+ +
+
+ + + + + + + + +
#define json_is_integer( json)   ((json) && json_typeof(json) == JSON_INTEGER)
+
+ +

Definition at line 88 of file jansson.h.

+ +
+
+ +

◆ json_is_null

+ +
+
+ + + + + + + + +
#define json_is_null( json)   ((json) && json_typeof(json) == JSON_NULL)
+
+ +

Definition at line 95 of file jansson.h.

+ +
+
+ +

◆ json_is_number

+ +
+
+ + + + + + + + +
#define json_is_number( json)   (json_is_integer(json) || json_is_real(json))
+
+ +

Definition at line 90 of file jansson.h.

+ +
+
+ +

◆ json_is_object

+ +
+
+ + + + + + + + +
#define json_is_object( json)   ((json) && json_typeof(json) == JSON_OBJECT)
+
+ +

Definition at line 85 of file jansson.h.

+ +
+
+ +

◆ json_is_real

+ +
+
+ + + + + + + + +
#define json_is_real( json)   ((json) && json_typeof(json) == JSON_REAL)
+
+ +

Definition at line 89 of file jansson.h.

+ +
+
+ +

◆ json_is_string

+ +
+
+ + + + + + + + +
#define json_is_string( json)   ((json) && json_typeof(json) == JSON_STRING)
+
+ +

Definition at line 87 of file jansson.h.

+ +
+
+ +

◆ json_is_true

+ +
+
+ + + + + + + + +
#define json_is_true( json)   ((json) && json_typeof(json) == JSON_TRUE)
+
+ +

Definition at line 91 of file jansson.h.

+ +
+
+ +

◆ JSON_MAX_INDENT

+ +
+
+ + + + +
#define JSON_MAX_INDENT   0x1F
+
+ +

Definition at line 277 of file jansson.h.

+ +
+
+ +

◆ json_object_foreach

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define json_object_foreach( object,
 key,
 value 
)
+
+Value:
void * json_object_iter(json_t *object)
+
void * json_object_key_to_iter(const char *key)
+
const char * json_object_iter_key(void *iter)
+
json_t * json_object_iter_value(void *iter)
+
void * json_object_iter_next(json_t *object, void *iter)
+
+

Definition at line 165 of file jansson.h.

+ +
+
+ +

◆ JSON_PRESERVE_ORDER

+ +
+
+ + + + +
#define JSON_PRESERVE_ORDER   0x100
+
+ +

Definition at line 282 of file jansson.h.

+ +
+
+ +

◆ JSON_REAL_PRECISION

+ +
+
+ + + + + + + + +
#define JSON_REAL_PRECISION( n)   (((n) & 0x1F) << 11)
+
+ +

Definition at line 285 of file jansson.h.

+ +
+
+ +

◆ JSON_REJECT_DUPLICATES

+ +
+
+ + + + +
#define JSON_REJECT_DUPLICATES   0x1
+
+ +

Definition at line 260 of file jansson.h.

+ +
+
+ +

◆ JSON_SORT_KEYS

+ +
+
+ + + + +
#define JSON_SORT_KEYS   0x80
+
+ +

Definition at line 281 of file jansson.h.

+ +
+
+ +

◆ JSON_STRICT

+ +
+
+ + + + +
#define JSON_STRICT   0x2
+
+ +

Definition at line 240 of file jansson.h.

+ +
+
+ +

◆ json_typeof

+ +
+
+ + + + + + + + +
#define json_typeof( json)   ((json)->type)
+
+ +

Definition at line 84 of file jansson.h.

+ +
+
+ +

◆ JSON_VALIDATE_ONLY

+ +
+
+ + + + +
#define JSON_VALIDATE_ONLY   0x1
+
+ +

Definition at line 239 of file jansson.h.

+ +
+
+

Typedef Documentation

+ +

◆ json_dump_callback_t

+ +
+
+ + + + +
typedef int(* json_dump_callback_t) (const char *buffer, size_t size, void *data)
+
+ +

Definition at line 287 of file jansson.h.

+ +
+
+ +

◆ json_free_t

+ +
+
+ + + + +
typedef void(* json_free_t) (void *)
+
+ +

Definition at line 297 of file jansson.h.

+ +
+
+ +

◆ json_int_t

+ +
+
+ + + + +
typedef long long json_int_t
+
+ +

Definition at line 77 of file jansson.h.

+ +
+
+ +

◆ json_load_callback_t

+ +
+
+ + + + +
typedef size_t(* json_load_callback_t) (void *buffer, size_t buflen, void *data)
+
+ +

Definition at line 266 of file jansson.h.

+ +
+
+ +

◆ json_malloc_t

+ +
+
+ + + + +
typedef void*(* json_malloc_t) (size_t)
+
+ +

Definition at line 296 of file jansson.h.

+ +
+
+ +

◆ json_t

+ +
+
+ + + + +
typedef struct json_t json_t
+
+ +
+
+

Enumeration Type Documentation

+ +

◆ json_type

+ +
+
+ + + + +
enum json_type
+
+ + + + + + + + + +
Enumerator
JSON_OBJECT 
JSON_ARRAY 
JSON_STRING 
JSON_INTEGER 
JSON_REAL 
JSON_TRUE 
JSON_FALSE 
JSON_NULL 
+ +

Definition at line 58 of file jansson.h.

+ +
+
+

Function Documentation

+ +

◆ json_array()

+ +
+
+ + + + + + + + +
json_t* json_array (void )
+
+ +
+
+ +

◆ json_array_append_new()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_array_append_new (json_tarray,
json_tvalue 
)
+
+ +
+
+ +

◆ json_array_clear()

+ +
+
+ + + + + + + + +
int json_array_clear (json_tarray)
+
+ +
+
+ +

◆ json_array_extend()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_array_extend (json_tarray,
json_tother 
)
+
+ +
+
+ +

◆ json_array_get()

+ +
+
+ + + + + + + + + + + + + + + + + + +
json_t* json_array_get (const json_tarray,
size_t index 
)
+
+ +
+
+ +

◆ json_array_insert_new()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_array_insert_new (json_tarray,
size_t index,
json_tvalue 
)
+
+ +
+
+ +

◆ json_array_remove()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_array_remove (json_tarray,
size_t index 
)
+
+ +
+
+ +

◆ json_array_set_new()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_array_set_new (json_tarray,
size_t index,
json_tvalue 
)
+
+ +
+
+ +

◆ json_array_size()

+ +
+
+ + + + + + + + +
size_t json_array_size (const json_tarray)
+
+ +
+
+ +

◆ json_copy()

+ +
+
+ + + + + + + + +
json_t* json_copy (json_tvalue)
+
+ +
+
+ +

◆ json_deep_copy()

+ +
+
+ + + + + + + + +
json_t* json_deep_copy (const json_tvalue)
+
+ +
+
+ +

◆ json_delete()

+ +
+
+ + + + + + + + +
void json_delete (json_tjson)
+
+ +
+
+ +

◆ json_dump_callback()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int json_dump_callback (const json_tjson,
json_dump_callback_t callback,
void * data,
size_t flags 
)
+
+ +
+
+ +

◆ json_dump_file()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_dump_file (const json_tjson,
const char * path,
size_t flags 
)
+
+ +
+
+ +

◆ json_dumpf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_dumpf (const json_tjson,
FILE * output,
size_t flags 
)
+
+ +
+
+ +

◆ json_dumps()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char* json_dumps (const json_tjson,
size_t flags 
)
+
+ +
+
+ +

◆ json_equal()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_equal (json_tvalue1,
json_tvalue2 
)
+
+ +
+
+ +

◆ json_false()

+ +
+
+ + + + + + + + +
json_t* json_false (void )
+
+ +
+
+ +

◆ json_integer()

+ +
+
+ + + + + + + + +
json_t* json_integer (json_int_t value)
+
+ +
+
+ +

◆ json_integer_set()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_integer_set (json_tinteger,
json_int_t value 
)
+
+ +
+
+ +

◆ json_integer_value()

+ +
+
+ + + + + + + + +
json_int_t json_integer_value (const json_tinteger)
+
+ +
+
+ +

◆ json_load_callback()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_load_callback (json_load_callback_t callback,
void * data,
size_t flags,
json_error_terror 
)
+
+ +
+
+ +

◆ json_load_file()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_load_file (const char * path,
size_t flags,
json_error_terror 
)
+
+ +
+
+ +

◆ json_loadb()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_loadb (const char * buffer,
size_t buflen,
size_t flags,
json_error_terror 
)
+
+ +
+
+ +

◆ json_loadf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_loadf (FILE * input,
size_t flags,
json_error_terror 
)
+
+ +
+
+ +

◆ json_loads()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_loads (const char * input,
size_t flags,
json_error_terror 
)
+
+ +
+
+ +

◆ json_null()

+ +
+
+ + + + + + + + +
json_t* json_null (void )
+
+ +
+
+ +

◆ json_number_value()

+ +
+
+ + + + + + + + +
double json_number_value (const json_tjson)
+
+ +
+
+ +

◆ json_object()

+ +
+
+ + + + + + + + +
json_t* json_object (void )
+
+ +
+
+ +

◆ json_object_clear()

+ +
+
+ + + + + + + + +
int json_object_clear (json_tobject)
+
+ +
+
+ +

◆ json_object_del()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_object_del (json_tobject,
const char * key 
)
+
+ +
+
+ +

◆ json_object_get()

+ +
+
+ + + + + + + + + + + + + + + + + + +
json_t* json_object_get (const json_tobject,
const char * key 
)
+
+ +
+
+ +

◆ json_object_iter()

+ +
+
+ + + + + + + + +
void* json_object_iter (json_tobject)
+
+ +
+
+ +

◆ json_object_iter_at()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void* json_object_iter_at (json_tobject,
const char * key 
)
+
+ +
+
+ +

◆ json_object_iter_key()

+ +
+
+ + + + + + + + +
const char* json_object_iter_key (void * iter)
+
+ +
+
+ +

◆ json_object_iter_next()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void* json_object_iter_next (json_tobject,
void * iter 
)
+
+ +
+
+ +

◆ json_object_iter_set_new()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_object_iter_set_new (json_tobject,
void * iter,
json_tvalue 
)
+
+ +
+
+ +

◆ json_object_iter_value()

+ +
+
+ + + + + + + + +
json_t* json_object_iter_value (void * iter)
+
+ +
+
+ +

◆ json_object_key_to_iter()

+ +
+
+ + + + + + + + +
void* json_object_key_to_iter (const char * key)
+
+ +
+
+ +

◆ json_object_seed()

+ +
+
+ + + + + + + + +
void json_object_seed (size_t seed)
+
+ +
+
+ +

◆ json_object_set_new()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_object_set_new (json_tobject,
const char * key,
json_tvalue 
)
+
+ +
+
+ +

◆ json_object_set_new_nocheck()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_object_set_new_nocheck (json_tobject,
const char * key,
json_tvalue 
)
+
+ +
+
+ +

◆ json_object_size()

+ +
+
+ + + + + + + + +
size_t json_object_size (const json_tobject)
+
+ +
+
+ +

◆ json_object_update()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_object_update (json_tobject,
json_tother 
)
+
+ +
+
+ +

◆ json_object_update_existing()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_object_update_existing (json_tobject,
json_tother 
)
+
+ +
+
+ +

◆ json_object_update_missing()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_object_update_missing (json_tobject,
json_tother 
)
+
+ +
+
+ +

◆ json_pack()

+ +
+
+ + + + + + + + + + + + + + + + + + +
json_t* json_pack (const char * fmt,
 ... 
)
+
+ +
+
+ +

◆ json_pack_ex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_pack_ex (json_error_terror,
size_t flags,
const char * fmt,
 ... 
)
+
+ +
+
+ +

◆ json_real()

+ +
+
+ + + + + + + + +
json_t* json_real (double value)
+
+ +
+
+ +

◆ json_real_set()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_real_set (json_treal,
double value 
)
+
+ +
+
+ +

◆ json_real_value()

+ +
+
+ + + + + + + + +
double json_real_value (const json_treal)
+
+ +
+
+ +

◆ json_set_alloc_funcs()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void json_set_alloc_funcs (json_malloc_t malloc_fn,
json_free_t free_fn 
)
+
+ +
+
+ +

◆ json_string()

+ +
+
+ + + + + + + + +
json_t* json_string (const char * value)
+
+ +
+
+ +

◆ json_string_length()

+ +
+
+ + + + + + + + +
size_t json_string_length (const json_tstring)
+
+ +
+
+ +

◆ json_string_nocheck()

+ +
+
+ + + + + + + + +
json_t* json_string_nocheck (const char * value)
+
+ +
+
+ +

◆ json_string_set()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_string_set (json_tstring,
const char * value 
)
+
+ +
+
+ +

◆ json_string_set_nocheck()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int json_string_set_nocheck (json_tstring,
const char * value 
)
+
+ +
+
+ +

◆ json_string_setn()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_string_setn (json_tstring,
const char * value,
size_t len 
)
+
+ +
+
+ +

◆ json_string_setn_nocheck()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_string_setn_nocheck (json_tstring,
const char * value,
size_t len 
)
+
+ +
+
+ +

◆ json_string_value()

+ +
+
+ + + + + + + + +
const char* json_string_value (const json_tstring)
+
+ +
+
+ +

◆ json_stringn()

+ +
+
+ + + + + + + + + + + + + + + + + + +
json_t* json_stringn (const char * value,
size_t len 
)
+
+ +
+
+ +

◆ json_stringn_nocheck()

+ +
+
+ + + + + + + + + + + + + + + + + + +
json_t* json_stringn_nocheck (const char * value,
size_t len 
)
+
+ +
+
+ +

◆ json_true()

+ +
+
+ + + + + + + + +
json_t* json_true (void )
+
+ +
+
+ +

◆ json_unpack()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int json_unpack (json_troot,
const char * fmt,
 ... 
)
+
+ +
+
+ +

◆ json_unpack_ex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int json_unpack_ex (json_troot,
json_error_terror,
size_t flags,
const char * fmt,
 ... 
)
+
+ +
+
+ +

◆ json_vpack_ex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
json_t* json_vpack_ex (json_error_terror,
size_t flags,
const char * fmt,
va_list ap 
)
+
+ +
+
+ +

◆ json_vunpack_ex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int json_vunpack_ex (json_troot,
json_error_terror,
size_t flags,
const char * fmt,
va_list ap 
)
+
+ +
+
+
+ + + + diff --git a/doc/libtrap/jansson_8h__dep__incl.map b/doc/libtrap/jansson_8h__dep__incl.map new file mode 100644 index 00000000..4f08cfd0 --- /dev/null +++ b/doc/libtrap/jansson_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/doc/libtrap/jansson_8h__dep__incl.md5 b/doc/libtrap/jansson_8h__dep__incl.md5 new file mode 100644 index 00000000..1245ca32 --- /dev/null +++ b/doc/libtrap/jansson_8h__dep__incl.md5 @@ -0,0 +1 @@ +19b6b3b052ebe7527784387545658942 \ No newline at end of file diff --git a/doc/libtrap/jansson_8h__dep__incl.png b/doc/libtrap/jansson_8h__dep__incl.png new file mode 100644 index 00000000..2100e8d7 Binary files /dev/null and b/doc/libtrap/jansson_8h__dep__incl.png differ diff --git a/doc/libtrap/jansson_8h__incl.map b/doc/libtrap/jansson_8h__incl.map new file mode 100644 index 00000000..58187621 --- /dev/null +++ b/doc/libtrap/jansson_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/doc/libtrap/jansson_8h__incl.md5 b/doc/libtrap/jansson_8h__incl.md5 new file mode 100644 index 00000000..5b364864 --- /dev/null +++ b/doc/libtrap/jansson_8h__incl.md5 @@ -0,0 +1 @@ +96ad3d0d940fe707104416ba2d13cfb1 \ No newline at end of file diff --git a/doc/libtrap/jansson_8h__incl.png b/doc/libtrap/jansson_8h__incl.png new file mode 100644 index 00000000..e5371c6f Binary files /dev/null and b/doc/libtrap/jansson_8h__incl.png differ diff --git a/doc/libtrap/jansson_8h_source.html b/doc/libtrap/jansson_8h_source.html new file mode 100644 index 00000000..b7178e07 --- /dev/null +++ b/doc/libtrap/jansson_8h_source.html @@ -0,0 +1,150 @@ + + + + + + + +libtrap: include/libtrap/jansson.h Source File + + + + + + +
+
+ + + + + + +
+
libtrap +  1.16.1 +
+
+
+ + + + + + + +
+
+
+
jansson.h
+
+
+Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
3  *
4  * Jansson is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #ifndef JANSSON_H
9 #define JANSSON_H
10 
11 #include <stdio.h>
12 #include <stdlib.h> /* for size_t */
13 #include <stdarg.h>
14 
15 #ifndef JSON_INLINE
16 # ifdef __cplusplus
17 # define JSON_INLINE inline
18 # else
19 # define JSON_INLINE inline
20 # endif
21 #endif
22 
23 /* If your compiler supports the `long long` type and the strtoll()
24  library function, JSON_INTEGER_IS_LONG_LONG is defined to 1,
25  otherwise to 0. */
26 #ifndef JSON_INTEGER_IS_LONG_LONG
27 #define JSON_INTEGER_IS_LONG_LONG 1
28 #endif
29 
30 /* If locale.h and localeconv() are available, define to 1,
31  otherwise to 0. */
32 #ifndef JSON_HAVE_LOCALECONV
33 #define JSON_HAVE_LOCALECONV 1
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /* version */
41 
42 #define JANSSON_MAJOR_VERSION 2
43 #define JANSSON_MINOR_VERSION 7
44 #define JANSSON_MICRO_VERSION 0
45 
46 /* Micro version is omitted if it's 0 */
47 #define JANSSON_VERSION "2.7"
48 
49 /* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this
50  for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */
51 #define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \
52  (JANSSON_MINOR_VERSION << 8) | \
53  (JANSSON_MICRO_VERSION << 0))
54 
55 
56 /* types */
57 
58 typedef enum {
67 } json_type;
68 
69 typedef struct json_t {
71  size_t refcount;
72 } json_t;
73 
74 #ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
75 #if JSON_INTEGER_IS_LONG_LONG
76 #define JSON_INTEGER_FORMAT "lld"
77 typedef long long json_int_t;
78 #else
79 #define JSON_INTEGER_FORMAT "ld"
80 typedef long json_int_t;
81 #endif /* JSON_INTEGER_IS_LONG_LONG */
82 #endif
83 
84 #define json_typeof(json) ((json)->type)
85 #define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT)
86 #define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY)
87 #define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING)
88 #define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER)
89 #define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL)
90 #define json_is_number(json) (json_is_integer(json) || json_is_real(json))
91 #define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE)
92 #define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE)
93 #define json_boolean_value json_is_true
94 #define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
95 #define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL)
96 
97 /* construction, destruction, reference counting */
98 
99 json_t *json_object(void);
100 json_t *json_array(void);
101 json_t *json_string(const char *value);
102 json_t *json_stringn(const char *value, size_t len);
103 json_t *json_string_nocheck(const char *value);
104 json_t *json_stringn_nocheck(const char *value, size_t len);
106 json_t *json_real(double value);
107 json_t *json_true(void);
108 json_t *json_false(void);
109 #define json_boolean(val) ((val) ? json_true() : json_false())
110 json_t *json_null(void);
111 
112 static JSON_INLINE
113 json_t *json_incref(json_t *json)
114 {
115  if(json && json->refcount != (size_t)-1)
116  ++json->refcount;
117  return json;
118 }
119 
120 /* do not call json_delete directly */
121 void json_delete(json_t *json);
122 
123 static JSON_INLINE
124 void json_decref(json_t *json)
125 {
126  if(json && json->refcount != (size_t)-1 && --json->refcount == 0)
127  json_delete(json);
128 }
129 
130 
131 /* error reporting */
132 
133 #define JSON_ERROR_TEXT_LENGTH 160
134 #define JSON_ERROR_SOURCE_LENGTH 80
135 
136 typedef struct {
137  int line;
138  int column;
139  int position;
142 } json_error_t;
143 
144 
145 /* getters, setters, manipulation */
146 
147 void json_object_seed(size_t seed);
148 size_t json_object_size(const json_t *object);
149 json_t *json_object_get(const json_t *object, const char *key);
150 int json_object_set_new(json_t *object, const char *key, json_t *value);
151 int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value);
152 int json_object_del(json_t *object, const char *key);
153 int json_object_clear(json_t *object);
154 int json_object_update(json_t *object, json_t *other);
155 int json_object_update_existing(json_t *object, json_t *other);
156 int json_object_update_missing(json_t *object, json_t *other);
157 void *json_object_iter(json_t *object);
158 void *json_object_iter_at(json_t *object, const char *key);
159 void *json_object_key_to_iter(const char *key);
160 void *json_object_iter_next(json_t *object, void *iter);
161 const char *json_object_iter_key(void *iter);
162 json_t *json_object_iter_value(void *iter);
163 int json_object_iter_set_new(json_t *object, void *iter, json_t *value);
164 
165 #define json_object_foreach(object, key, value) \
166  for(key = json_object_iter_key(json_object_iter(object)); \
167  key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
168  key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
169 
170 #define json_array_foreach(array, index, value) \
171  for(index = 0; \
172  index < json_array_size(array) && (value = json_array_get(array, index)); \
173  index++)
174 
175 static JSON_INLINE
176 int json_object_set(json_t *object, const char *key, json_t *value)
177 {
178  return json_object_set_new(object, key, json_incref(value));
179 }
180 
181 static JSON_INLINE
182 int json_object_set_nocheck(json_t *object, const char *key, json_t *value)
183 {
184  return json_object_set_new_nocheck(object, key, json_incref(value));
185 }
186 
187 static JSON_INLINE
188 int json_object_iter_set(json_t *object, void *iter, json_t *value)
189 {
190  return json_object_iter_set_new(object, iter, json_incref(value));
191 }
192 
193 size_t json_array_size(const json_t *array);
194 json_t *json_array_get(const json_t *array, size_t index);
195 int json_array_set_new(json_t *array, size_t index, json_t *value);
196 int json_array_append_new(json_t *array, json_t *value);
197 int json_array_insert_new(json_t *array, size_t index, json_t *value);
198 int json_array_remove(json_t *array, size_t index);
199 int json_array_clear(json_t *array);
200 int json_array_extend(json_t *array, json_t *other);
201 
202 static JSON_INLINE
203 int json_array_set(json_t *array, size_t ind, json_t *value)
204 {
205  return json_array_set_new(array, ind, json_incref(value));
206 }
207 
208 static JSON_INLINE
209 int json_array_append(json_t *array, json_t *value)
210 {
211  return json_array_append_new(array, json_incref(value));
212 }
213 
214 static JSON_INLINE
215 int json_array_insert(json_t *array, size_t ind, json_t *value)
216 {
217  return json_array_insert_new(array, ind, json_incref(value));
218 }
219 
220 const char *json_string_value(const json_t *string);
221 size_t json_string_length(const json_t *string);
222 json_int_t json_integer_value(const json_t *integer);
223 double json_real_value(const json_t *real);
224 double json_number_value(const json_t *json);
225 
226 int json_string_set(json_t *string, const char *value);
227 int json_string_setn(json_t *string, const char *value, size_t len);
228 int json_string_set_nocheck(json_t *string, const char *value);
229 int json_string_setn_nocheck(json_t *string, const char *value, size_t len);
230 int json_integer_set(json_t *integer, json_int_t value);
231 int json_real_set(json_t *real, double value);
232 
233 /* pack, unpack */
234 
235 json_t *json_pack(const char *fmt, ...);
236 json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...);
237 json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap);
238 
239 #define JSON_VALIDATE_ONLY 0x1
240 #define JSON_STRICT 0x2
241 
242 int json_unpack(json_t *root, const char *fmt, ...);
243 int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...);
244 int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap);
245 
246 
247 /* equality */
248 
249 int json_equal(json_t *value1, json_t *value2);
250 
251 
252 /* copying */
253 
254 json_t *json_copy(json_t *value);
255 json_t *json_deep_copy(const json_t *value);
256 
257 
258 /* decoding */
259 
260 #define JSON_REJECT_DUPLICATES 0x1
261 #define JSON_DISABLE_EOF_CHECK 0x2
262 #define JSON_DECODE_ANY 0x4
263 #define JSON_DECODE_INT_AS_REAL 0x8
264 #define JSON_ALLOW_NUL 0x10
265 
266 typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data);
267 
268 json_t *json_loads(const char *input, size_t flags, json_error_t *error);
269 json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error);
270 json_t *json_loadf(FILE *input, size_t flags, json_error_t *error);
271 json_t *json_load_file(const char *path, size_t flags, json_error_t *error);
272 json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error);
273 
274 
275 /* encoding */
276 
277 #define JSON_MAX_INDENT 0x1F
278 #define JSON_INDENT(n) ((n) & JSON_MAX_INDENT)
279 #define JSON_COMPACT 0x20
280 #define JSON_ENSURE_ASCII 0x40
281 #define JSON_SORT_KEYS 0x80
282 #define JSON_PRESERVE_ORDER 0x100
283 #define JSON_ENCODE_ANY 0x200
284 #define JSON_ESCAPE_SLASH 0x400
285 #define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
286 
287 typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data);
288 
289 char *json_dumps(const json_t *json, size_t flags);
290 int json_dumpf(const json_t *json, FILE *output, size_t flags);
291 int json_dump_file(const json_t *json, const char *path, size_t flags);
292 int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags);
293 
294 /* custom memory allocation */
295 
296 typedef void *(*json_malloc_t)(size_t);
297 typedef void (*json_free_t)(void *);
298 
299 void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn);
300 
301 #ifdef __cplusplus
302 }
303 #endif
304 
305 #endif
+
json_t * json_pack(const char *fmt,...)
+
json_type
Definition: jansson.h:58
+
size_t json_string_length(const json_t *string)
+ +
void * json_object_iter_at(json_t *object, const char *key)
+
json_t * json_object(void)
+
void * json_object_iter(json_t *object)
+
char * json_dumps(const json_t *json, size_t flags)
+
size_t refcount
Definition: jansson.h:71
+
void * json_object_key_to_iter(const char *key)
+
json_t * json_string(const char *value)
+
json_t * json_pack_ex(json_error_t *error, size_t flags, const char *fmt,...)
+
json_t * json_stringn_nocheck(const char *value, size_t len)
+
#define JSON_ERROR_SOURCE_LENGTH
Definition: jansson.h:134
+
json_t * json_real(double value)
+
json_t * json_false(void)
+
size_t json_object_size(const json_t *object)
+
double json_number_value(const json_t *json)
+
int(* json_dump_callback_t)(const char *buffer, size_t size, void *data)
Definition: jansson.h:287
+
json_t * json_integer(json_int_t value)
+ +
size_t(* json_load_callback_t)(void *buffer, size_t buflen, void *data)
Definition: jansson.h:266
+
int column
Definition: jansson.h:138
+
json_t * json_null(void)
+
int json_array_extend(json_t *array, json_t *other)
+
double json_real_value(const json_t *real)
+
int json_object_clear(json_t *object)
+
json_type type
Definition: jansson.h:70
+ +
int json_real_set(json_t *real, double value)
+
int json_string_set_nocheck(json_t *string, const char *value)
+
#define JSON_INLINE
Definition: jansson.h:19
+
json_t * json_object_get(const json_t *object, const char *key)
+
void(* json_free_t)(void *)
Definition: jansson.h:297
+ +
int json_string_setn(json_t *string, const char *value, size_t len)
+ +
json_t * json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error)
+
void json_object_seed(size_t seed)
+ +
int json_object_iter_set_new(json_t *object, void *iter, json_t *value)
+
int json_unpack(json_t *root, const char *fmt,...)
+
int json_object_del(json_t *object, const char *key)
+
int json_array_set_new(json_t *array, size_t index, json_t *value)
+
json_t * json_copy(json_t *value)
+
json_t * json_true(void)
+
size_t json_array_size(const json_t *array)
+
json_t * json_string_nocheck(const char *value)
+
int json_string_set(json_t *string, const char *value)
+
int position
Definition: jansson.h:139
+
json_t * json_loads(const char *input, size_t flags, json_error_t *error)
+
int json_equal(json_t *value1, json_t *value2)
+
int json_object_update_missing(json_t *object, json_t *other)
+
json_t * json_stringn(const char *value, size_t len)
+
int json_dump_file(const json_t *json, const char *path, size_t flags)
+
int json_integer_set(json_t *integer, json_int_t value)
+
void *(* json_malloc_t)(size_t)
Definition: jansson.h:296
+
int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value)
+
const char * json_object_iter_key(void *iter)
+
json_t * json_loadf(FILE *input, size_t flags, json_error_t *error)
+
int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags)
+
long long json_int_t
Definition: jansson.h:77
+
json_t * json_object_iter_value(void *iter)
+
int json_array_clear(json_t *array)
+
const char * json_string_value(const json_t *string)
+
json_t * json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap)
+
void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn)
+
int json_object_set_new(json_t *object, const char *key, json_t *value)
+
json_int_t json_integer_value(const json_t *integer)
+
int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt,...)
+
int json_object_update(json_t *object, json_t *other)
+ + +
void * json_object_iter_next(json_t *object, void *iter)
+
int json_dumpf(const json_t *json, FILE *output, size_t flags)
+
void json_delete(json_t *json)
+
json_t * json_load_file(const char *path, size_t flags, json_error_t *error)
+
#define JSON_ERROR_TEXT_LENGTH
Definition: jansson.h:133
+
json_t * json_array_get(const json_t *array, size_t index)
+
int json_object_update_existing(json_t *object, json_t *other)
+
int json_string_setn_nocheck(json_t *string, const char *value, size_t len)
+
struct json_t json_t
+
int json_array_remove(json_t *array, size_t index)
+ +
json_t * json_deep_copy(const json_t *value)
+
Definition: jansson.h:69
+
int json_array_append_new(json_t *array, json_t *value)
+
json_t * json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error)
+
int json_array_insert_new(json_t *array, size_t index, json_t *value)
+
int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap)
+
json_t * json_array(void)
+
+ + + + diff --git a/doc/libtrap/jquery.js b/doc/libtrap/jquery.js new file mode 100644 index 00000000..2771c749 --- /dev/null +++ b/doc/libtrap/jquery.js @@ -0,0 +1,115 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' + + + +
+
+
README-ip_prefix_search.md File Reference
+
+ + + + + diff --git a/doc/unirec/README-ip__prefix__search_8md_source.html b/doc/unirec/README-ip__prefix__search_8md_source.html new file mode 100644 index 00000000..643fd1f9 --- /dev/null +++ b/doc/unirec/README-ip__prefix__search_8md_source.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: README-ip_prefix_search.md Source File + + + + + + + + + +
+
+
+ + + + + +
+
UniRec +  2.9.3 +
+
+ + + + + + + + + + +
+
+ + +
+ +
+ +
+
+
README-ip_prefix_search.md
+
+
+Go to the documentation of this file.
1 # IP prefix binary search
2 
3 This structure is an ordered array data structure that is used to store a dynamic set,
4 where the keys are low and high IP addresses of prefix. Binary search compares low and high IP
5 with the searched IP address and returns data associated with match prefix.
6 
7 The prefix array can be used for storing any data (string, int). For example, it can be used to
8 aggregate information from multiple blacklists. Data type is specific
9 to each user and their source format (source file, delimiters, data format or data length,...), so user
10 MUST define ```function load_networks()```, which load and parse information, and data about
11 networks from any of their source and fill ```'ipps_network_list'``` structure.
12 
13 Before using the search, call the ```ipps_init()``` function. The function creates all
14 necessary structures for storing and accessing the data and return structure of IPv4 and
15 IPv6 array of prefixes with data (network context).
16 
17 The parameters are:
18 * Structure with networks array and networks counter
19 
20 For searching, use the function ```ipps_search()```. Function returns number of data associated with match prefix and return pointer to data as parameter:
21 
22 * Structure of ip prefix context, ipps_context_t
23 * IP address union
24 * Void pointer to data array
25 
26 For example, if blacklist contains:
27 
28 ```
29  192.168.1.0/24 aaa
30  192.168.1.0/25 bbb
31  192.168.1.128/25 ccc
32 ```
33 
34 ```init()``` creates 2 intervals:
35 * From 1.0 to 1.127 with data "aaa" and "bbb"
36 * From 1.128 to 1.255 with data "aaa" and "ccc":
37 
38 ```
39  192.168.1.0 192.168.1.255
40  ↓ ↓
41  <-----aaa---->
42  <-bbb-><-ccc->
43 ```
44 
45 and ```ip_prefix_search()``` is called with 192.168.1.100, search return number 2 and pointer to data "aaa" and "bbb".
46 For 192.168.1.200, return also number 2 but data are "aaa" and "ccc". For 192.1.1.1, search return 0 and pointer
47 to data is not fill.
48 
49 For destruction of a whole structure and data there is ```ipps_destroy()``` function, parameter is pointer to
50 the ```ipps_context_t structure```, that has to be destroyed. Also, a list of networks is necessary to destroy with
51 function ```destroy_networks()``` (this function isn't a part of library and the user must define it).
52 
53 Recommended control flow is:
54 1. ```load_networks()```
55 2. ```ipps_init()```
56 3. ```destroy_networks()```
57 4. ```ipps_search()```
58 5. ```ipps_destroy()```
59 
60 
61 ******************************************************************
62 
63 ## Example file
64 
65 ```
66 /**
67  * \file main.c
68  * \brief Init and find prefix EXAMPLE
69  * \author Erik Sabik <xsabik02@stud.fit.vutbr.cz>
70  * \author Ondrej Ploteny <xplote01@stud.fit.vutbr.cz>
71  * \date 2016-2020
72  */
73 /*
74  * Copyright (C) 2020 CESNET
75  *
76  * SPDX-License-Identifier: BSD-3-Clause
77  *
78  */
79 /**
80  * Prefix search example
81  * Example of using ip_prefix library designed for binary searching IP address in multiple blacklists.
82  * Blacklists information are save in a extern file.
83  *
84  * Function load_networks() read blacklist file by line and parse ip addresses, masks and data.
85  * Parsed networks are stored in array in network_list_t struct. Function load_networks() is specific
86  * for each user and his datasource. User must define function for fill ipps_network_list_t. In this
87  * example is datasource in format:
88  * <ip address>/<mask>,<char[4]>\n
89  * 192.168.2.1/24,aaa\n
90  *
91  * Function ipps_init() make prefix context from loaded networks and preprocess networks for binary search in
92  * multiple blacklists:
93  * - masked and sort source ip addresses
94  * - split ipv4 and ipv networks
95  * - create intervals (compute low and high ip of network), copy data
96  * - split overlapping intervals
97  * - sort intervals
98  * Intervals with its data are stored in array in ipps_context_t struct.
99  * Function ipps_init() return pointer to new ipps_context struct or NULL if init fails.
100  *
101  *
102  * !! If function load_networks() is call, you have to call destroy_networks() function !!
103  * !! If function ipps_init() is call, you have to call ipps_destroy() function !!
104  *
105  * For prefix searching, call function ipps_search() with searched ip address (ip_addr_t struct) and properly
106  * initialized prefix context (ipps_context_t struct).
107  * Function ipps_search() return number of match blacklists and return their data as parameter 'data',
108  * if ipps_search() return 0, no match in blacklist and ip is not found in any blacklist.
109  */
110 
111 #include <stdio.h>
112 #include <stdlib.h>
113 #include <ctype.h>
114 #include <sys/time.h>
115 #include <unirec/ip_prefix_search.h>
116 
117 
118 /* Length of loaded data in bytes */
119 #define DATALENGTH 4
120 
121 /** Trim white spaces from string
122  * Shift pointer to start of string `str` to point at first not whitespace character.
123  * Find last character of string `str` that is not whitespace and write '\0' 1 byte after it.
124  * @param[in] str String containing whitespaces.
125  * @return Pointer to string containing no whitespaces.
126  */
127 char *str_trim(char *str)
128 {
129  char *end;
130 
131  //Trim leading space
132  while (isspace(*str)) {
133  str++;
134  }
135 
136  // All spaces?
137  if (*str == 0) {
138  return str;
139  }
140 
141  // Trim trailing space
142  end = str + strlen(str) - 1;
143  while (end > str && isspace(*end)) {
144  end--;
145  }
146 
147  // Write new null terminator
148  *(end+1) = 0;
149 
150  return str;
151 }
152 /** Convert IP address from string to struct
153  * Trim whitespaces from string `str` and check for network mask.
154  * If network mask is not present in string `str` then convert IP address from string `str` to network struct `network`,
155  * set network mask `network->mask` to 32 and for each octet from end of IP address `network->addr.ui32[2]`
156  * that equals to 0 subtract 8 from network mask, if octet is not equal to 0 then end.
157  * If network mask is present in string `str` then convert it to number and write it to `network->mask`
158  * then remove it from string `str` and convert IP address from string `str` to network struct `network`.
159  * @param[in] str String containing IP address and network mask.
160  * @param[in] network Pointer to network structure.
161  * return 1 on success otherwise 0.
162  *
163  */
164 int str_to_network(char *str, ipps_network_t *network)
165 {
166  int i;
167  char *pos;
168 
169  network->mask = 32;
170  network->data_len = DATALENGTH;
171  network->data = malloc(network->data_len * sizeof(char));
172  if(network->data == NULL) {
173  fprintf(stderr, "ERROR in allocating data");
174  return 0;
175  }
176  memset(network->data, 0, network->data_len);
177 
178  if ((pos = strstr(str, ",")) != NULL)
179  {
180  memcpy(network->data, pos+1,3);
181  *pos = 0;
182  }
183 
184  // Trim whitespaces from string
185  str = str_trim(str);
186 
187  // If mask not present, read ip and calculate mask from ip
188  if ((pos = strstr(str, "/")) == NULL) {
189  // Convert IPv4 from string, if fail return 0
190  if (ip_from_str(str, &network->addr)) {
191  // Calculate mask by counting zero octets from end of net addr
192  for (i = 3; i >= 0; i--) {
193  if ((network->addr.ui32[2] & (0xFF<<(i*8))) == 0 ) {
194  network->mask -= 8;
195  } else {
196  break;
197  }
198  }
199  } else {
200  return 0;
201  }
202  } else { // Mask is present, read both ip and mask
203  // Convert net mask from string to uint32
204  network->mask = (uint32_t)atoi(pos + 1);
205 
206  // Remove net mask from string
207  *pos = '\0';
208 
209  // Convert ip from string, if fail return 0
210  if (!ip_from_str(str, &network->addr)) {
211  return 0;
212  }
213  }
214 
215  return 1;
216 }
217 
218 
219 /** Extract network addresses from file
220  * Allocate initial memory for networks list structure `ipps_network_list_t` and network structure
221  * array `networks`.
222  * Read file `file` line by line and save networks addresses in array of ipss_network structure `networks`.
223  * If there are more networks than can fit in allocated memory then reallocate memory with 10 more spaces for networks.
224  * source file format:
225  * <ip_addr>/<mask>,<data>\n
226  * etc.:
227  * 192.168.2.0/24,aaa
228  * @param[in] file Pointer to string containing file name.
229  * @return Pointer to networks list structure if success else return NULL.
230  */
231 ipps_network_list_t *load_networks(FILE *file)
232 {
233  if(!file)
234  return NULL;
235 
236  char line[64];
237  uint32_t i=0;
238  int struct_count = 50; // Starting v4_count of structs to alloc
239  int line_n = 1;
240 
241  // ************* LOAD NETWORKS ********************** //
242 
243  // Alloc memory for networks structs, if malloc fails return NULL
244  ipps_network_t *networks = malloc(struct_count * sizeof(ipps_network_t));
245  if (networks == NULL) {
246  fprintf(stderr, "ERROR allocating memory for network structures\n");
247  return NULL;
248  }
249 
250  // Alloc memory for networks list, if malloc fails return NULL
251  ipps_network_list_t * networks_list = malloc(sizeof(ipps_network_list_t));
252  if (networks_list == NULL) {
253  fprintf(stderr, "ERROR allocating memory for network list\n");
254  return NULL;
255  }
256 
257  // Read file by line, convert string to struct
258  while (fgets(line, 64, file) != NULL) {
259  if (str_to_network(line, &networks[i]) == 1) {
260  i++;
261 
262  // If limit is reached alloc new memory
263  if (i >= struct_count) {
264  struct_count += 10;
265  // If realloc fails return NULL
266  if ((networks = realloc(networks, struct_count * sizeof(ipps_network_t))) == NULL) {
267  fprintf(stderr, "ERROR in reallocating network structure\n");
268  return NULL;
269  }
270  }
271  } else {
272  // Not a valid line -> ignore it and print warning
273  fprintf(stderr, "Warning: Invalid network on line %u\n", line_n);
274  }
275  line_n++;
276  }
277 
278  networks_list->net_count = i;
279  networks_list->networks = networks;
280 
281  return networks_list;
282 }
283 
284 
285 
286 /** Dealloc ipps_network_list_t
287  * Dealloc struct ipps_network_list_t, opposite of load_network
288  * @param[in] network_list Pointer to network_list structure
289  * @return void
290  */
291 void destroy_networks(ipps_network_list_t *network_list) {
292  int index;
293  for (index = 0; index < network_list->net_count; index++) {
294  free(network_list->networks[index].data);
295  }
296 
297  free(network_list->networks);
298  free(network_list);
299 
300 }
301 
302 
303 int main()
304 {
305  struct timeval tv1, tv2;
306 
307  /* Blacklist dataset file */
308  FILE * dataset;
309 
310  dataset = fopen("blacklist6.txt", "r");
311  if (dataset == NULL) {
312  printf("blacklist6.txt not found\n");
313  return 1;
314  }
315 
316  /* Parse file line and create IPv4 and IPv6 network lists */
317  ipps_network_list_t * network_list = load_networks(dataset);
318  fclose(dataset);
319 
320  if (network_list->net_count == 0)
321  {
322  printf("Empty tree, nothing to do");
323  return 0;
324  }
325 
326 
327  /* Context of networks => networks are transformed to intervals from low to high IP of network,
328  * overlapping intervals are divided with relevant data, data are copied from 'ipps_network_list_t'
329  * ipps_context_t store sorted array of IPv4 intervals and IPv6 intervals and their counters separately
330  */
331  ipps_context_t *prefix_context;
332 
333  prefix_context = ipps_init(network_list);
334 
335 
336  if (prefix_context == NULL)
337  {
338  destroy_networks(network_list);
339  return 1;
340  }
341 
342  /* 'ipps_network_list_t' is no longer a need, data are copied in 'ipps_context_t' struct */
343  destroy_networks(network_list);
344 
345 
346  /* Print all ip intervals and data */
347  printf("----------------------------IPv4----------------------------\n");
348  int index = 0;
349  int j = 0;
350  char ip_string[INET6_ADDRSTRLEN];
351 
352  printf("\t%-16s \t%-16s\t%s\n", "Low IP", "High IP", "Data");
353 
354  /* Check print IPv4 */
355  for (index = 0; index < prefix_context->v4_count; ++index)
356  {
357  ip_to_str(&prefix_context->v4_prefix_intervals[index].low_ip, &ip_string[0]);
358  printf("\t%-16s", ip_string);
359  ip_to_str(&prefix_context->v4_prefix_intervals[index].high_ip, &ip_string[0]);
360  printf("\t%-15s", ip_string);
361  printf("\t");
362  for(j=0; j < prefix_context->v4_prefix_intervals[index].data_cnt; ++j)
363  {
364  printf("\t%s", (char *) prefix_context->v4_prefix_intervals[index].data_array[j]);
365  }
366  printf("\n");
367  }
368 
369  printf("------------------------------------------------------------\n");
370 
371  printf("\n-------------------------IPv6-------------------------------\n");
372  printf("\t%-46s \t%-46s\t\t%s\n", "Low IP", "High IP", "Data");
373  /* Check print IPv6 */
374  for(index = 0; index < prefix_context->v6_count; ++index)
375  {
376  ip_to_str(&prefix_context->v6_prefix_intervals[index].low_ip, &ip_string[0]);
377  printf("\t%-46s", ip_string);
378  ip_to_str(&prefix_context->v6_prefix_intervals[index].high_ip, &ip_string[0]);
379  printf("\t%-46s", ip_string);
380  printf("\t");
381  for(j=0; j < prefix_context->v6_prefix_intervals[index].data_cnt; ++j)
382  {
383  printf("\t%s", (char *) prefix_context->v6_prefix_intervals[index].data_array[j]);
384  }
385  printf("\n");
386  }
387  printf("------------------------------------------------------------\n\n");
388 
389 
390 
391 
392  /***************** Find some ip addresses in cycle ****************/
393  char *ip_addr[] = {"251.205.178.136",
394  "255.255.186.96",
395  "0.0.0.1",
396  "fd57:9f25:3409::07",
397  "ff8d:2222:1111::44"
398  };
399 
400 
401 
402  ip_addr_t ip;
403  int search_result; // Number of match prefixes, 0 if not match
404  char ** data = NULL; // data in blacklist is string
405 
406  gettimeofday(&tv1, NULL);
407  for (index = 0; index < 5; ++index) {
408  /* for each ip address in ip_addr array find in prefix interval_search_context */
409  printf("%-16s\n", ip_addr[index]);
410 
411  ip_from_str(ip_addr[index], &ip);
412 
413  /* find ip address 'ip' in network prefix interval_search_context */
414  search_result = ipps_search(&ip, prefix_context, (void ***) &data);
415 
416  if (search_result) {
417  /* if there is any match prefix, print all data */
418  for (j = 0; j < search_result; ++j) {
419  printf("\t%d %s\n", j, data[j]);
420  }
421  }
422  else {
423  printf("\tIP not found in blacklist dataset\n");
424  }
425  printf("\n");
426  }
427  gettimeofday(&tv2, NULL);
428 
429  printf("search time: %ld usec", tv2.tv_usec - tv1.tv_usec);
430 
431  /* Dealloc prefix interval_search_context struct */
432  ipps_destroy(prefix_context);
433 
434 
435  return 0;
436 }
437 ```
+ + + + diff --git a/doc/unirec/README_8md.html b/doc/unirec/README_8md.html new file mode 100644 index 00000000..0bc6c417 --- /dev/null +++ b/doc/unirec/README_8md.html @@ -0,0 +1,79 @@ + + + + + + + +UniRec: README.md File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
README.md File Reference
+
+ + + + + diff --git a/doc/unirec/README_8md_source.html b/doc/unirec/README_8md_source.html new file mode 100644 index 00000000..bf4ff1a0 --- /dev/null +++ b/doc/unirec/README_8md_source.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: README.md Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
README.md
+
+
+Go to the documentation of this file.
1 UniRec
2 =======
3 
4 Overview
5 --------
6 UniRec is a data format for storage and transfer of simple unstructured records,
7 i.e. sets of key-value pairs with a fixed set of keys. A record in UniRec format
8 is similar to a C structure but it can be defined at run-time. It thus brings
9 possibility to dynamically create structures in a statically typed language.
10 
11 The main advantage of UniRec is extremely fast access to fields of a record.
12 No parsing is needed, the fields are accessed directly from the record, almost
13 as in a plain C struct.
14 
15 In comparison with access to a struct member, just one additional memory
16 access is needed in order to find position of the field in the record. This
17 access is to a small table which easily fits into a CPU cache.
18 
19 To create an UniRec record, a user first needs to specify a set of fields and
20 their types - a template. Then a memory for the record is allocated and field
21 values can be set using simple macros.
22 
23 NOTE: The following text describes UniRec as used in the C or C++ language.
24 
25 ### Simplified example:
26 
27 ```
28 // Create a template with three fields (their types must be defined earlier)
29 ur_template_t *tmplt = ur_create_template("FIELD1,FIELD2,FIELD3", NULL);
30 
31 // Create a record with that template
32 void *record = ur_create_record(tmplt, 0);
33 
34 // Set values of fields
35 ur_set(tmplt, record, F_FIELD1, 1);
36 ur_set(tmplt, record, F_FIELD2, 234);
37 ur_set(tmplt, record, F_FIELD3, 56);
38 
39 // Read values of the record and print them to standard output
40 printf("%i %i %i\n",
41  ur_get(tmplt, record, F_FIELD1),
42  ur_get(tmplt, record, F_FIELD2),
43  ur_get(tmplt, record, F_FIELD3),
44 );
45 ```
46 
47 The example states that the types of the fields must be defined before a
48 template can be created. If names and types of the fields are known at
49 compile-time, they can be defined at the beginning of a *.c file as in the
50 following example:
51 ```
52 // Specify which fields will be used in the code and what are their types
53 UR_FIELDS(
54  int32 FIELD1,
55  int32 FIELD2,
56  int32 FIELD3,
57 )
58 ```
59 If the set of fields and their types is not known in advance, they may also be
60 defined at run-time. However, access to such fields is then a little more
61 complicated due to limitations of statically types languages (if a compiler
62 doesn't know the type of a field, it can't create a set of instructions to read
63 from or write into it).
64 
65 
66 UniRec data types
67 -----------------
68 
69 An UniRec field may have one of the following types:
70 
71 |name |size| description |
72 |--------|----|--------------------------------------------------------------|
73 |int8 | 1 |8bit singed integer |
74 |int16 | 2 |16bit singed integer |
75 |int32 | 4 |32bit singed integer |
76 |int64 | 8 |64bit singed integer |
77 |uint8 | 1 |8bit unsigned integer |
78 |uint16 | 2 |16bit unsigned integer |
79 |uint32 | 4 |32bit unsigned integer |
80 |uint64 | 8 |64bit unsigned integer |
81 |char | 1 |A single ASCII character |
82 |float | 4 |Single precision floating point number (IEEE 754) |
83 |double | 8 |Double precision floating point number (IEEE 754) |
84 |ipaddr | 16 |Special type for IPv4/IPv6 addresses, see below for details |
85 |macaddr | 6 |Special type for MAC address, see below for details |
86 |time | 8 |Special type for precise timestamps, see below for details |
87 |string | - |Variable-length array of (mostly) printable characters |
88 |bytes | - |Variable-length array of bytes (not expected to be printable characters) |
89 
90 
91 Types "string" and "bytes" are the same from a machine point of view (both are
92 of type char[] in C), the only difference is their semantics. When printing
93 as text, "string" is usually printed directly as ASCII or UTF-8 string,
94 "bytes" is rather interpreted as binary data and printed in hex.
95 
96 A terminating null character ('\0') SHOULD NOT be included at the end of
97 "string" values since this is specific for the C language and data in UniRec
98 should be independent of a programming language.
99 
100 ### ipaddr type
101 Structure to store both IPv4 and IPv6 addresses and associated functions.
102 
103 ### macaddr type
104 Structure to store MAC address and associated functions.
105 
106 ### time type
107 Structure to store timestamps and associated types, macros and function.
108 
109 
110 Field names
111 -----------
112 
113 Name of field may be any string matching the regular expression
114  [A-Za-z][A-Za-z0-9_]*
115 with the following limitations:
116  - It SHOULD NOT end with "_T" as this is reserved in C implementation for
117  symbolic constants storing the type of a field.
118 
119 It is RECOMMENDED that all field names are uppercase.
120 
121 Physical record layout
122 ----------------------
123 
124 An UniRec record consists of field values put one after another in a specific
125 order. There is no header. Information about the template and the size of the
126 record must be provided by other means.
127 
128 The layout of a record is given only by its template (specifying a set of fields
129 and their types) and the following rules.
130 
131 A record is divided into three sections:
132  1. Values of all fixed-length fields
133  2. Meta-information about variable-length fields
134  3. Data of variable-length fields
135 
136 Fixed-length fields in the first section are sorted by their size from largest
137 to smallest. Fields with the same size are sorted alphabetically by their name.
138 
139 The second section contains two 16bit numbers for each variable-length field -
140 offset of the beginning of the field's data and length of the data (in bytes).
141 The offset is counted from the beginning of the record.
142 
143 The meta-information fields are sorted alphabetically by the field names.
144 
145 The third section contains data of variable-length fields in an arbitrary order.
146 The data of variable-length fields SHOULD be placed immediately one after
147 another. There SHOULD be NO "empty spaces" between them and data of the fields
148 SHOULD NOT overlap.
149 
150 The first two sections are called the "fixed-length part" of a record, since their
151 total size is always the same and all data are present on fixed offsets (for a
152 given template). The last section is called "variable-length part" because its total
153 length as well as position of individual fields may be different in each record.
154 
155 ### Example
156 
157 The following picture shows layout of a record containing information about a
158 HTTP connection. The template of this record contains the following fields:
159  ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT,
160  uint8 PROTOCOL, uint8 TCP_FLAGS, uint32 PACKETS, uint32 BYTES,
161  uint16 HTTP_RSP_CODE, string HTTP_URL, string HTTP_USER_AGENT
162 
163 ```
164 byte 0 1 2 3
165  +-------+-------+-------+-------+
166  0 | |
167  4 | DST_IP |
168  8 | |
169 12 | |
170  +-------+-------+-------+-------+
171 16 | |
172 20 | SRC_IP |
173 24 | |
174 28 | |
175  +-------+-------+-------+-------+
176 32 | BYTES |
177  +-------+-------+-------+-------+
178 36 | PACKETS |
179  +-------+-------+-------+-------+
180 40 | DST_PORT | HTTP_RSP_CODE |
181  +-------+-------+-------+-------+
182 44 | SRC_PORT | PROTO | TCP_F |
183  +-------+-------+-------+-------+
184 48 | HTTP_URL(off) | HTTP_URL(len) |
185  +-------+-------+-------+-------+
186 52 | HTTP_USER(off)| HTTP_USER(len)| fixed-length
187  +-------+-------+-------+-------+ -----------------
188 56 | HTTP_URL (data) | variable-length part
189  + +-------+
190 60 | | |
191  +-------+-------+-------+ +
192 64 | HTTP_USER_AGENT (data) |
193  + +-------+-------+
194 68 | |
195  +-------+-------+
196 ```
197 
198 
199 ### Endianness
200 
201 All values, except IP and MAC addresses, are in little endian. IP and MAC addresses are treated
202 rather as sequences of bytes than numbers, so they are left in network order,
203 i.e. big-endian (however, they are encapsulated in a special data type and
204 shouldn't be accessed directly so the internal format should be needed to know).
205 
206 
207 ### Maximal record length
208 
209 Maximal length of the record is limited to 65534 (2^16 - 2) bytes.
210 
211 
212 ### Template definition
213 
214 Templates are usually defined by a string enumerating all the fields in the
215 template, using comma (',') as a separator of field names. Order of field names
216 in such string is not important (since physical order of fields is given by the
217 rules above).
218 
219 C library interface
220 ===================
221 
222 Types and structures
223 --------------------
224 
225 Types, enums and structures defined in unirec.h.
226 ```
227 enum ur_field_type {
228  UR_TYPE_INT8,
229  UR_TYPE_INT16,
230  UR_TYPE_INT32,
231  UR_TYPE_INT64,
232  UR_TYPE_UINT8,
233  UR_TYPE_UINT16,
234  UR_TYPE_UINT32,
235  UR_TYPE_UINT64,
236  UR_TYPE_CHAR,
237  UR_TYPE_FLOAT,
238  UR_TYPE_DOUBLE,
239  UR_TYPE_IP,
240  UR_TYPE_MAC,
241  UR_TYPE_TIME,
242  UR_TYPE_STRING,
243  UR_TYPE_BYTES,
244 };
245 ```
246  An enum value for each of the UniRec types.
247 
248 #### ur_field_id_t
249 Unsigned integer type for holding field IDs.
250 IMPLEMENTATION NOTE: ur_field_id_t = uint16_t
251 
252 #### ur_template_t
253 A structure defining an UniRec template. It contains information about which
254 fields are present in a record with that template and how to access them.
255 For user this is a black box, it is not needed to access the structure's
256 members directly.
257 
258 #### ur_iter_t
259 Iterator type used by ur_iter_fields function
260 
261 #### UR_ITER_BEGIN
262 #### UR_ITER_END
263 Constants used for iteration over fields in a template, see ur_iter_fields
264 function for details.
265 
266 
267 #### UR_MAX_SIZE = 65535
268  Maximal size of an UniRec record.
269 
270 Public functions and macros
271 ---------------------------
272 
273 ### Definition of statically-known UniRec fields.
274 ```
275 UR_FIELDS(type name [, type name [, ...] ])
276 ```
277 This macro allows to define fields used in the program and their types at
278 compile-time. This allows to access such fields in UniRec records more easily
279 and efficiently.
280 
281 This macro should be used in the beginning of each translation unit (i.e. a *.c
282 file) if the fields used (or at least some of them) are known at compile-time.
283 
284 Parameters:
285 - "name" may be any string matching the following regular expression:
286  [A-Za-z][A-Za-z0-9_]*
287  with the following exceptions:
288  - It must not be the same as a keyword in C/C++ or another identifier used in the source codes.
289  To avoid collisions with other identifiers in the UniRec library, do not use
290  identifiers beginning with "UR\_" or "ur\_"
291  - It must not end with _T (as this is reserved for constants specifying types)
292  - It is RECOMMENDED that all field names are upper case.
293 - "type" is one of the types specified in "format specification - data types".
294 
295 There MAY be a comma after the last field name. Also, there MAY be a semicolon
296 after the closing parenthesis at the end of the macro.
297 
298 #### Example:
299 ```
300 UR_FIELDS(
301  ipaddr SRC_IP,
302  ipaddr DST_IP,
303  uint16 SRC_PORT,
304  uint16 DST_PORT,
305  uint8 PROTO,
306 )
307 ```
308 This macro generates code allowing to use the defined fields in ur_get, ur_set
309 and other macros which need symbolic constants to access the fields.
310 
311 For each field specified by this macro, a CPP macro is defined with `F_` prefix
312 in the name and a value of a unique numeric ID. Also, a constant F_name_T is
313 defined with a value of the field's type (as defined in ur_field_type enum).
314 Other internal variables and structures are defined.
315 
316 If there are more than one translation unit accessing UniRec fields, the same set
317 of fields MUST be defined using UR_FIELDS in each of them.
318 
319 
320 ### Cleanup of all internal structures.
321 ```
322 int ur_finalize()
323 ```
324 This function has to be called after all UniRec functions and macros
325 invocations if there were some fields defined at run-time. Otherwise this function
326 does not have any effect, because nothing has been allocated. The function is called
327 typically during a cleanup phase before the program's end.
328 
329 No UniRec function or macro can be called after a call to ur_finalize.
330 
331 
332 ### Run-time definition of a field
333 ```
334 int ur_define_field(const char *name, ur_field_type type)
335 ```
336 This function allows to define a field at run-time.
337 
338 Parameters:
339 "name" - name of the new field, see description of UR_FIELDS for rules on
340 field names.
341 "type" - type of the new field.
342 
343 If a field with the same name already exists in the internal table of defined
344 fields and "type" is the same as the one in the table, the function just returns
345 the ID of the field. If types does not match, a UR_E_TYPE_MISMATCH error code
346 is returned.
347 
348 If no field with "name" is present in the table of fields, a new entry is
349 created with a new unique ID and the given name and type of the field.
350 The new ID is returned.
351 
352 Returns:
353 - ID of a field with the given name if no error occurs.
354 - UR_E_TYPE_MISMATCH if a field with the given name is already defined with a
355  different type.
356 - UR_E_INVALID_NAME if the name is not a valid field name.
357 - UR_E_INVALID_TYPE if the type is not one of the values of enum ur_field_type.
358 - UR_E_MEMORY if memory allocation error occurred.
359 
360 All error codes returned by this function are negative integers, ID is always
361 non-negative.
362 
363 If this function is used in a program, the function ur_finalize() has to be
364 called after all UniRec functions and macros invocations.
365 
366 NOTE: It is not necessary to define fields which were defined by UR_FIELDS.
367 It is recommended to define all fields statically by UR_FIELDS if possible.
368 This function is present only for cases when field names and/or types are not
369 known until run-time.
370 
371 NOTE: Fields defined by this function can be accessed using their numeric IDs
372 only. Symbolic CPP macros are not defined, of course.
373 
374 
375 ### Run-time definition of a set of fields
376 
377 ```
378 int ur_define_set_of_fields(const char *ifc_data_fmt);
379 ```
380 
381 This function allows to define sef of fields at run-time.
382 
383 Define new UniRec fields at run-time. It adds new fields into existing structures.
384 If the field already exists and type is equal nothing will happen. If the type is not equal
385 an error will be returned.
386 
387 Parameters:
388 "fc_data_fmt" - String containing types and names of fields delimited by comma.
389 Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2"
390 
391 
392 Returns:
393 - UR_OK on success
394 - UR_E_MEMORY if there is an allocation problem.
395 - UR_E_INVALID_NAME if the name value is empty.
396 - UR_E_INVALID_TYPE if the type does not exist.
397 - UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
398 
399 
400 ### Undefine field
401 ```
402 int ur_undefine_field(const char *name)
403 int ur_undefine_field_by_id(ur_field_id_t id)
404 ```
405 Allows to revert a previous definition of a field by ur_define_field.
406 
407 Frees the ID of the given field for future re-use. The ID becomes invalid after
408 a call to this function so the field with the given name can not be accessed
409 any more. Note that the same ID may be assigned to another field later.
410 
411 This function is not necessary in most cases. Its only purpose is to allow a
412 re-use of field IDs since their total count is limited to 2^16-1.
413 
414 After this function is used, all the templates using the undefined field have to
415 freed and created again.
416 
417 
418 ### Create UniRec template
419 ```
420 ur_template_t *ur_create_template(const char* fields, char **errstr)
421 ```
422 Creates a structure describing an UniRec template with the given set of fields
423 and returns a pointer to it.
424 
425 The template should be freed by ur_free_template after is not needed any more.
426 
427 Parameters:
428 - "fields" - A string containing names of fields separated by commas, e.g.:
429 "FOO,BAR,BAZ"
430 - "errstr" - (output) In case of an error a pointer to the error message is
431 returned using this parameter, if not set to NULL.
432 
433 Order of field names is not important, i.e. any two strings with the same set of
434 field names but with different order are equivalent.
435 
436 All fields MUST be previously defined, either statically by UR_FIELDS or by
437 calls to ur_define_field.
438 
439 If an error occurs and "errstr" is not NULL, it is set to a string with
440 corresponding error message.
441 
442 
443 Returns:
444 - Pointer to the newly created template or NULL if an error has occurred.
445 
446 
447 ### Create UniRec template for usage with Libtrap
448 ```
449 ur_template_t *ur_create_input_template(int ifc, const char* fields, char **errstr)
450 ```
451 Creates UniRec template and set this template to specified input interface (ifc).
452 
453 This template will be set as a minimum set of fields to be able to receive messages.
454 If the input interface receives superset of fields, the template will be expanded.
455 
456 ```
457 ur_template_t *ur_create_output_template(int ifc, const char* fields, char **errstr)
458 ```
459 Creates UniRec template and set this template to specified output interface (ifc).
460 
461 Set of fields of this template will be set to an output interface.
462 
463 ```
464 ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char* fields, char **errstr)
465 ```
466 Creates UniRec template and set this template to specified input (ifc_in) and output (ifc_out) interface.
467 
468 This template will be set as a minimum set of fields to be able to receive messages.
469 If the input interface receives superset of fields, the template will be expanded and
470 new set of fields will be set to output interface.
471 
472 
473 ### Free UniRec template
474 ```
475 void *ur_free_template(ur_template_t *tmplt)
476 ```
477 Free memory allocated for a template.
478 
479 
480 
481 ### Retrieve value from UniRec record.
482 Following functions are used to retrieve certain field value from UniRec record.
483 
484 Parameters:
485 - "tmplt" - Pointer to UniRec template
486 - "rec" - Pointer to UniRec record, which is created using given template.
487 - "field" - Identifier of a field.
488 
489 ```
490 ur_get(tmplt, rec, field)
491 ```
492 This function returns value of an appropriate type of a specific field (int, uint, ...).
493 Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
494 It can be used just for fixed size fields (not for string and bytes).
495 
496 ```
497 ur_get_ptr(tmplt, rec, field)
498 ```
499 This function returns pointer to a value of an appropriate type. Because of this,
500 the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
501 It can be used for both fixed-length and variable-length fields.
502 
503 ```
504 ur_get_ptr_by_id(tmplt, rec, field)
505 ```
506 This function returns void pointer to a value. Field can be symbolic constant or
507 numerical ID. It can be used for both fixed-length and variable-length fields.
508 (This function is used for fields defined at run-time)
509 
510 ```
511 char* ur_get_var_as_str(tmplt, rec, field);
512 ```
513 Function copies data of a variable-length field from UniRec record and append '\0' character.
514 The function allocates new memory space for the string, it must be freed using free()!
515 Field can be symbolic constant or numerical ID.
516 
517 ### Set value to UniRec record.
518 Following functions are used to set a value to specified field in a record.
519 
520 Parameters:
521 - "tmplt" - Pointer to UniRec template
522 - "rec" - Pointer to UniRec record, which is created using given template.
523 - "field" - Identifier of a field.
524 - "value" - Value which is copied to the record.
525 
526 ```
527 ur_set(tmplt, rec, field, value) // field must be a symbolic constant ...
528 ```
529 This function assumes value of an appropriate type of a specific field (int, uint, ...).
530 Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
531 It can be used just for fixed size fields (not for string and bytes).
532 
533 To set dynamically defined field, use ur_get_ptr_by_id() and write to that pointer.
534 
535 ```
536 ur_set_var(tmplt, rec, field, val_ptr, val_len)
537 ```
538 This function is used to set variable-length fields. Field can be symbolic constant or
539 numerical ID.
540 For better performance use function ur_clear_varlen, before setting all variable fields in record.
541 
542 Parameters:
543 - "val_ptr" - Pointer to value.
544 - "val_len" - Length of a value. (length which will be copied)
545 
546 ```
547  ur_clear_varlen(tmplt, rec);
548 ```
549 This function will clear all variable-length fields. It can be used for better performance of setting
550 content to variable-length fields. Use this function before setting of all the variable-length
551 fields.
552 ```
553 ur_set_string(tmplt, rec, field, str) //
554 ```
555 Set string to the UniRec record. Value is a C-style string, length is determined
556 automatically by strlen() ('\0' is not included in the record)
557 
558 - "str" - Pointer to a string.
559 
560 ### Size of a fixed-length, static field
561 ```
562 ur_get_size(field) // field must be a symbolic constant ...; for static fields only
563 ```
564 Returns size of a field. Field has to be statically defined.
565 For variable-length fields it returns -1. To get size of variable-length field use
566 function ur_get_var_len().
567 
568 ### Size of variable-length field
569 ```
570 ur_get_var_len(tmplt, rec, field)
571 ```
572 Returns length of a variable-length field. Field can be symbolic constant or
573 numerical ID.
574 
575 ### Size of a fixed-length part of a record
576 ```
577 ur_rec_fixlen_size(tmplt)
578 ```
579 Returns size of a fixed-length part of a record.
580 
581 ### Size of a variable-length part of a record
582 ```
583 ur_rec_varlen_size(tmplt, rec)
584 ```
585 Returns size of a variable-length part of a record.
586 
587 ### Size of a record
588 ```
589 ur_rec_size(tmplt, rec)
590 ```
591 Returns total size of whole UniRec record.
592 
593 ### Check template's fields
594 ```
595 ur_is_present(tmplt, field)
596 ```
597 Returns non-zero if field is present, zero otherwise.
598 
599 ### Check type of a field (variable-length or fixed-length)
600 ```
601 ur_is_varlen(field)
602 ur_is_fixlen(field)
603 ```
604 Returns non-zero if field is dynamic, zero otherwise.
605 
606 ### ID of a field (dynamic or static)
607 ```
608 ur_field_id_t ur_get_id_by_name(const char *name);
609 ```
610 Function returns id of a field by name of the field, or UR_E_INVALID_NAME if
611 the name is not known.
612 
613 ### Create UniRec record
614 ```
615 void* ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size);
616 ```
617 Allocates memory for a record with given template. It allocates N+M bytes,
618 where N is the size of fixed-length part of the record (inferred from template),
619 and M is the size of variable-length, which must be provided by caller.
620 
621 Parameters:
622 - "tmplt" - Pointer to UniRec template.
623 - "max_var_size" - Size of variable-length part, i.e. sum of lengths of all variable-
624 length fields. If it is not known at the time of record creation, use
625 UR_MAX_SIZE, which allocates enough memory to hold the largest possible UniRec
626 record (65535 bytes). Set to 0 if there are no variable-length fields in the template
627 
628 ### Free UniRec record
629 ```
630 void ur_free_record(void *record);
631 ```
632 Free memory allocated for UniRec record. You can call system free() on the
633 record as well.
634 
635 ### Clone record
636 ```
637 ur_clone_record(tmplt, src)
638 ```
639 Function creates new UniRec record and fills it with the data given by parameter.
640 It returns Pointer to a new UniRec record.
641 
642 Parameters:
643 - "tmplt" Pointer to UniRec template
644 - "src" Pointer to source record
645 
646 
647 ### Copy fields
648 ```
649 void ur_copy_fields(dst_tmplt, dst, src_tmplt, src);
650 ```
651 
652 Copies all fields present in both templates from src to dst.
653 
654 The function compares src_tmplt and dst_tmplt and for each field present in both
655 templates it sets the value of field in dst to a corresponding value in src.
656 
657 Parameters:
658 - "dst_tmplt" - Pointer to destination UniRec template.
659 - "dst" - Pointer to destination record. It must point to a memory of enough size.
660 - "src_tmplt" - Pointer to source UniRec template.
661 - "src" - Pointer to source record.
662 
663 
664 ### Iterate over fields of a template
665 ```
666 ur_iter_fields(tmplt, id);
667 ```
668 This function can be used to iterate over all fields of a given template.
669 It returns ID of the next field present in the template after a given ID.
670 If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more
671 fields are present, UR_ITER_END is returned.The order of fields is given
672 by the order in which they are defined.
673 
674 The order of fields is given by the order in which they are defined.
675 
676 Parameters:
677 - "tmplt" - Pointer to a template to iterate over.
678 - "id" - Field ID returned in last iteration or UR_ITER_BEGIN to get first value.
679 
680 Returns ID of the next field or UR_ITER_END if no more fields are present.
681 
682 Example usage:
683 ```
684 ur_field_id_t id = UR_ITER_BEGIN;
685 while ((id = ur_iter_fields(tmplt, id)) != UR_ITER_END) {
686 ...
687 }
688 ```
689 
690 ```
691 ur_iter_fields_record_order(tmplt, id);
692 ```
693 
694 This function can be used to iterate over all fields of a given template.
695 It returns n-th ID of a record specified by index.
696 If the return value is UR_ITER_END. The index is higher than count of fields
697 in the template.
698 
699 The order of fields is given by the order in the record
700 Parameters:
701 - "tmplt" Template to iterate over.
702 - "id" Field ID returned in last iteration or UR_ITER_BEGIN to
703  get first value.
704 Returns ID of the next field or UR_ITER_END if no more fields are present.
705 
706 Example usage:
707 ```
708 int i = 0;
709 while ((id = ur_iter_fields_record_order(tmplt, i++)) != UR_ITER_END) {
710 ...
711 }
712 ```
+ + + + diff --git a/doc/unirec/annotated.html b/doc/unirec/annotated.html new file mode 100644 index 00000000..82c3afa9 --- /dev/null +++ b/doc/unirec/annotated.html @@ -0,0 +1,95 @@ + + + + + + + +UniRec: Data Structures + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + + + + + + + + + + +
 Cfield_spec_tSorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm
 Cip_addr_t
 Cipps_context_t
 Cipps_interval_node_t
 Cipps_interval_t
 Cipps_network_list_t
 Cipps_network_t
 Cur_field_id_linked_list_tLinked list for undefined field ids Linked list consisting of field ids, which are freed after operation undefine
 Cur_field_specs_tUniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields
 Cur_links_tLinks structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n)
 Cur_static_field_specs_tUniRec default field list It contains all fields which are specified statically in source code of a module. This structure is passed to ur_init()
 Cur_template_tUniRec template. It contains a table mapping a field to its position in an UniRec record
 Cur_values_tValues names and descriptions It contains a table mapping a value to name and description
 Curcsv_t
+
+
+ + + + diff --git a/doc/unirec/arrowdown.png b/doc/unirec/arrowdown.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/doc/unirec/arrowdown.png differ diff --git a/doc/unirec/arrowright.png b/doc/unirec/arrowright.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/doc/unirec/arrowright.png differ diff --git a/doc/unirec/bc_s.png b/doc/unirec/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/doc/unirec/bc_s.png differ diff --git a/doc/unirec/bdwn.png b/doc/unirec/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/doc/unirec/bdwn.png differ diff --git a/doc/unirec/classIPaddr__cpp-members.html b/doc/unirec/classIPaddr__cpp-members.html new file mode 100644 index 00000000..26b0e6df --- /dev/null +++ b/doc/unirec/classIPaddr__cpp-members.html @@ -0,0 +1,88 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
+
+ + + + + + +
+
unirec +  2.2.5 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
IPaddr_cpp Member List
+
+
+ +

This is the complete list of members for IPaddr_cpp, including all inherited members.

+ + + + + + + + + + + + +
data (defined in IPaddr_cpp)IPaddr_cpp
IPaddr_cpp()IPaddr_cppinline
IPaddr_cpp(const ip_addr_t *ptr)IPaddr_cppinline
operator!=(const IPaddr_cpp &key2) constIPaddr_cppinline
operator<(const IPaddr_cpp &key2) constIPaddr_cppinline
operator<=(const IPaddr_cpp &key2) constIPaddr_cppinline
operator==(const IPaddr_cpp &key2) constIPaddr_cppinline
operator>(const IPaddr_cpp &key2) constIPaddr_cppinline
operator>=(const IPaddr_cpp &key2) constIPaddr_cppinline
toString() constIPaddr_cppinline
~IPaddr_cpp()IPaddr_cppinline
+ + + + diff --git a/doc/unirec/classIPaddr__cpp.html b/doc/unirec/classIPaddr__cpp.html new file mode 100644 index 00000000..035d406d --- /dev/null +++ b/doc/unirec/classIPaddr__cpp.html @@ -0,0 +1,453 @@ + + + + + + + +UniRec: IPaddr_cpp Class Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.2.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
IPaddr_cpp Class Reference
+
+
+ +

#include <ipaddr_cpp.h>

+ + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 IPaddr_cpp ()
 
 IPaddr_cpp (const ip_addr_t *ptr)
 
 ~IPaddr_cpp ()
 
bool operator< (const IPaddr_cpp &key2) const
 
bool operator<= (const IPaddr_cpp &key2) const
 
bool operator> (const IPaddr_cpp &key2) const
 
bool operator>= (const IPaddr_cpp &key2) const
 
bool operator== (const IPaddr_cpp &key2) const
 
bool operator!= (const IPaddr_cpp &key2) const
 
std::string toString () const
 
+ + + +

+Data Fields

const ip_addr_tdata
 
+ + + +

+Private Attributes

bool new_object
 
+

Detailed Description

+

IPaddr_cpp class representing IP address.

+

Wrapper of IP address data type (ip_addr_t) for C++.

+ +

Definition at line 14 of file ipaddr_cpp.h.

+

Constructor & Destructor Documentation

+ +

◆ IPaddr_cpp() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
IPaddr_cpp::IPaddr_cpp ()
+
+inline
+
+

Constructor of IPaddr_ccp object.

+ +

Definition at line 37 of file ipaddr_cpp.h.

+ +
+
+ +

◆ IPaddr_cpp() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
IPaddr_cpp::IPaddr_cpp (const ip_addr_tptr)
+
+inline
+
+

Copy constructor of IPaddr_cpp class.

+ +

Definition at line 23 of file ipaddr_cpp.h.

+ +
+
+ +

◆ ~IPaddr_cpp()

+ +
+
+ + + + + +
+ + + + + + + +
IPaddr_cpp::~IPaddr_cpp ()
+
+inline
+
+

Desctructor of IPaddr_ccp object.

+ +

Definition at line 46 of file ipaddr_cpp.h.

+ +
+
+

Member Function Documentation

+ +

◆ operator!=()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator!= (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator !=)

+ +

Definition at line 113 of file ipaddr_cpp.h.

+ +
+
+ +

◆ operator<()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator< (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator <)

+ +

Definition at line 73 of file ipaddr_cpp.h.

+ +
+
+ +

◆ operator<=()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator<= (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator <=)

+ +

Definition at line 82 of file ipaddr_cpp.h.

+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator== (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator ==)

+ +

Definition at line 105 of file ipaddr_cpp.h.

+ +
+
+ +

◆ operator>()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator> (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator >)

+ +

Definition at line 89 of file ipaddr_cpp.h.

+ +
+
+ +

◆ operator>=()

+ +
+
+ + + + + +
+ + + + + + + + +
bool IPaddr_cpp::operator>= (const IPaddr_cppkey2) const
+
+inline
+
+

Compare IP address (operator >=)

+ +

Definition at line 98 of file ipaddr_cpp.h.

+ +
+
+ +

◆ toString()

+ +
+
+ + + + + +
+ + + + + + + +
std::string IPaddr_cpp::toString () const
+
+inline
+
+

Convert IP address to string.

+
Returns
IP address as a string.
+ +

Definition at line 122 of file ipaddr_cpp.h.

+ +
+
+

Field Documentation

+ +

◆ data

+ +
+
+ + + + +
const ip_addr_t* IPaddr_cpp::data
+
+ +

Definition at line 17 of file ipaddr_cpp.h.

+ +
+
+ +

◆ new_object

+ +
+
+ + + + + +
+ + + + +
bool IPaddr_cpp::new_object
+
+private
+
+ +

Definition at line 15 of file ipaddr_cpp.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/doc/unirec/classes.html b/doc/unirec/classes.html new file mode 100644 index 00000000..2836b8ca --- /dev/null +++ b/doc/unirec/classes.html @@ -0,0 +1,91 @@ + + + + + + + +UniRec: Data Structure Index + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
Data Structure Index
+
+
+
f | i | u
+ + + + + + + + +
  f  
+
ipps_context_t   ipps_network_t   ur_field_specs_t   ur_values_t   
ipps_interval_node_t   
  u  
+
ur_links_t   urcsv_t   
field_spec_t   ipps_interval_t   ur_static_field_specs_t   
  i  
+
ipps_network_list_t   ur_field_id_linked_list_s   ur_template_t   
ip_addr_t   
+
f | i | u
+
+ + + + diff --git a/doc/unirec/closed.png b/doc/unirec/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/doc/unirec/closed.png differ diff --git a/doc/unirec/config_8h.html b/doc/unirec/config_8h.html new file mode 100644 index 00000000..a4d39932 --- /dev/null +++ b/doc/unirec/config_8h.html @@ -0,0 +1,662 @@ + + + + + + + +UniRec: config.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
config.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define HAVE_ALARM   1
 
#define HAVE_ARPA_INET_H   1
 
#define HAVE_DLFCN_H   1
 
#define HAVE_INTTYPES_H   1
 
#define HAVE_MALLOC   1
 
#define HAVE_MEMMOVE   1
 
#define HAVE_MEMORY_H   1
 
#define HAVE_MEMSET   1
 
#define HAVE_REALLOC   1
 
#define HAVE_STDBOOL_H   1
 
#define HAVE_STDINT_H   1
 
#define HAVE_STDLIB_H   1
 
#define HAVE_STRCHR   1
 
#define HAVE_STRINGS_H   1
 
#define HAVE_STRING_H   1
 
#define HAVE_SYS_SOCKET_H   1
 
#define HAVE_SYS_STAT_H   1
 
#define HAVE_SYS_TIME_H   1
 
#define HAVE_SYS_TYPES_H   1
 
#define HAVE_UNISTD_H   1
 
#define HAVE__BOOL   1
 
#define LT_OBJDIR   ".libs/"
 
#define PACKAGE   "unirec"
 
#define PACKAGE_BUGREPORT   "nemea@cesnet.cz"
 
#define PACKAGE_NAME   "unirec"
 
#define PACKAGE_STRING   "unirec 2.9.3"
 
#define PACKAGE_TARNAME   "unirec"
 
#define PACKAGE_URL   ""
 
#define PACKAGE_VERSION   "2.9.3"
 
#define STDC_HEADERS   1
 
#define TIME_WITH_SYS_TIME   1
 
#define VERSION   "2.9.3"
 
+

Macro Definition Documentation

+ +

◆ HAVE__BOOL

+ +
+
+ + + + +
#define HAVE__BOOL   1
+
+ +

Definition at line 67 of file config.h.

+ +
+
+ +

◆ HAVE_ALARM

+ +
+
+ + + + +
#define HAVE_ALARM   1
+
+ +

Definition at line 5 of file config.h.

+ +
+
+ +

◆ HAVE_ARPA_INET_H

+ +
+
+ + + + +
#define HAVE_ARPA_INET_H   1
+
+ +

Definition at line 8 of file config.h.

+ +
+
+ +

◆ HAVE_DLFCN_H

+ +
+
+ + + + +
#define HAVE_DLFCN_H   1
+
+ +

Definition at line 11 of file config.h.

+ +
+
+ +

◆ HAVE_INTTYPES_H

+ +
+
+ + + + +
#define HAVE_INTTYPES_H   1
+
+ +

Definition at line 14 of file config.h.

+ +
+
+ +

◆ HAVE_MALLOC

+ +
+
+ + + + +
#define HAVE_MALLOC   1
+
+ +

Definition at line 18 of file config.h.

+ +
+
+ +

◆ HAVE_MEMMOVE

+ +
+
+ + + + +
#define HAVE_MEMMOVE   1
+
+ +

Definition at line 21 of file config.h.

+ +
+
+ +

◆ HAVE_MEMORY_H

+ +
+
+ + + + +
#define HAVE_MEMORY_H   1
+
+ +

Definition at line 24 of file config.h.

+ +
+
+ +

◆ HAVE_MEMSET

+ +
+
+ + + + +
#define HAVE_MEMSET   1
+
+ +

Definition at line 27 of file config.h.

+ +
+
+ +

◆ HAVE_REALLOC

+ +
+
+ + + + +
#define HAVE_REALLOC   1
+
+ +

Definition at line 31 of file config.h.

+ +
+
+ +

◆ HAVE_STDBOOL_H

+ +
+
+ + + + +
#define HAVE_STDBOOL_H   1
+
+ +

Definition at line 34 of file config.h.

+ +
+
+ +

◆ HAVE_STDINT_H

+ +
+
+ + + + +
#define HAVE_STDINT_H   1
+
+ +

Definition at line 37 of file config.h.

+ +
+
+ +

◆ HAVE_STDLIB_H

+ +
+
+ + + + +
#define HAVE_STDLIB_H   1
+
+ +

Definition at line 40 of file config.h.

+ +
+
+ +

◆ HAVE_STRCHR

+ +
+
+ + + + +
#define HAVE_STRCHR   1
+
+ +

Definition at line 43 of file config.h.

+ +
+
+ +

◆ HAVE_STRING_H

+ +
+
+ + + + +
#define HAVE_STRING_H   1
+
+ +

Definition at line 49 of file config.h.

+ +
+
+ +

◆ HAVE_STRINGS_H

+ +
+
+ + + + +
#define HAVE_STRINGS_H   1
+
+ +

Definition at line 46 of file config.h.

+ +
+
+ +

◆ HAVE_SYS_SOCKET_H

+ +
+
+ + + + +
#define HAVE_SYS_SOCKET_H   1
+
+ +

Definition at line 52 of file config.h.

+ +
+
+ +

◆ HAVE_SYS_STAT_H

+ +
+
+ + + + +
#define HAVE_SYS_STAT_H   1
+
+ +

Definition at line 55 of file config.h.

+ +
+
+ +

◆ HAVE_SYS_TIME_H

+ +
+
+ + + + +
#define HAVE_SYS_TIME_H   1
+
+ +

Definition at line 58 of file config.h.

+ +
+
+ +

◆ HAVE_SYS_TYPES_H

+ +
+
+ + + + +
#define HAVE_SYS_TYPES_H   1
+
+ +

Definition at line 61 of file config.h.

+ +
+
+ +

◆ HAVE_UNISTD_H

+ +
+
+ + + + +
#define HAVE_UNISTD_H   1
+
+ +

Definition at line 64 of file config.h.

+ +
+
+ +

◆ LT_OBJDIR

+ +
+
+ + + + +
#define LT_OBJDIR   ".libs/"
+
+ +

Definition at line 70 of file config.h.

+ +
+
+ +

◆ PACKAGE

+ +
+
+ + + + +
#define PACKAGE   "unirec"
+
+ +

Definition at line 73 of file config.h.

+ +
+
+ +

◆ PACKAGE_BUGREPORT

+ +
+
+ + + + +
#define PACKAGE_BUGREPORT   "nemea@cesnet.cz"
+
+ +

Definition at line 76 of file config.h.

+ +
+
+ +

◆ PACKAGE_NAME

+ +
+
+ + + + +
#define PACKAGE_NAME   "unirec"
+
+ +

Definition at line 79 of file config.h.

+ +
+
+ +

◆ PACKAGE_STRING

+ +
+
+ + + + +
#define PACKAGE_STRING   "unirec 2.9.3"
+
+ +

Definition at line 82 of file config.h.

+ +
+
+ +

◆ PACKAGE_TARNAME

+ +
+
+ + + + +
#define PACKAGE_TARNAME   "unirec"
+
+ +

Definition at line 85 of file config.h.

+ +
+
+ +

◆ PACKAGE_URL

+ +
+
+ + + + +
#define PACKAGE_URL   ""
+
+ +

Definition at line 88 of file config.h.

+ +
+
+ +

◆ PACKAGE_VERSION

+ +
+
+ + + + +
#define PACKAGE_VERSION   "2.9.3"
+
+ +

Definition at line 91 of file config.h.

+ +
+
+ +

◆ STDC_HEADERS

+ +
+
+ + + + +
#define STDC_HEADERS   1
+
+ +

Definition at line 94 of file config.h.

+ +
+
+ +

◆ TIME_WITH_SYS_TIME

+ +
+
+ + + + +
#define TIME_WITH_SYS_TIME   1
+
+ +

Definition at line 97 of file config.h.

+ +
+
+ +

◆ VERSION

+ +
+
+ + + + +
#define VERSION   "2.9.3"
+
+ +

Definition at line 100 of file config.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/config_8h_source.html b/doc/unirec/config_8h_source.html new file mode 100644 index 00000000..9891d719 --- /dev/null +++ b/doc/unirec/config_8h_source.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: config.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
config.h
+
+
+Go to the documentation of this file.
1 /* config.h. Generated from config.h.in by configure. */
2 /* config.h.in. Generated from configure.ac by autoheader. */
3 
4 /* Define to 1 if you have the `alarm' function. */
5 #define HAVE_ALARM 1
6 
7 /* Define to 1 if you have the <arpa/inet.h> header file. */
8 #define HAVE_ARPA_INET_H 1
9 
10 /* Define to 1 if you have the <dlfcn.h> header file. */
11 #define HAVE_DLFCN_H 1
12 
13 /* Define to 1 if you have the <inttypes.h> header file. */
14 #define HAVE_INTTYPES_H 1
15 
16 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
17  to 0 otherwise. */
18 #define HAVE_MALLOC 1
19 
20 /* Define to 1 if you have the `memmove' function. */
21 #define HAVE_MEMMOVE 1
22 
23 /* Define to 1 if you have the <memory.h> header file. */
24 #define HAVE_MEMORY_H 1
25 
26 /* Define to 1 if you have the `memset' function. */
27 #define HAVE_MEMSET 1
28 
29 /* Define to 1 if your system has a GNU libc compatible `realloc' function,
30  and to 0 otherwise. */
31 #define HAVE_REALLOC 1
32 
33 /* Define to 1 if stdbool.h conforms to C99. */
34 #define HAVE_STDBOOL_H 1
35 
36 /* Define to 1 if you have the <stdint.h> header file. */
37 #define HAVE_STDINT_H 1
38 
39 /* Define to 1 if you have the <stdlib.h> header file. */
40 #define HAVE_STDLIB_H 1
41 
42 /* Define to 1 if you have the `strchr' function. */
43 #define HAVE_STRCHR 1
44 
45 /* Define to 1 if you have the <strings.h> header file. */
46 #define HAVE_STRINGS_H 1
47 
48 /* Define to 1 if you have the <string.h> header file. */
49 #define HAVE_STRING_H 1
50 
51 /* Define to 1 if you have the <sys/socket.h> header file. */
52 #define HAVE_SYS_SOCKET_H 1
53 
54 /* Define to 1 if you have the <sys/stat.h> header file. */
55 #define HAVE_SYS_STAT_H 1
56 
57 /* Define to 1 if you have the <sys/time.h> header file. */
58 #define HAVE_SYS_TIME_H 1
59 
60 /* Define to 1 if you have the <sys/types.h> header file. */
61 #define HAVE_SYS_TYPES_H 1
62 
63 /* Define to 1 if you have the <unistd.h> header file. */
64 #define HAVE_UNISTD_H 1
65 
66 /* Define to 1 if the system has the type `_Bool'. */
67 #define HAVE__BOOL 1
68 
69 /* Define to the sub-directory where libtool stores uninstalled libraries. */
70 #define LT_OBJDIR ".libs/"
71 
72 /* Name of package */
73 #define PACKAGE "unirec"
74 
75 /* Define to the address where bug reports for this package should be sent. */
76 #define PACKAGE_BUGREPORT "nemea@cesnet.cz"
77 
78 /* Define to the full name of this package. */
79 #define PACKAGE_NAME "unirec"
80 
81 /* Define to the full name and version of this package. */
82 #define PACKAGE_STRING "unirec 2.9.3"
83 
84 /* Define to the one symbol short name of this package. */
85 #define PACKAGE_TARNAME "unirec"
86 
87 /* Define to the home page for this package. */
88 #define PACKAGE_URL ""
89 
90 /* Define to the version of this package. */
91 #define PACKAGE_VERSION "2.9.3"
92 
93 /* Define to 1 if you have the ANSI C header files. */
94 #define STDC_HEADERS 1
95 
96 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
97 #define TIME_WITH_SYS_TIME 1
98 
99 /* Version number of package */
100 #define VERSION "2.9.3"
101 
102 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
103  <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
104  #define below would cause a syntax error. */
105 /* #undef _UINT32_T */
106 
107 /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
108  <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
109  #define below would cause a syntax error. */
110 /* #undef _UINT64_T */
111 
112 /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
113  <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
114  #define below would cause a syntax error. */
115 /* #undef _UINT8_T */
116 
117 /* Define to `__inline__' or `__inline' if that's what the C compiler
118  calls it, or to nothing if 'inline' is not supported under any name. */
119 #ifndef __cplusplus
120 /* #undef inline */
121 #endif
122 
123 /* Define to the type of a signed integer type of width exactly 16 bits if
124  such a type exists and the standard includes do not define it. */
125 /* #undef int16_t */
126 
127 /* Define to the type of a signed integer type of width exactly 32 bits if
128  such a type exists and the standard includes do not define it. */
129 /* #undef int32_t */
130 
131 /* Define to the type of a signed integer type of width exactly 64 bits if
132  such a type exists and the standard includes do not define it. */
133 /* #undef int64_t */
134 
135 /* Define to the type of a signed integer type of width exactly 8 bits if such
136  a type exists and the standard includes do not define it. */
137 /* #undef int8_t */
138 
139 /* Define to rpl_malloc if the replacement function should be used. */
140 /* #undef malloc */
141 
142 /* Define to rpl_realloc if the replacement function should be used. */
143 /* #undef realloc */
144 
145 /* Define to `unsigned int' if <sys/types.h> does not define. */
146 /* #undef size_t */
147 
148 /* Define to the type of an unsigned integer type of width exactly 16 bits if
149  such a type exists and the standard includes do not define it. */
150 /* #undef uint16_t */
151 
152 /* Define to the type of an unsigned integer type of width exactly 32 bits if
153  such a type exists and the standard includes do not define it. */
154 /* #undef uint32_t */
155 
156 /* Define to the type of an unsigned integer type of width exactly 64 bits if
157  such a type exists and the standard includes do not define it. */
158 /* #undef uint64_t */
159 
160 /* Define to the type of an unsigned integer type of width exactly 8 bits if
161  such a type exists and the standard includes do not define it. */
162 /* #undef uint8_t */
+ + + + diff --git a/doc/unirec/doc.png b/doc/unirec/doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/doc/unirec/doc.png differ diff --git a/doc/unirec/doxygen.css b/doc/unirec/doxygen.css new file mode 100644 index 00000000..266c8b3a --- /dev/null +++ b/doc/unirec/doxygen.css @@ -0,0 +1,1596 @@ +/* The standard CSS for doxygen 1.8.14 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +/* +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTableHead tr { +} + +table.markdownTableBodyLeft td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft { + text-align: left +} + +th.markdownTableHeadRight { + text-align: right +} + +th.markdownTableHeadCenter { + text-align: center +} +*/ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + + +/* @end */ diff --git a/doc/unirec/doxygen.png b/doc/unirec/doxygen.png new file mode 100644 index 00000000..3ff17d80 Binary files /dev/null and b/doc/unirec/doxygen.png differ diff --git a/doc/unirec/dynsections.js b/doc/unirec/dynsections.js new file mode 100644 index 00000000..537e3e49 --- /dev/null +++ b/doc/unirec/dynsections.js @@ -0,0 +1,127 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +UniRec: example_unirec.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
example_unirec.c File Reference
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include "fields.c"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

 UR_FIELDS (uint32 FOO, uint32 BAR, ipaddr IP, string STR1, string STR2,) int main(int argc
 
 ur_set (tmplt, rec, F_FOO, 12345)
 
 ur_set (tmplt, rec, F_BAR, 54321)
 
 ur_set (tmplt, rec, F_IP, ip_from_int(12345678))
 
 ur_set_string (tmplt, rec, F_STR1, "Hello World!")
 
 memcpy (buffer, rec, ur_rec_size(tmplt, rec))
 
 free (rec)
 
 ur_free_template (tmplt)
 
 printf ("%u %u %u %s\, ur_get(tmplt, buffer, F_FOO), ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), ur_get_var_len(tmplt, buffer, F_STR1), ur_get_ptr(tmplt, buffer, F_STR1))
 
 if (new_id< 0)
 
 ur_copy_fields (tmplt2, buffer2, tmplt1, buffer)
 
 ur_set_string (tmplt2, buffer2, F_STR2, "The second string")
 
*uint16_t * ur_get_ptr_by_id (tmplt2, buffer2, new_id))
 
 ur_free_template (tmplt1)
 
 ur_free_template (tmplt2)
 
 printf (" new field %d\, new_id)
 
 printf ("%u %u %s %u %s %u\, ur_get(tmplt, buffer2, F_BAR), ur_get_var_len(tmplt, buffer2, F_STR1), ur_get_ptr(tmplt, buffer2, F_STR1), ur_get_var_len(tmplt, buffer2, F_STR2), ur_get_ptr(tmplt, buffer2, F_STR2), *(uint16_t *) ur_get_ptr_by_id(tmplt, buffer2, new_id))
 
 free (buffer)
 
 free (buffer2)
 
 ur_finalize ()
 
+ + + + + + + + + + + + + + + + + +

+Variables

char ** argv
 
void * rec = ur_create_record(tmplt, 512)
 
 buffer = malloc(ur_rec_size(tmplt, rec))
 
ur_template_ttmplt1 = ur_create_template("FOO,BAR,IP,STR1", NULL)
 
ur_template_ttmplt2 = ur_create_template("BAR,STR1,STR2,NEW", NULL)
 
 buffer2 = ur_create_record(tmplt2, ur_get_var_len(tmplt1, buffer, F_STR1) + 64)
 
ur_field_id_t new_id = ur_get_id_by_name("NEW")
 
 return
 
+

Function Documentation

+ +

◆ free() [1/3]

+ +
+
+ + + + + + + + +
free (rec )
+
+ +
+
+ +

◆ free() [2/3]

+ +
+
+ + + + + + + + +
free (buffer )
+
+ +
+
+ +

◆ free() [3/3]

+ +
+
+ + + + + + + + +
free (buffer2 )
+
+ +
+
+ +

◆ if()

+ +
+
+ + + + + + + +
if ()
+
+ +

Definition at line 78 of file example_unirec.c.

+ +
+
+ +

◆ memcpy()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
memcpy (buffer ,
rec ,
ur_rec_size(tmplt, rec 
)
+
+ +
+
+ +

◆ printf() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
printf ("%u %u %u %s\ ,
ur_get(tmplt, buffer, F_FOO) ,
ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))) ,
ur_get_var_len(tmplt, buffer, F_STR1) ,
ur_get_ptr(tmplt, buffer, F_STR1)  
)
+
+ +
+
+ +

◆ printf() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + +
printf (" new field %d\ ,
new_id  
)
+
+ +
+
+ +

◆ printf() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
printf ("%u %u %s %u %s %u\ ,
ur_get(tmplt, buffer2, F_BAR) ,
ur_get_var_len(tmplt, buffer2, F_STR1) ,
ur_get_ptr(tmplt, buffer2, F_STR1) ,
ur_get_var_len(tmplt, buffer2, F_STR2) ,
ur_get_ptr(tmplt, buffer2, F_STR2) ,
uint16_t *) ur_get_ptr_by_id(tmplt, buffer2, new_id 
)
+
+ +
+
+ +

◆ ur_copy_fields()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_copy_fields (tmplt2 ,
buffer2 ,
tmplt1 ,
buffer  
)
+
+ +
+
+ +

◆ UR_FIELDS()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UR_FIELDS (uint32 FOO,
uint32 BAR,
ipaddr IP,
string STR1,
string STR2 
)
+
+ +
+
+ +

◆ ur_finalize()

+ +
+
+ + + + + + + +
ur_finalize ()
+
+ +

Definition at line 734 of file unirec.c.

+ +
+
+ +

◆ ur_free_template() [1/3]

+ +
+
+ + + + + + + + +
ur_free_template (tmplt )
+
+ +
+
+ +

◆ ur_free_template() [2/3]

+ +
+
+ + + + + + + + +
ur_free_template (tmplt1 )
+
+ +
+
+ +

◆ ur_free_template() [3/3]

+ +
+
+ + + + + + + + +
ur_free_template (tmplt2 )
+
+ +
+
+ +

◆ ur_get_ptr_by_id()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
* uint16_t* ur_get_ptr_by_id (tmplt2 ,
buffer2 ,
new_id  
)
+
+ +
+
+ +

◆ ur_set() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_set (tmplt ,
rec ,
F_FOO ,
12345  
)
+
+ +
+
+ +

◆ ur_set() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_set (tmplt ,
rec ,
F_BAR ,
54321  
)
+
+ +
+
+ +

◆ ur_set() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_set (tmplt ,
rec ,
F_IP ,
ip_from_int(12345678)  
)
+
+ +
+
+ +

◆ ur_set_string() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_set_string (tmplt ,
rec ,
F_STR1 ,
"Hello World!"  
)
+
+ +
+
+ +

◆ ur_set_string() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_set_string (tmplt2 ,
buffer2 ,
F_STR2 ,
"The second string"  
)
+
+ +
+
+

Variable Documentation

+ +

◆ argv

+ +
+
+ + + + +
char** argv
+
+Initial value:
{
char *buffer, *buffer2
buffer
+
buffer2
+
+

Definition at line 26 of file example_unirec.c.

+ +
+
+ +

◆ buffer

+ +
+
+ + + + +
buffer = malloc(ur_rec_size(tmplt, rec))
+
+ +

Definition at line 43 of file example_unirec.c.

+ +
+
+ +

◆ buffer2

+ +
+
+ + + + +
buffer2 = ur_create_record(tmplt2, ur_get_var_len(tmplt1, buffer, F_STR1) + 64)
+
+ +

Definition at line 88 of file example_unirec.c.

+ +
+
+ +

◆ new_id

+ +
+
+ + + + +
ur_field_id_t new_id = ur_get_id_by_name("NEW")
+
+ +

Definition at line 115 of file example_unirec.c.

+ +
+
+ +

◆ rec

+ +
+
+ + + + +
void* rec = ur_create_record(tmplt, 512)
+
+ +

Definition at line 35 of file example_unirec.c.

+ +
+
+ +

◆ return

+ +
+
+ + + + +
return
+
+ +

Definition at line 135 of file example_unirec.c.

+ +
+
+ +

◆ tmplt1

+ +
+
+ + + + +
ur_template_t* tmplt1 = ur_create_template("FOO,BAR,IP,STR1", NULL)
+
+ +

Definition at line 84 of file example_unirec.c.

+ +
+
+ +

◆ tmplt2

+ +
+
+ + + + +
ur_template_t* tmplt2 = ur_create_template("BAR,STR1,STR2,NEW", NULL)
+
+ +

Definition at line 85 of file example_unirec.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/example__unirec_8c_source.html b/doc/unirec/example__unirec_8c_source.html new file mode 100644 index 00000000..baaa4d50 --- /dev/null +++ b/doc/unirec/example__unirec_8c_source.html @@ -0,0 +1,107 @@ + + + + + + + +UniRec: example_unirec.c Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
example_unirec.c
+
+
+Go to the documentation of this file.
1 // ** Put header + licence here **
2 
3 /* Example of a module with a fixed set of input and output UniRec fields.
4  Input requires two numbers: FOO and BAR. Output contains fields FOO, BAR
5  and BAZ, where BAZ = FOO + BAR.
6  If input contains some other fields besides FOO and BAR, they are NOT copied
7  to the output. Output always consists of FOO, BAR, BAZ only.
8 */
9 
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <signal.h>
13 
14 #include <string.h>
15 #include "fields.c"
16 //Example of usage Unirec library
17 UR_FIELDS(
18  uint32 FOO,
19  uint32 BAR,
20  ipaddr IP,
21  string STR1,
22  string STR2,
23 )
24 
25 int main(int argc, char **argv)
26 {
27  char *buffer, *buffer2;
28 
29  // Create a record and store it to the buffer
30  {
31  // Create template
32  ur_template_t *tmplt = ur_create_template("FOO,BAR,IP,STR1", NULL);
33 
34  // Allocate memory for a record
35  void *rec = ur_create_record(tmplt, 512); // Pre-allocate 512 bytes for strings
36 
37  // Fill values into the record
38  ur_set(tmplt, rec, F_FOO, 12345);
39  ur_set(tmplt, rec, F_BAR, 54321);
40  ur_set(tmplt, rec, F_IP, ip_from_int(12345678));
41  ur_set_string(tmplt, rec, F_STR1, "Hello World!");
42  // Store record into a buffer
43  buffer = malloc(ur_rec_size(tmplt, rec));
44  memcpy(buffer, rec, ur_rec_size(tmplt, rec));
45 
46  // Free memory
47  free(rec);
48  ur_free_template(tmplt);
49  }
50 
51  // -----
52 
53  // Read data from the record in the buffer
54  {
55  // Create another template with the same set of fields (the set of fields MUST be the same, even if we don't need to work with all fields)
56  ur_template_t *tmplt = ur_create_template("FOO,BAR,IP,STR1", NULL);
57 
58  // Read FOO, IP and STR1 fields from the record in the buffer
59  // (to keep it simple, ip address is printed as a number)
60  printf("%u %u %u %s\n",
61  ur_get(tmplt, buffer, F_FOO), // Access to plain integer is simple
62  ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), // IP address must be converted before print
63  ur_get_var_len(tmplt, buffer, F_STR1), // Returns length of the string (it is neccessary to use "%*s" since string in UniRec don't contain terminating '\0')
64  ur_get_ptr(tmplt, buffer, F_STR1) // Returns pointer to the beginning of the string
65  );
66  // -> should print "12345 12345678 13 Hello World!"
67 
68  ur_free_template(tmplt);
69  }
70 
71  // -----
72 
73  // Copy selected fields of the record into a new one and add two new fields,
74  // one is known before (STR2), one is newly defined (NEW)
75  {
76  // Define the field NEW
78  if (new_id < 0) {
79  fprintf(stderr, "ERROR: Can't define new unirec field 'NEW'");
80  exit(1);
81  }
82 
83  // Create templates matching the old and the new record
84  ur_template_t *tmplt1 = ur_create_template("FOO,BAR,IP,STR1", NULL);
85  ur_template_t *tmplt2 = ur_create_template("BAR,STR1,STR2,NEW", NULL);
86 
87  // Allocate buffer for the new record
88  buffer2 = ur_create_record(tmplt2, ur_get_var_len(tmplt1, buffer, F_STR1) + 64); // Allocate 64B for STR2
89 
90  // This function copies all fields present in both templates from buffer to buffer2
92  // TODO speciln funkce pro koprovan cel tmplt1, pokud vme, e tmplt2 je nadmonoinou tmplt1 (a pokud to tak bude efektivnj)
93 
94  // Record in buffer2 now contains fields BAR and STR1 with the same values as in buffer.
95  // Values of STR2 and NEW are undefined.
96 
97  // Set value of str2
98  ur_set_string(tmplt2, buffer2, F_STR2, "The second string");
99 
100  // Set value of NEW
101  // (we can't use ur_set because type of the field is not known at compile time)
102  *(uint16_t*)(ur_get_ptr_by_id(tmplt2, buffer2, new_id)) = 1;
105  }
106 
107  // -----
108 
109  // Read data from the record in the second buffer
110  {
111  // Create template with the second set of fields (we can use different order of fields, it doesn't matter)
112  ur_template_t *tmplt = ur_create_template("BAR,NEW,STR2,STR1", NULL);
113 
114  // The NEW field is already defined (it is stored globally) but we don't know its ID here
116  printf(" new field %d\n", new_id);
117 
118  // Read FOO, IP, STR1 and NEW fields from the record in the buffer
119  printf("%u %u %s %u %s %u\n",
120  ur_get(tmplt, buffer2, F_BAR),
121  ur_get_var_len(tmplt, buffer2, F_STR1),
122  ur_get_ptr(tmplt, buffer2, F_STR1),
123  ur_get_var_len(tmplt, buffer2, F_STR2),
124  ur_get_ptr(tmplt, buffer2, F_STR2),
125  *(uint16_t*)ur_get_ptr_by_id(tmplt, buffer2, new_id) // Access to dynamically defined fields is a little more complicated
126  );
127  // -> should print "54321 13 Hello World! 18 The second string 1"
128 
129  ur_free_template(tmplt);
130  }
131 
132  free(buffer);
133  free(buffer2);
134  ur_finalize();
135  return 0;
136 }
INLINE uint32_t ip_get_v4_as_int(ip_addr_t *addr)
Definition: ipaddr.h:157
+
ur_template_t * tmplt1
+
UR_FIELDS(uint32 FOO, uint32 BAR, ipaddr IP, string STR1, string STR2,) int main(int argc
+
ur_template_t * ur_create_template(const char *fields, char **errstr)
Create UniRec template Create new UniRec template specified by a string containing names of its field...
Definition: unirec.c:900
+
unsigned int (16b)
Definition: unirec.h:101
+
int ur_define_field(const char *name, ur_field_type_t type)
Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structur...
Definition: unirec.c:636
+
ur_set(tmplt, rec, F_FOO, 12345)
+
#define ur_get(tmplt, data, field_id)
Get value of UniRec field Get value of a fixed-length UniRec field. For variable-length fields...
Definition: unirec.h:418
+
#define ur_get_ptr(tmplt, data, field_id)
Get pointer to UniRec field Get pointer to fixed or varible length statically defined UniRec field...
Definition: unirec.h:430
+
*uint16_t * ur_get_ptr_by_id(tmplt2, buffer2, new_id))
+
ur_free_template(tmplt)
+
free(rec)
+
#define ur_rec_size(tmplt, rec)
Get size of UniRec record (static and variable length) Get total size of whole UniRec record...
Definition: unirec.h:680
+
ur_copy_fields(tmplt2, buffer2, tmplt1, buffer)
+
printf("%u %u %u %s\, ur_get(tmplt, buffer, F_FOO), ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), ur_get_var_len(tmplt, buffer, F_STR1), ur_get_ptr(tmplt, buffer, F_STR1))
+
void * rec
+
void * ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size)
Definition: unirec.c:1214
+
#define ur_get_var_len(tmplt, rec, field_id)
Get size of a variable sized field in the record. Get size of a variable-length field in the record...
Definition: unirec.h:474
+
int16_t ur_field_id_t
Type of UniRec field identifiers.
Definition: unirec.h:136
+
INLINE ip_addr_t ip_from_int(uint32_t i)
Definition: ipaddr.h:183
+
ur_finalize()
Definition: unirec.c:734
+
char ** argv
+
buffer
+
buffer2
+
memcpy(buffer, rec, ur_rec_size(tmplt, rec))
+
UniRec template. It contains a table mapping a field to its position in an UniRec record...
Definition: unirec.h:191
+
ur_field_id_t new_id
+
int ur_get_id_by_name(const char *name)
Get ID of a field by its name Get ID of a field by its name.
Definition: unirec.c:774
+
ur_template_t * tmplt2
+
ur_set_string(tmplt, rec, F_STR1, "Hello World!")
+
+ + + + diff --git a/doc/unirec/files.html b/doc/unirec/files.html new file mode 100644 index 00000000..3a6f3138 --- /dev/null +++ b/doc/unirec/files.html @@ -0,0 +1,97 @@ + + + + + + + +UniRec: File List + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+ + + + + + + + + + + + + + + + + +
 config.h
 example_unirec.c
 inline.h
 ip_prefix_search.cInit and prefix search
 ip_prefix_search.hInit context and prefix search
 ipaddr.hStructure to store both IPv4 and IPv6 addresses and associated functions
 ipps_internal.hInit context and prefix search - Internal functions and structures
 links.hDefinition of structures and functions for handling LINK_BIT_FIELD. Implementation is in unirec.c. It uses link mask (hexadecimal, 64bit long number) to determine which links are used and how they are used. It means, that one can use e.g. 9 links, which do not have to fill ones in LINK_BIT_FIELD on positions 1 - 9 necessary but on positions specified by link mask
 macaddr.hStructure to store MAC address and associated functions
 unirec.cDefinition of UniRec structures and functions
 unirec.hDefinition of UniRec structures and functions
 unirec2csv.c
 unirec2csv.hDefinition of UniRec API to create CSV-like representation of UniRec data
 ur_time.hTypes, macros and function for UniRec timestamp format
 ur_values.c
 ur_values.h
+
+
+ + + + diff --git a/doc/unirec/folderclosed.png b/doc/unirec/folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/doc/unirec/folderclosed.png differ diff --git a/doc/unirec/folderopen.png b/doc/unirec/folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/doc/unirec/folderopen.png differ diff --git a/doc/unirec/functions.html b/doc/unirec/functions.html new file mode 100644 index 00000000..559ea982 --- /dev/null +++ b/doc/unirec/functions.html @@ -0,0 +1,296 @@ + + + + + + + +UniRec: Data Fields + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+
+ + + + diff --git a/doc/unirec/functions_func.html b/doc/unirec/functions_func.html new file mode 100644 index 00000000..4a7557a8 --- /dev/null +++ b/doc/unirec/functions_func.html @@ -0,0 +1,99 @@ + + + + + + + +UniRec: Data Fields - Functions + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.2.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/unirec/functions_vars.html b/doc/unirec/functions_vars.html new file mode 100644 index 00000000..2010a6b7 --- /dev/null +++ b/doc/unirec/functions_vars.html @@ -0,0 +1,296 @@ + + + + + + + +UniRec: Data Fields - Variables + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+
+ + + + diff --git a/doc/unirec/globals.html b/doc/unirec/globals.html new file mode 100644 index 00000000..ab48d50d --- /dev/null +++ b/doc/unirec/globals.html @@ -0,0 +1,95 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- _ -

+
+ + + + diff --git a/doc/unirec/globals_a.html b/doc/unirec/globals_a.html new file mode 100644 index 00000000..9f8912c6 --- /dev/null +++ b/doc/unirec/globals_a.html @@ -0,0 +1,84 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- a -

+
+ + + + diff --git a/doc/unirec/globals_b.html b/doc/unirec/globals_b.html new file mode 100644 index 00000000..4434c0fc --- /dev/null +++ b/doc/unirec/globals_b.html @@ -0,0 +1,86 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- b -

+
+ + + + diff --git a/doc/unirec/globals_c.html b/doc/unirec/globals_c.html new file mode 100644 index 00000000..040703b4 --- /dev/null +++ b/doc/unirec/globals_c.html @@ -0,0 +1,100 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- c -

+
+ + + + diff --git a/doc/unirec/globals_d.html b/doc/unirec/globals_d.html new file mode 100644 index 00000000..8631d775 --- /dev/null +++ b/doc/unirec/globals_d.html @@ -0,0 +1,88 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- d -

+
+ + + + diff --git a/doc/unirec/globals_defs.html b/doc/unirec/globals_defs.html new file mode 100644 index 00000000..374cc0c1 --- /dev/null +++ b/doc/unirec/globals_defs.html @@ -0,0 +1,560 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- _ -

+ + +

- c -

+ + +

- d -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+
+ + + + diff --git a/doc/unirec/globals_enum.html b/doc/unirec/globals_enum.html new file mode 100644 index 00000000..fbd02d30 --- /dev/null +++ b/doc/unirec/globals_enum.html @@ -0,0 +1,81 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/unirec/globals_eval.html b/doc/unirec/globals_eval.html new file mode 100644 index 00000000..848dfbc2 --- /dev/null +++ b/doc/unirec/globals_eval.html @@ -0,0 +1,176 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- u -

+
+ + + + diff --git a/doc/unirec/globals_f.html b/doc/unirec/globals_f.html new file mode 100644 index 00000000..a42347a5 --- /dev/null +++ b/doc/unirec/globals_f.html @@ -0,0 +1,88 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- f -

+
+ + + + diff --git a/doc/unirec/globals_func.html b/doc/unirec/globals_func.html new file mode 100644 index 00000000..65cf8bfc --- /dev/null +++ b/doc/unirec/globals_func.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- _ -

+
+ + + + diff --git a/doc/unirec/globals_func_a.html b/doc/unirec/globals_func_a.html new file mode 100644 index 00000000..928c324e --- /dev/null +++ b/doc/unirec/globals_func_a.html @@ -0,0 +1,81 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- a -

+
+ + + + diff --git a/doc/unirec/globals_func_b.html b/doc/unirec/globals_func_b.html new file mode 100644 index 00000000..1dc19b8e --- /dev/null +++ b/doc/unirec/globals_func_b.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- b -

+
+ + + + diff --git a/doc/unirec/globals_func_c.html b/doc/unirec/globals_func_c.html new file mode 100644 index 00000000..d0999345 --- /dev/null +++ b/doc/unirec/globals_func_c.html @@ -0,0 +1,97 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- c -

+
+ + + + diff --git a/doc/unirec/globals_func_d.html b/doc/unirec/globals_func_d.html new file mode 100644 index 00000000..37491b7a --- /dev/null +++ b/doc/unirec/globals_func_d.html @@ -0,0 +1,85 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- d -

+
+ + + + diff --git a/doc/unirec/globals_func_f.html b/doc/unirec/globals_func_f.html new file mode 100644 index 00000000..99284ab6 --- /dev/null +++ b/doc/unirec/globals_func_f.html @@ -0,0 +1,88 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- f -

+
+ + + + diff --git a/doc/unirec/globals_func_i.html b/doc/unirec/globals_func_i.html new file mode 100644 index 00000000..abe813b7 --- /dev/null +++ b/doc/unirec/globals_func_i.html @@ -0,0 +1,159 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- i -

+
+ + + + diff --git a/doc/unirec/globals_func_m.html b/doc/unirec/globals_func_m.html new file mode 100644 index 00000000..47a84d80 --- /dev/null +++ b/doc/unirec/globals_func_m.html @@ -0,0 +1,104 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- m -

+
+ + + + diff --git a/doc/unirec/globals_func_n.html b/doc/unirec/globals_func_n.html new file mode 100644 index 00000000..fe4daf87 --- /dev/null +++ b/doc/unirec/globals_func_n.html @@ -0,0 +1,85 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- n -

+
+ + + + diff --git a/doc/unirec/globals_func_p.html b/doc/unirec/globals_func_p.html new file mode 100644 index 00000000..fa5acf68 --- /dev/null +++ b/doc/unirec/globals_func_p.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- p -

+
+ + + + diff --git a/doc/unirec/globals_func_u.html b/doc/unirec/globals_func_u.html new file mode 100644 index 00000000..6f9de895 --- /dev/null +++ b/doc/unirec/globals_func_u.html @@ -0,0 +1,318 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+  + +

- u -

+
+ + + + diff --git a/doc/unirec/globals_h.html b/doc/unirec/globals_h.html new file mode 100644 index 00000000..79b679c1 --- /dev/null +++ b/doc/unirec/globals_h.html @@ -0,0 +1,140 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- h -

+
+ + + + diff --git a/doc/unirec/globals_i.html b/doc/unirec/globals_i.html new file mode 100644 index 00000000..9ced29b3 --- /dev/null +++ b/doc/unirec/globals_i.html @@ -0,0 +1,165 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- i -

+
+ + + + diff --git a/doc/unirec/globals_l.html b/doc/unirec/globals_l.html new file mode 100644 index 00000000..a500cbfd --- /dev/null +++ b/doc/unirec/globals_l.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- l -

+
+ + + + diff --git a/doc/unirec/globals_m.html b/doc/unirec/globals_m.html new file mode 100644 index 00000000..14d1ade4 --- /dev/null +++ b/doc/unirec/globals_m.html @@ -0,0 +1,119 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- m -

+
+ + + + diff --git a/doc/unirec/globals_n.html b/doc/unirec/globals_n.html new file mode 100644 index 00000000..36e62052 --- /dev/null +++ b/doc/unirec/globals_n.html @@ -0,0 +1,91 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- n -

+
+ + + + diff --git a/doc/unirec/globals_o.html b/doc/unirec/globals_o.html new file mode 100644 index 00000000..44d02331 --- /dev/null +++ b/doc/unirec/globals_o.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.2.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- o -

+
+ + + + diff --git a/doc/unirec/globals_p.html b/doc/unirec/globals_p.html new file mode 100644 index 00000000..a1360c56 --- /dev/null +++ b/doc/unirec/globals_p.html @@ -0,0 +1,104 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- p -

+
+ + + + diff --git a/doc/unirec/globals_r.html b/doc/unirec/globals_r.html new file mode 100644 index 00000000..2ede166e --- /dev/null +++ b/doc/unirec/globals_r.html @@ -0,0 +1,83 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- r -

+
+ + + + diff --git a/doc/unirec/globals_s.html b/doc/unirec/globals_s.html new file mode 100644 index 00000000..7bb9d8c5 --- /dev/null +++ b/doc/unirec/globals_s.html @@ -0,0 +1,83 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- s -

+
+ + + + diff --git a/doc/unirec/globals_t.html b/doc/unirec/globals_t.html new file mode 100644 index 00000000..da744559 --- /dev/null +++ b/doc/unirec/globals_t.html @@ -0,0 +1,92 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- t -

+
+ + + + diff --git a/doc/unirec/globals_type.html b/doc/unirec/globals_type.html new file mode 100644 index 00000000..d5f1bd4e --- /dev/null +++ b/doc/unirec/globals_type.html @@ -0,0 +1,84 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/unirec/globals_u.html b/doc/unirec/globals_u.html new file mode 100644 index 00000000..3c8503fc --- /dev/null +++ b/doc/unirec/globals_u.html @@ -0,0 +1,735 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- u -

+
+ + + + diff --git a/doc/unirec/globals_v.html b/doc/unirec/globals_v.html new file mode 100644 index 00000000..c5e7cc90 --- /dev/null +++ b/doc/unirec/globals_v.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- v -

+
+ + + + diff --git a/doc/unirec/globals_vars.html b/doc/unirec/globals_vars.html new file mode 100644 index 00000000..971eb9cf --- /dev/null +++ b/doc/unirec/globals_vars.html @@ -0,0 +1,128 @@ + + + + + + + +UniRec: Globals + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/unirec/group__libtraphelpers.html b/doc/unirec/group__libtraphelpers.html new file mode 100644 index 00000000..ea42c9e1 --- /dev/null +++ b/doc/unirec/group__libtraphelpers.html @@ -0,0 +1,210 @@ + + + + + + + +UniRec: Helpers for libtrap + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Helpers for libtrap
+
+
+ + + + + + + + +

+Macros

#define TRAP_RECEIVE(ifc_num, data, data_size, tmplt)   TRAP_CTX_RECEIVE(trap_get_global_ctx(), ifc_num, data, data_size, tmplt);
 Receive data from interface Receive data with specified template from libtrap interface. If the receiving template is subset of sending template, it will define new fields and expand receiving template. More...
 
#define TRAP_CTX_RECEIVE(ctx, ifc_num, data, data_size, tmplt)
 Receive data from interface with given context Receive data with specified template from libtrap interface with specified context. If the receiving template is subset of sending template, it will define new fields and expand receiving template. More...
 
+

Detailed Description

+

This module defines useful macros for handling data receive. When data format is changed, these macros create new UniRec template.

+

Macro Definition Documentation

+ +

◆ TRAP_CTX_RECEIVE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_CTX_RECEIVE( ctx,
 ifc_num,
 data,
 data_size,
 tmplt 
)
+
+Value:
__extension__ \
({\
int ret = trap_ctx_recv(ctx, ifc_num, &data, &data_size);\
if (ret == TRAP_E_FORMAT_CHANGED) {\
const char *spec = NULL;\
uint8_t data_fmt;\
if (trap_ctx_get_data_fmt(ctx, TRAPIFC_INPUT, ifc_num, &data_fmt, &spec) != TRAP_E_OK) {\
fprintf(stderr, "Data format was not loaded.\n");\
} else {\
tmplt = ur_define_fields_and_update_template(spec, tmplt);\
if (tmplt == NULL) {\
fprintf(stderr, "Template could not be edited.\n");\
} else {\
if (tmplt->direction == UR_TMPLT_DIRECTION_BI) {\
char * spec_cpy = ur_cpy_string(spec);\
if (spec_cpy == NULL) {\
fprintf(stderr, "Memory allocation problem.\n");\
} else {\
trap_ctx_set_data_fmt(ctx, tmplt->ifc_out, TRAP_FMT_UNIREC, spec_cpy);\
}\
}\
}\
}\
}\
ret;\
})
char * ur_cpy_string(const char *str)
Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user.
Definition: unirec.c:1655
+
bidirection
Definition: unirec.h:133
+
ur_template_t * ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt)
Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields)...
Definition: unirec.c:610
+
+

Receive data from interface with given context Receive data with specified template from libtrap interface with specified context. If the receiving template is subset of sending template, it will define new fields and expand receiving template.

+
Parameters
+ + + + + + +
[in]ctxcontext
[in]ifc_numindex of libtrap interface
[in]datapointer to memory where the data will be stored
[in]data_sizesize of allocated space for data
[in]tmpltpointer to input template
+
+
+
Returns
return value of trap_ctx_recv
+ +

Definition at line 233 of file unirec.h.

+ +
+
+ +

◆ TRAP_RECEIVE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define TRAP_RECEIVE( ifc_num,
 data,
 data_size,
 tmplt 
)   TRAP_CTX_RECEIVE(trap_get_global_ctx(), ifc_num, data, data_size, tmplt);
+
+ +

Receive data from interface Receive data with specified template from libtrap interface. If the receiving template is subset of sending template, it will define new fields and expand receiving template.

+
Parameters
+ + + + + +
[in]ifc_numindex of libtrap interface
[in]datapointer to memory where the data will be stored
[in]data_sizesize of allocated space for data
[in]tmpltpointer to input template
+
+
+
Returns
return value of trap_recv
+ +

Definition at line 219 of file unirec.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__unirec2csv.html b/doc/unirec/group__unirec2csv.html new file mode 100644 index 00000000..ce1b85fc --- /dev/null +++ b/doc/unirec/group__unirec2csv.html @@ -0,0 +1,359 @@ + + + + + + + +UniRec: CSV representation + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
CSV representation
+
+
+ + + + +

+Data Structures

struct  urcsv_t
 
+ + + + + + + + + + + +

+Functions

urcsv_turcsv_init (ur_template_t *tmplt, char delimiter)
 
void urcsv_free (urcsv_t **urcsv)
 
char * urcsv_header (urcsv_t *urcsv)
 
char * urcsv_record (urcsv_t *urcsv, const void *rec)
 
int urcsv_field (char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
 
+

Detailed Description

+

Functions to convert UniRec template and data into CSV-like representation

+
urcsv_t *csv = urcsv_init(tmplt, ',');
char *str = urcsv_header(csv);
fprintf(stderr, "%s\n", str);
free(str);
str = urcsv_record(csv, rec);
fprintf(stderr, "%s\n", str);
free(str);
urcsv_free(&csv);

Data Structure Documentation

+ +

◆ urcsv_t

+ +
+
+ + + + +
struct urcsv_t
+
+

Internal structure used by urcsv_init(), urcsv_free(), urcsv_header(), urcsv_record()

+ +

Definition at line 47 of file unirec2csv.h.

+
+ + + + + + + + + + + + + + + + + + + +
Data Fields
+char * +buffer +

Internal string buffer, allocated to buffer_size bytes

+
+uint32_t +buffer_size +

Current size of allocated memory for buffer

+
+char * +curpos +

Internal position in the buffer to write next string

+
+char +delimiter +

Delimiter that is put between columns

+
+uint32_t +free_space +

Current free bytes in the buffer

+
+ur_template_t * +tmplt +

UniRec template associated with this conversion

+
+ +
+
+

Function Documentation

+ +

◆ urcsv_field()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int urcsv_field (char * dst,
uint32_t size,
const void * rec,
ur_field_type_t id,
ur_template_ttmplt 
)
+
+

Convert value of UniRec field to its string representation.

+
Parameters
+ + + + + + +
[out]dstPointer to memory where to store result (pointer is not moved)
[in]sizeSize of available memory for result
[in]recUniRec record - value of the field is taken
[in]idUniRec field id
[in]tmpltUniRec template
+
+
+
Returns
Number of written bytes. If 0, there was not enough space and caller must increase the memory size.
+ +

Definition at line 129 of file unirec2csv.c.

+ +
+
+ +

◆ urcsv_free()

+ +
+
+ + + + + + + + +
void urcsv_free (urcsv_t ** urcsv)
+
+

Destructor for urcsv_t

+

The funtion deallocates internal memory and urcsv, the pointer is set to NULL.

Parameters
+ + +
[in,out]urcsvAddress of pointer to structure allocated by urcsv_init(), it will be set to NULL.
+
+
+ +

Definition at line 28 of file unirec2csv.c.

+ +
+
+ +

◆ urcsv_header()

+ +
+
+ + + + + + + + +
char* urcsv_header (urcsv_turcsv)
+
+

Create a header line

+

The funtion creates a text representation of header according to template

Parameters
+ + +
[in,out]urcsvPointer to structure allocated by urcsv_init().
+
+
+
Returns
Pointer to string, caller must free it
+ +

Definition at line 37 of file unirec2csv.c.

+ +
+
+ +

◆ urcsv_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
urcsv_t* urcsv_init (ur_template_ttmplt,
char delimiter 
)
+
+

Constructor for urcsv_t

+

The function initializes struct for urcsv_header() and urcsv_record().

+
Parameters
+ + + +
[in]tmpltUniRec template that will be used to access fields of the records
[in]delimiterDelimiter that will be used to separate columns of output
+
+
+
Returns
Pointer to newly allocated and initialized structure
+ +

Definition at line 7 of file unirec2csv.c.

+ +
+
+ +

◆ urcsv_record()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char* urcsv_record (urcsv_turcsv,
const void * rec 
)
+
+

Create a record line

+

The funtion creates a text representation of UniRec record

Parameters
+ + + +
[in,out]urcsvPointer to structure allocated by urcsv_init().
[in]recPointer to data - UniRec message
+
+
+
Returns
Pointer to string, caller must free it
+ +

Definition at line 209 of file unirec2csv.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__ur__ipaddr.html b/doc/unirec/group__ur__ipaddr.html new file mode 100644 index 00000000..4dfef965 --- /dev/null +++ b/doc/unirec/group__ur__ipaddr.html @@ -0,0 +1,572 @@ + + + + + + + +unirec: IP addresses API + + + + + + + + + +
+
+ + + + + + +
+
unirec +  2.2.5 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
IP addresses API
+
+
+ + + + +

+Data Structures

union  ip_addr_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

INLINE int ip_is4 (const ip_addr_t *addr)
 
INLINE int ip_is6 (const ip_addr_t *addr)
 
INLINE uint32_t ip_get_v4_as_int (ip_addr_t *addr)
 
INLINE char * ip_get_v4_as_bytes (const ip_addr_t *addr)
 
INLINE ip_addr_t ip_from_int (uint32_t i)
 
INLINE ip_addr_t ip_from_4_bytes_be (char b[4])
 
INLINE ip_addr_t ip_from_4_bytes_le (char b[4])
 
INLINE ip_addr_t ip_from_16_bytes_be (char b[16])
 
INLINE ip_addr_t ip_from_16_bytes_le (char b[16])
 
INLINE int ip_cmp (const ip_addr_t *addr1, const ip_addr_t *addr2)
 
INLINE int ip_is_null (const ip_addr_t *addr)
 
INLINE int ip_from_str (const char *str, ip_addr_t *addr)
 
INLINE void ip_to_str (const ip_addr_t *addr, char *str)
 
+

Detailed Description

+
Structure and functions to handle generic IP addresses (IPv4 or IPv6). IP addresses are stored on 128 bits. IPv6 addresses are stored directly. IPv4 addresses are converted to 128 bit is this way:

0000:0000:0000:0000:<ipv4_addr>:ffff:ffff

No valid IPv6 address should look like this so it's possible to determine IP address version without explicitly storing any flag.Addresses are stored in big endian (network byte order).This implementation assumes the platform uses little endian (true for x86 architectures).

Layout of ip_addr_t union:
MSB LSB
xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
| i64[0] | i64[1] |
| i32[0] | i32[1] | i32[2] | i32[3] |
|bytes[0] ... ... bytes[15]|

Data Structure Documentation

+ +

◆ ip_addr_t

+ +
+
+ + + + +
union ip_addr_t
+
+

IP address data type.

+

It is 128b data type. User can access to parts of the IP address in several ways.

+ +

Definition at line 101 of file ipaddr.h.

+
+ + + + + + + + + + + + + + + + +
Data Fields
+uint8_t +bytes[16] +

16x 8b numbers

+
+uint16_t +ui16[8] +

8x 16b numbers

+
+uint32_t +ui32[4] +

4x 32b numbers

+
+uint64_t +ui64[2] +

2x 64b numbers

+
+uint8_t +ui8[16] +

same as bytes

+
+ +
+
+

Function Documentation

+ +

◆ ip_cmp()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ip_cmp (const ip_addr_taddr1,
const ip_addr_taddr2 
)
+
+

Compare two IP addresses.

+
Parameters
+ + + +
[in]addr1IP address as ip_addr_t
[in]addr2IP address as ip_addr_t
+
+
+
Returns
Positive number (>0) if addr1 > addr2, negative number (<0) if addr1 < addr2, and zero (=0) if addr1 == addr2.
+ +

Definition at line 266 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_16_bytes_be()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_16_bytes_be (char b[16])
+
+

Convert 16B array (in network byte order) into IPv6 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b16 bytes array in network byte order for conversion.
+
+
+
Returns
IPv6 address stored as ip_addr_t.
+ +

Definition at line 236 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_16_bytes_le()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_16_bytes_le (char b[16])
+
+

Convert 16B array (in little-endian byte order) into IPv6 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b16 bytes array in little-endian byte order for conversion.
+
+
+
Returns
IPv6 address stored as ip_addr_t.
+ +

Definition at line 249 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_4_bytes_be()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_4_bytes_be (char b[4])
+
+

Convert 4B array (in network byte order) into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b4 bytes array in network byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+
See also
ip_from_int()
+ +

Definition at line 199 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_4_bytes_le()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_4_bytes_le (char b[4])
+
+

Convert 4B array (in little-endian byte order) into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b4 bytes array in little-endian byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+
See also
ip_from_int()
+ +

Definition at line 218 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_int()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_int (uint32_t i)
+
+

Convert 32b number into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]i32b number in host byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+ +

Definition at line 183 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ip_from_str (const char * str,
ip_addr_taddr 
)
+
+

Convert string into ip_addr_t.

+
Parameters
+ + + +
[in]strString for conversion.
[out]addrPointer to memory where to store converted IP address.
+
+
+
Returns
1 on success, 0 on error i.e. string is not a valid IP address.
+ +

Definition at line 301 of file ipaddr.h.

+ +
+
+ +

◆ ip_get_v4_as_bytes()

+ +
+
+ + + + + + + + +
INLINE char* ip_get_v4_as_bytes (const ip_addr_taddr)
+
+

Get pointer to byte array of IPv4 address.

+

The function returns pointer to the first byte of IP address data structure. Data is in network byte order.

+
Parameters
+ + +
[in]addrIP address for conversion.
+
+
+
Returns
Pointer to the first byte of IPv4 address.
+ +

Definition at line 171 of file ipaddr.h.

+ +
+
+ +

◆ ip_get_v4_as_int()

+ +
+
+ + + + + + + + +
INLINE uint32_t ip_get_v4_as_int (ip_addr_taddr)
+
+

Get IPv4 address as one 32b number.

+

The function takes the appropriate 32b part of ip_addr_t and converts it into host byte order.

+
Parameters
+ + +
[in]addrIP address for conversion.
+
+
+
Returns
IP address as one 32b number in host byte order.
+ +

Definition at line 157 of file ipaddr.h.

+ +
+
+ +

◆ ip_is4()

+ +
+
+ + + + + + + + +
INLINE int ip_is4 (const ip_addr_taddr)
+
+

Check if the address is IPv4.

+
Parameters
+ + +
[in]addrIP address that is checked.
+
+
+
Returns
1 if the address is IPv4, 0 otherwise.
+ +

Definition at line 131 of file ipaddr.h.

+ +
+
+ +

◆ ip_is6()

+ +
+
+ + + + + + + + +
INLINE int ip_is6 (const ip_addr_taddr)
+
+

Check if the address is IPv6.

+
Parameters
+ + +
[in]addrIP address that is checked.
+
+
+
Returns
1 if the address is IPv6, 0 otherwise.
+
Note
It is a negation of ip_is4().
+ +

Definition at line 143 of file ipaddr.h.

+ +
+
+ +

◆ ip_is_null()

+ +
+
+ + + + + + + + +
INLINE int ip_is_null (const ip_addr_taddr)
+
+

Check if IP address is NULL/invalid/unspecified?

+

There are two variants being used as invalid/unspecified address:

00000000 00000000 00000000 ffffffff (i.e. "0.0.0.0", zero IPv4)
00000000 00000000 00000000 00000000 (i.e. "::", zero IPv6)
Parameters
+ + +
[in]addrIP address to check.
+
+
+
Returns
1 if given address matches any of the ones above, otherwise returns 0.
+ +

Definition at line 283 of file ipaddr.h.

+ +
+
+ +

◆ ip_to_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE void ip_to_str (const ip_addr_taddr,
char * str 
)
+
+

Convert ip_addr_t into string.

+
Parameters
+ + + +
[in]addrPointer to IP address.
[out]strPointer to memory where to store converted IP address. It must be of at least INET6_ADDRSTRLEN size.
+
+
+ +

Definition at line 325 of file ipaddr.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__ur__links.html b/doc/unirec/group__ur__links.html new file mode 100644 index 00000000..53587cc8 --- /dev/null +++ b/doc/unirec/group__ur__links.html @@ -0,0 +1,364 @@ + + + + + + + +unirec: Links API + + + + + + + + + +
+
+ + + + + + +
+
unirec +  2.2.5 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Links API
+
+
+ + + + + +

+Data Structures

+ + + +

+Macros

#define MAX_LINK_COUNT   64
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

ur_links_tur_create_links (const char *mask)
 Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links. More...
 
void ur_free_links (ur_links_t *links)
 Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links. More...
 
INLINE int ur_get_link_index (ur_links_t *links, uint64_t link_bit_field)
 Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found. More...
 
INLINE uint64_t ur_get_link_bit_field_position (ur_links_t *links, unsigned int index)
 Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed. More...
 
INLINE uint64_t ur_get_link_mask (ur_links_t *links)
 Get link mask. More...
 
INLINE unsigned int ur_get_link_count (ur_links_t *links)
 Get link count. More...
 
+

Detailed Description

+

Data Structure Documentation

+ +

◆ ur_links_t

+ +
+
+ + + + +
struct ur_links_t
+
+

Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n).

+ +

Definition at line 70 of file links.h.

+
+ + + + + + + + + + +
Data Fields
+unsigned int +link_count +
+uint64_t * +link_indexes +
+uint64_t +link_mask +
+ +
+
+

Macro Definition Documentation

+ +

◆ MAX_LINK_COUNT

+ +
+
+ + + + +
#define MAX_LINK_COUNT   64
+
+ +

Definition at line 64 of file links.h.

+ +
+
+

Function Documentation

+ +

◆ ur_create_links()

+ +
+
+ + + + + + + + +
ur_links_t* ur_create_links (const char * mask)
+
+ +

Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links.

+
Parameters
+ + +
[in]maskString with link mask in hexadecimal format.
+
+
+
Returns
Pointer to newly created links structure or NULL on error.
+ +

Definition at line 1367 of file unirec.c.

+ +
+
+ +

◆ ur_free_links()

+ +
+
+ + + + + + + + +
void ur_free_links (ur_links_tlinks)
+
+ +

Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+ +

Definition at line 1419 of file unirec.c.

+ +
+
+ +

◆ ur_get_link_bit_field_position()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE uint64_t ur_get_link_bit_field_position (ur_links_tlinks,
unsigned int index 
)
+
+ +

Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed.

+
Parameters
+ + + +
[in]linksPointer to the links structure.
[in]indexIndex of link from interval 0 - (link_count-1).
+
+
+
Returns
Position in link_bit_field.
+ +

Definition at line 124 of file links.h.

+ +
+
+ +

◆ ur_get_link_count()

+ +
+
+ + + + + + + + +
INLINE unsigned int ur_get_link_count (ur_links_tlinks)
+
+ +

Get link count.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+
Returns
Count of used links.
+ +

Definition at line 147 of file links.h.

+ +
+
+ +

◆ ur_get_link_index()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ur_get_link_index (ur_links_tlinks,
uint64_t link_bit_field 
)
+
+ +

Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found.

+
Parameters
+ + + +
[in]linksPointer to the links structure.
[in]link_bit_fieldLink bit field of given link.
+
+
+
Returns
Index of given link from interval 0 - (link_count-1).
+ +

Definition at line 103 of file links.h.

+ +
+
+ +

◆ ur_get_link_mask()

+ +
+
+ + + + + + + + +
INLINE uint64_t ur_get_link_mask (ur_links_tlinks)
+
+ +

Get link mask.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+
Returns
Link mask in 64bit unsigned int.
+ +

Definition at line 138 of file links.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__ur__time.html b/doc/unirec/group__ur__time.html new file mode 100644 index 00000000..fe103954 --- /dev/null +++ b/doc/unirec/group__ur__time.html @@ -0,0 +1,253 @@ + + + + + + + +unirec: Timestamps API + + + + + + + + + +
+
+ + + + + + +
+
unirec +  2.2.5 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Timestamps API
+
+
+ + + + + + + + + + + + + + + +

+Macros

#define UR_TIME_MSEC_TO_FRAC   0x4189374BC6A7EFULL
 
#define UR_TIME_FRAC_TO_MSEC   0x03E9ULL
 
#define ur_time_from_sec_msec(sec, msec)   (ur_time_t)( ((uint64_t)(sec) << 32) | (((uint64_t)(msec)*UR_TIME_MSEC_TO_FRAC) >> 32) )
 Convert seconds and milliseconds to ur_time_t. More...
 
#define ur_time_get_sec(time)   (uint32_t)((uint64_t)(time) >> 32)
 Get number of seconds from ur_time_t. More...
 
#define ur_time_get_msec(time)   (uint32_t)((((uint64_t)(time) & 0xffffffff) * UR_TIME_FRAC_TO_MSEC) >> 32)
 Get number of milliseconds from ur_time_t. More...
 
+ + + + +

+Typedefs

typedef uint64_t ur_time_t
 Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoch in 64bit fixed point number (32bit integral part, 32bit fraction part). More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ UR_TIME_FRAC_TO_MSEC

+ +
+
+ + + + +
#define UR_TIME_FRAC_TO_MSEC   0x03E9ULL
+
+

Constant used to convert fraction of second on 32 bits to milliseconds. Its value is 1000 / 2^32 in fixed-point notation.

+ +

Definition at line 71 of file ur_time.h.

+ +
+
+ +

◆ ur_time_from_sec_msec

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_time_from_sec_msec( sec,
 msec 
)   (ur_time_t)( ((uint64_t)(sec) << 32) | (((uint64_t)(msec)*UR_TIME_MSEC_TO_FRAC) >> 32) )
+
+ +

Convert seconds and milliseconds to ur_time_t.

+
Parameters
+ + + +
secseconds
msecmilliseconds
+
+
+
Returns
UniRec timestamp (ur_time_t)
+ +

Definition at line 79 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_msec

+ +
+
+ + + + + + + + +
#define ur_time_get_msec( time)   (uint32_t)((((uint64_t)(time) & 0xffffffff) * UR_TIME_FRAC_TO_MSEC) >> 32)
+
+ +

Get number of milliseconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
milliseconds
+ +

Definition at line 95 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_sec

+ +
+
+ + + + + + + + +
#define ur_time_get_sec( time)   (uint32_t)((uint64_t)(time) >> 32)
+
+ +

Get number of seconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
seconds
+ +

Definition at line 87 of file ur_time.h.

+ +
+
+ +

◆ UR_TIME_MSEC_TO_FRAC

+ +
+
+ + + + +
#define UR_TIME_MSEC_TO_FRAC   0x4189374BC6A7EFULL
+
+

Constant used to convert milliseconds to fraction of second on 32 bits. Its values is 2^32 / 1000 in fixed-point notation.

+ +

Definition at line 66 of file ur_time.h.

+ +
+
+

Typedef Documentation

+ +

◆ ur_time_t

+ +
+
+ + + + +
typedef uint64_t ur_time_t
+
+ +

Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoch in 64bit fixed point number (32bit integral part, 32bit fraction part).

+ +

Definition at line 61 of file ur_time.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__uripaddr.html b/doc/unirec/group__uripaddr.html new file mode 100644 index 00000000..1e97886b --- /dev/null +++ b/doc/unirec/group__uripaddr.html @@ -0,0 +1,575 @@ + + + + + + + +UniRec: IP addresses API + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
IP addresses API
+
+
+ + + + +

+Data Structures

union  ip_addr_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

INLINE int ip_is4 (const ip_addr_t *addr)
 
INLINE int ip_is6 (const ip_addr_t *addr)
 
INLINE uint32_t ip_get_v4_as_int (ip_addr_t *addr)
 
INLINE char * ip_get_v4_as_bytes (const ip_addr_t *addr)
 
INLINE ip_addr_t ip_from_int (uint32_t i)
 
INLINE ip_addr_t ip_from_4_bytes_be (char b[4])
 
INLINE ip_addr_t ip_from_4_bytes_le (char b[4])
 
INLINE ip_addr_t ip_from_16_bytes_be (char b[16])
 
INLINE ip_addr_t ip_from_16_bytes_le (char b[16])
 
INLINE int ip_cmp (const ip_addr_t *addr1, const ip_addr_t *addr2)
 
INLINE int ip_is_null (const ip_addr_t *addr)
 
INLINE int ip_from_str (const char *str, ip_addr_t *addr)
 
INLINE void ip_to_str (const ip_addr_t *addr, char *str)
 
+

Detailed Description

+
Structure and functions to handle generic IP addresses (IPv4 or IPv6). IP addresses are stored on 128 bits. IPv6 addresses are stored directly. IPv4 addresses are converted to 128 bit is this way:

0000:0000:0000:0000:<ipv4_addr>:ffff:ffff

No valid IPv6 address should look like this so it's possible to determine IP address version without explicitly storing any flag.Addresses are stored in big endian (network byte order).This implementation assumes the platform uses little endian (true for x86 architectures).

Layout of ip_addr_t union:
MSB LSB
xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
| i64[0] | i64[1] |
| i32[0] | i32[1] | i32[2] | i32[3] |
|bytes[0] ... ... bytes[15]|

Data Structure Documentation

+ +

◆ ip_addr_t

+ +
+
+ + + + +
union ip_addr_t
+
+

IP address data type.

+

It is 128b data type. User can access to parts of the IP address in several ways.

+ +

Definition at line 101 of file ipaddr.h.

+
+ + + + + + + + + + + + + + + + +
Data Fields
+uint8_t +bytes[16] +

16x 8b numbers

+
+uint16_t +ui16[8] +

8x 16b numbers

+
+uint32_t +ui32[4] +

4x 32b numbers

+
+uint64_t +ui64[2] +

2x 64b numbers

+
+uint8_t +ui8[16] +

same as bytes

+
+ +
+
+

Function Documentation

+ +

◆ ip_cmp()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ip_cmp (const ip_addr_taddr1,
const ip_addr_taddr2 
)
+
+

Compare two IP addresses.

+
Parameters
+ + + +
[in]addr1IP address as ip_addr_t
[in]addr2IP address as ip_addr_t
+
+
+
Returns
Positive number (>0) if addr1 > addr2, negative number (<0) if addr1 < addr2, and zero (=0) if addr1 == addr2.
+ +

Definition at line 266 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_16_bytes_be()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_16_bytes_be (char b[16])
+
+

Convert 16B array (in network byte order) into IPv6 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b16 bytes array in network byte order for conversion.
+
+
+
Returns
IPv6 address stored as ip_addr_t.
+ +

Definition at line 236 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_16_bytes_le()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_16_bytes_le (char b[16])
+
+

Convert 16B array (in little-endian byte order) into IPv6 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b16 bytes array in little-endian byte order for conversion.
+
+
+
Returns
IPv6 address stored as ip_addr_t.
+ +

Definition at line 249 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_4_bytes_be()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_4_bytes_be (char b[4])
+
+

Convert 4B array (in network byte order) into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b4 bytes array in network byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+
See also
ip_from_int()
+ +

Definition at line 199 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_4_bytes_le()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_4_bytes_le (char b[4])
+
+

Convert 4B array (in little-endian byte order) into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]b4 bytes array in little-endian byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+
See also
ip_from_int()
+ +

Definition at line 218 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_int()

+ +
+
+ + + + + + + + +
INLINE ip_addr_t ip_from_int (uint32_t i)
+
+

Convert 32b number into IPv4 address encoded as ip_addr_t.

+
Parameters
+ + +
[in]i32b number in host byte order for conversion.
+
+
+
Returns
IPv4 address stored as ip_addr_t.
+ +

Definition at line 183 of file ipaddr.h.

+ +
+
+ +

◆ ip_from_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ip_from_str (const char * str,
ip_addr_taddr 
)
+
+

Convert string into ip_addr_t.

+
Parameters
+ + + +
[in]strString for conversion.
[out]addrPointer to memory where to store converted IP address.
+
+
+
Returns
1 on success, 0 on error i.e. string is not a valid IP address.
+ +

Definition at line 301 of file ipaddr.h.

+ +
+
+ +

◆ ip_get_v4_as_bytes()

+ +
+
+ + + + + + + + +
INLINE char* ip_get_v4_as_bytes (const ip_addr_taddr)
+
+

Get pointer to byte array of IPv4 address.

+

The function returns pointer to the first byte of IP address data structure. Data is in network byte order.

+
Parameters
+ + +
[in]addrIP address for conversion.
+
+
+
Returns
Pointer to the first byte of IPv4 address.
+ +

Definition at line 171 of file ipaddr.h.

+ +
+
+ +

◆ ip_get_v4_as_int()

+ +
+
+ + + + + + + + +
INLINE uint32_t ip_get_v4_as_int (ip_addr_taddr)
+
+

Get IPv4 address as one 32b number.

+

The function takes the appropriate 32b part of ip_addr_t and converts it into host byte order.

+
Parameters
+ + +
[in]addrIP address for conversion.
+
+
+
Returns
IP address as one 32b number in host byte order.
+ +

Definition at line 157 of file ipaddr.h.

+ +
+
+ +

◆ ip_is4()

+ +
+
+ + + + + + + + +
INLINE int ip_is4 (const ip_addr_taddr)
+
+

Check if the address is IPv4.

+
Parameters
+ + +
[in]addrIP address that is checked.
+
+
+
Returns
1 if the address is IPv4, 0 otherwise.
+ +

Definition at line 131 of file ipaddr.h.

+ +
+
+ +

◆ ip_is6()

+ +
+
+ + + + + + + + +
INLINE int ip_is6 (const ip_addr_taddr)
+
+

Check if the address is IPv6.

+
Parameters
+ + +
[in]addrIP address that is checked.
+
+
+
Returns
1 if the address is IPv6, 0 otherwise.
+
Note
It is a negation of ip_is4().
+ +

Definition at line 143 of file ipaddr.h.

+ +
+
+ +

◆ ip_is_null()

+ +
+
+ + + + + + + + +
INLINE int ip_is_null (const ip_addr_taddr)
+
+

Check if IP address is NULL/invalid/unspecified?

+

There are two variants being used as invalid/unspecified address:

00000000 00000000 00000000 ffffffff (i.e. "0.0.0.0", zero IPv4)
00000000 00000000 00000000 00000000 (i.e. "::", zero IPv6)
Parameters
+ + +
[in]addrIP address to check.
+
+
+
Returns
1 if given address matches any of the ones above, otherwise returns 0.
+ +

Definition at line 283 of file ipaddr.h.

+ +
+
+ +

◆ ip_to_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE void ip_to_str (const ip_addr_taddr,
char * str 
)
+
+

Convert ip_addr_t into string.

+
Parameters
+ + + +
[in]addrPointer to IP address.
[out]strPointer to memory where to store converted IP address. It must be of at least INET6_ADDRSTRLEN size.
+
+
+ +

Definition at line 325 of file ipaddr.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__urlinks.html b/doc/unirec/group__urlinks.html new file mode 100644 index 00000000..ffc843d5 --- /dev/null +++ b/doc/unirec/group__urlinks.html @@ -0,0 +1,367 @@ + + + + + + + +UniRec: Links API + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Links API
+
+
+ + + + + +

+Data Structures

+ + + +

+Macros

#define MAX_LINK_COUNT   64
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

ur_links_tur_create_links (const char *mask)
 Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links. More...
 
void ur_free_links (ur_links_t *links)
 Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links. More...
 
INLINE int ur_get_link_index (ur_links_t *links, uint64_t link_bit_field)
 Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found. More...
 
INLINE uint64_t ur_get_link_bit_field_position (ur_links_t *links, unsigned int index)
 Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed. More...
 
INLINE uint64_t ur_get_link_mask (ur_links_t *links)
 Get link mask. More...
 
INLINE unsigned int ur_get_link_count (ur_links_t *links)
 Get link count. More...
 
+

Detailed Description

+

Data Structure Documentation

+ +

◆ ur_links_t

+ +
+
+ + + + +
struct ur_links_t
+
+

Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n).

+ +

Definition at line 70 of file links.h.

+
+ + + + + + + + + + +
Data Fields
+unsigned int +link_count +
+uint64_t * +link_indexes +
+uint64_t +link_mask +
+ +
+
+

Macro Definition Documentation

+ +

◆ MAX_LINK_COUNT

+ +
+
+ + + + +
#define MAX_LINK_COUNT   64
+
+ +

Definition at line 64 of file links.h.

+ +
+
+

Function Documentation

+ +

◆ ur_create_links()

+ +
+
+ + + + + + + + +
ur_links_t* ur_create_links (const char * mask)
+
+ +

Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links.

+
Parameters
+ + +
[in]maskString with link mask in hexadecimal format.
+
+
+
Returns
Pointer to newly created links structure or NULL on error.
+ +

Definition at line 1689 of file unirec.c.

+ +
+
+ +

◆ ur_free_links()

+ +
+
+ + + + + + + + +
void ur_free_links (ur_links_tlinks)
+
+ +

Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+ +

Definition at line 1741 of file unirec.c.

+ +
+
+ +

◆ ur_get_link_bit_field_position()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE uint64_t ur_get_link_bit_field_position (ur_links_tlinks,
unsigned int index 
)
+
+ +

Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed.

+
Parameters
+ + + +
[in]linksPointer to the links structure.
[in]indexIndex of link from interval 0 - (link_count-1).
+
+
+
Returns
Position in link_bit_field.
+ +

Definition at line 124 of file links.h.

+ +
+
+ +

◆ ur_get_link_count()

+ +
+
+ + + + + + + + +
INLINE unsigned int ur_get_link_count (ur_links_tlinks)
+
+ +

Get link count.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+
Returns
Count of used links.
+ +

Definition at line 147 of file links.h.

+ +
+
+ +

◆ ur_get_link_index()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int ur_get_link_index (ur_links_tlinks,
uint64_t link_bit_field 
)
+
+ +

Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found.

+
Parameters
+ + + +
[in]linksPointer to the links structure.
[in]link_bit_fieldLink bit field of given link.
+
+
+
Returns
Index of given link from interval 0 - (link_count-1).
+ +

Definition at line 103 of file links.h.

+ +
+
+ +

◆ ur_get_link_mask()

+ +
+
+ + + + + + + + +
INLINE uint64_t ur_get_link_mask (ur_links_tlinks)
+
+ +

Get link mask.

+
Parameters
+ + +
[in]linksPointer to the links structure.
+
+
+
Returns
Link mask in 64bit unsigned int.
+ +

Definition at line 138 of file links.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__urtemplate.html b/doc/unirec/group__urtemplate.html new file mode 100644 index 00000000..121f5cd7 --- /dev/null +++ b/doc/unirec/group__urtemplate.html @@ -0,0 +1,3713 @@ + + + + + + + +UniRec: UniRec templates and fields + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
UniRec templates and fields
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define ur_template_string(tmplt)   ur_template_string_delimiter(tmplt, ',')
 Get string of a template Get names and sizes of fields separated by comma. Return string has to be freed by user. More...
 
#define ur_size_of(type)   ur_field_type_size[type]
 Get size of UniRec type Get size of fixed-length UniRec type. For variable-length type return value < 0. More...
 
#define ur_get_name(field_id)   ur_field_specs.ur_field_names[field_id]
 Get name of UniRec field Get name of any UniRec defined field. More...
 
#define ur_get_type(field_id)   ur_field_specs.ur_field_types[field_id]
 Get type of UniRec field Get type of any UniRec defined field. More...
 
#define ur_get_size(field_id)   ur_field_specs.ur_field_sizes[field_id]
 Get size of UniRec field Get size of a fixed-length UniRec field. When variable-length field is passed, return value < 0. To get real length of a variable-length field use ur_get_var_len. More...
 
#define ur_get(tmplt, data, field_id)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]))
 Get value of UniRec field Get value of a fixed-length UniRec field. For variable-length fields, use ur_get_ptr or ur_get_ptr_by_id. More...
 
#define ur_get_ptr(tmplt, data, field_id)
 Get pointer to UniRec field Get pointer to fixed or varible length statically defined UniRec field. For dynamically defined fields, use ur_get_ptr_by_id. More...
 
#define ur_get_ptr_by_id(tmplt, data, field_id)
 Get pointer to UniRec field Get pointer to fixed or varible length UniRec field. In contrast to ur_get_ptr, field_id may be a variable (not only F_ token). Returned pointer is always void *. More...
 
#define ur_set(tmplt, data, field_id, value)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]) = (value))
 Set value of UniRec (static) field Set value of a fixed-length UniRec field. For variable-length fields, use ur_set_var. More...
 
#define ur_get_var_offset(tmplt, rec, field_id)   *((uint16_t *)((char *) rec + tmplt->offset[field_id]))
 Get offset of variable-length field in the record. Get offset of a specified variable-length field in the record. Given field has to be part of the record. More...
 
#define ur_get_var_len(tmplt, rec, field_id)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2))
 Get size of a variable sized field in the record. Get size of a variable-length field in the record. Given field has to be part of the record. More...
 
#define ur_set_var_len(tmplt, rec, field_id, len)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2)) = (uint16_t) len
 Set size of variable-length field in the record. Set size of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record. More...
 
#define ur_set_var_offset(tmplt, rec, field_id, offset_val)   *((uint16_t *)((char *) rec + tmplt->offset[field_id])) = (uint16_t) offset_val
 Set offset of variable-length field in the record. Set offset of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record. More...
 
#define ur_get_len(tmplt, rec, field)   ur_is_static(field) ? ur_get_size(field) : ur_get_var_len(tmplt, rec, field)
 Get length of UniRec field Get actual length of fixed or variable-length UniRec field. More...
 
#define ur_set_string(tmplt, rec, field_id, str)   ur_set_var(tmplt, rec, field_id, str, strlen(str))
 Set variable-length field to given string. Set contents of a variable-length field in the record. Field has to be part of the record. It copies string terminated with \0 and safely moves other variable-length records. More...
 
#define ur_is_array(field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? 1 : 0)
 
#define ur_array_get_elem_size(field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? -ur_field_type_size[ur_get_type(field_id)] : ur_field_type_size[ur_get_type(field_id)])
 Get size of a single element of UniRec field. More...
 
#define ur_array_get_elem_cnt(tmplt, rec, field_id)   (ur_get_var_len(tmplt, rec, field_id) / ur_array_get_elem_size(field_id))
 Get number of elements stored in an UniRec array. More...
 
#define ur_array_get_elem_type(field_id)   ur_field_array_elem_type[ur_get_type(field_id)]
 Get type of an element stored in an UniRec array. More...
 
#define ur_array_set(tmplt, rec, field_id, index, element)
 Set element to array at given index. Automatically resizes array when index is out of array bounds. Set contents of a variable-length field in the record. Field has to be part of the record. More...
 
#define ur_array_append(tmplt, rec, field_id, element)
 Set element to array at last position. Automatically resizes array. More...
 
#define ur_array_clear(tmplt, rec, field_id)   ur_array_resize(tmplt, rec, field_id, 0)
 Clear contents of an UniRec array. Array is resized to 0 elements. More...
 
#define ur_array_get(tmplt, rec, field_id, index)   ((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index]
 Get element of an array field at given index. More...
 
#define ur_array_allocate(tmplt, rec, field_id, elem_cnt)   ur_array_resize(tmplt, rec, field_id, (elem_cnt) * ur_array_get_elem_size(field_id))
 Preallocates UniRec array field to have requested number of elements. More...
 
#define ur_is_present(tmplt, field_id)   ((tmplt)->offset_size > (field_id) && (tmplt)->offset[(field_id)] != UR_INVALID_OFFSET)
 Is given field present in given template? Return true (non-zero value) if given template contains field with given ID. More...
 
#define ur_is_varlen(field_id)   (ur_field_specs.ur_field_sizes[field_id] < 0)
 Is given field variable-length? Return true (non-zero value) if given ID refers to a field with variable length. More...
 
#define ur_is_dynamic(field_id)   ur_is_varlen(field_id)
 Alias for ur_is_varlen (for backwards compatibility only) More...
 
#define ur_is_fixlen(field_id)   (ur_field_specs.ur_field_sizes[field_id] >= 0)
 Is given field fixed-length? Return true (non-zero value) if given ID refers to a field with fixed length. More...
 
#define ur_is_static(field_id)   ur_is_fixlen(field_id)
 Alias for ur_is_fixlen (for backwards compatibility only) More...
 
#define ur_rec_fixlen_size(tmplt)   ((tmplt)->static_size)
 Get size of fixed-length part of UniRec record Get total size of UniRec record except variable-length fields. More...
 
#define ur_rec_size(tmplt, rec)   (ur_rec_fixlen_size(tmplt) + ur_rec_varlen_size(tmplt, rec))
 Get size of UniRec record (static and variable length) Get total size of whole UniRec record. More...
 
#define ur_create_input_template(ifc, fields, errstr)   ur_ctx_create_input_template(trap_get_global_ctx(), ifc, fields, errstr);
 Create UniRec template and set it to input interface Creates UniRec template (same like ur_create_template) and set this template to input interface of a module. More...
 
#define ur_create_output_template(ifc, fields, errstr)   ur_ctx_create_output_template(trap_get_global_ctx(), ifc, fields, errstr);
 Create UniRec template and set it to output interface Creates UniRec template (same like ur_create_template) and set this template to ouput interface of a module. More...
 
#define ur_set_output_template(ifc, tmplt)   ur_ctx_set_output_template(trap_get_global_ctx(), ifc, tmplt)
 Set UniRec template to ouput interface. More...
 
#define ur_set_input_template(ifc, tmplt)   ur_ctx_set_input_template(trap_get_global_ctx(), ifc, tmplt)
 Set UniRec template to input interface. More...
 
#define ur_create_bidirectional_template(ifc_in, ifc_out, fields, errstr)   ur_ctx_create_bidirectional_template(trap_get_global_ctx(), ifc_in, ifc_out, fields, errstr);
 Create UniRec template and set it to input and output interface Creates UniRec template (same like ur_create_template) and set this template to input and ouput interface of a module. More...
 
#define UR_MAX_SIZE   0xffff
 
#define ur_cpy(tmplt, src, dst)   (memcpy(dst,src,ur_rec_size(tmplt,src)))
 Copy data from one UniRec to another. Procedure gets template and void pointer of source and destination. Then it copies the data defined by the given template. The destination pointer must have required space allocated. More...
 
#define ur_values_get_name(field, value)   ur_values_get_name_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
 Returns name of specified value This function returns name of specified value and field, which is defined in values file. More...
 
#define ur_values_get_description(field, value)   ur_values_get_description_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
 Returns description of specified value This function returns description of specified value and field, which is defined in values file. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

char * ur_template_string_delimiter (const ur_template_t *tmplt, int delimiter)
 Get UniRec specifier of the tmplt template with delimiter between fields. More...
 
int ur_get_field_type_from_str (const char *type)
 
char * ur_array_append_get_ptr (const ur_template_t *tmplt, void *rec, int field_id)
 Allocate new element at the end of array and return its pointer. More...
 
int ur_init (ur_static_field_specs_t field_specs_static)
 Initialize UniRec structures Initialize UniRec structures. Function is called during defining first own field. More...
 
int ur_get_empty_id ()
 Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures. More...
 
int ur_define_field (const char *name, ur_field_type_t type)
 Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structures. If the field already exists (name and type are equal) it only returns its ID. More...
 
int ur_define_set_of_fields (const char *ifc_data_fmt)
 Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2". More...
 
int ur_undefine_field_by_id (ur_field_id_t field_id)
 Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
 
int ur_undefine_field (const char *name)
 Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
 
void ur_finalize ()
 Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program's end. This function has to be called if some fields are defined during run-time, otherwise this function is needless. More...
 
int ur_get_id_by_name (const char *name)
 Get ID of a field by its name Get ID of a field by its name. More...
 
int compare_fields (const void *field1, const void *field2)
 Compare fields Compare two fields. This function is for sorting the fields in the right order. First by sizes (larger first) and then by names. More...
 
ur_template_tur_create_template (const char *fields, char **errstr)
 Create UniRec template Create new UniRec template specified by a string containing names of its fields separated by commas. Example spec-string: "SRC_IP,DST_IP,SRC_PORT,DST_PORT,PROTOCOL,PACKETS" Order of fields is not important (templates with the same set of fields are equivalent). Template created by this function should be destroyed by ur_free_template. More...
 
ur_template_tur_ctx_create_output_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
 Create UniRec template and set it to output interface on specified context Creates UniRec template, same like ur_create_output_template, but context is specified. More...
 
ur_template_tur_ctx_create_input_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
 Create UniRec template and set it to input interface on specified context Creates UniRec template, same like ur_create_input_template, but context is specified. More...
 
int ur_ctx_set_output_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
 Set UniRec template to ouput interface on specified context. More...
 
int ur_ctx_set_input_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
 Set UniRec template to input interface on specified context. More...
 
ur_template_tur_ctx_create_bidirectional_template (trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
 Create UniRec template and set it to input and output interface on specified context Creates UniRec template, same like ur_create_bidirectional_template, but context is specified. More...
 
ur_template_tur_expand_template (const char *ifc_data_fmt, ur_template_t *tmplt)
 Expand UniRec template Expand existing UniRec template by a string containing types and names of its fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
 
ur_template_tur_define_fields_and_update_template (const char *ifc_data_fmt, ur_template_t *tmplt)
 Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields) and create new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
 
ur_template_tur_create_template_from_ifc_spec (const char *ifc_data_fmt)
 Create UniRec template from data format string. Creates new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent).. More...
 
void ur_free_template (ur_template_t *tmplt)
 Destroy UniRec template Free all memory allocated for a template created previously by ur_create_template. More...
 
int ur_template_compare (const ur_template_t *tmpltA, const ur_template_t *tmpltB)
 Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is not compared). More...
 
void ur_print_template (ur_template_t *tmplt)
 Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging). If template does not contain any dynamic fields, print '-' instead. param[in] tmplt pointer to the template. More...
 
int ur_set_var (const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
 Set content of variable-length UniRec field Copy given data into variable-length UniRec field, set its offset and length in a record and move data which are behind this field. For better performance use function ur_clear_varlen, before setting all variable fields in record. More...
 
int ur_array_resize (const ur_template_t *tmplt, void *rec, int field_id, int len)
 Change length of a array field. More...
 
void ur_clear_varlen (const ur_template_t *tmplt, void *rec)
 Clear variable-length part of a record. For better performance of setting content to variable-length fields, use this function before setting of all the variable-length fields. This function will clear all the variable-length fields, so they don't have to be moved in memory during setting of them. More...
 
uint16_t ur_rec_varlen_size (const ur_template_t *tmplt, const void *rec)
 Get size of variable sized part of UniRec record Get total size of all variable-length fields in an UniRec record. More...
 
void * ur_create_record (const ur_template_t *tmplt, uint16_t max_var_size)
 
void ur_free_record (void *record)
 
char * ur_get_var_as_str (const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
 Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()! More...
 
void ur_copy_fields (const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
 Copy data from one UniRec record to another. Copies all fields present in both templates from src to dst. The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src. "dst" must point to a memory of enough size. More...
 
void * ur_clone_record (const ur_template_t *tmplt, const void *src)
 Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it with the data given by parameter. More...
 
ur_iter_t ur_iter_fields (const ur_template_t *tmplt, ur_iter_t id)
 Iterate over fields of a template in order of a record This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned. Example usage: ur_field_id_t id = UR_ITER_BEGIN while ((id = ur_iter_fields(&tmplt, id)) != UR_ITER_END) { ... } The order of fields is given by the order in which they are defined. More...
 
ur_iter_t ur_iter_fields_record_order (const ur_template_t *tmplt, int index)
 Iterate over fields of a template This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template. Example usage: int i = 0; while ((id = ur_iter_fields(&tmplt, i++)) != UR_ITER_END) { ... } The order of fields is given by the order in the record. More...
 
int ur_set_array_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
 Set value of a UniRec array field. More...
 
int ur_set_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
 Set value of a UniRec field. More...
 
char * ur_ifc_data_fmt_to_field_names (const char *ifc_data_fmt)
 Parses field names from data format Function parses field names from data format and returns pointer to new allocated string. Example: "type1 name1,type2 name2" => "name1,name2" New string has to be freed by user. More...
 
char * ur_cpy_string (const char *str)
 Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user. More...
 
const char * ur_values_get_name_start_end (uint32_t start, uint32_t end, int32_t value)
 Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
 
const char * ur_values_get_description_start_end (uint32_t start, uint32_t end, int32_t value)
 Returns description of specified value (Helper function) Helper function for ur_values_get_description. This function returns description of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
 
+ + + + + + + + + + + + + + + + +

+Variables

const int ur_field_type_size []
 Sizes of UniRec data types. More...
 
const char * ur_field_type_str []
 UniRec data types. More...
 
int ur_field_array_elem_type []
 UniRec array element types. More...
 
ur_field_specs_t ur_field_specs
 Structure that lists UniRec field specifications such as names, types, id. More...
 
ur_static_field_specs_t UR_FIELD_SPECS_STATIC
 Structure that lists staticaly defined UniRec field specifications such as names, types, id (using UR_FIELDS()). More...
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ ur_array_allocate

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_allocate( tmplt,
 rec,
 field_id,
 elem_cnt 
)   ur_array_resize(tmplt, rec, field_id, (elem_cnt) * ur_array_get_elem_size(field_id))
+
+ +

Preallocates UniRec array field to have requested number of elements.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]elem_cntNumber of elements to be in resized array.
+
+
+
Returns
UR_OK if there is no problem. UR_E_INVALID_FIELD_ID if the ID is not in the template.
+ +

Definition at line 629 of file unirec.h.

+ +
+
+ +

◆ ur_array_append

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_append( tmplt,
 rec,
 field_id,
 element 
)
+
+Value:
if (ur_array_resize(tmplt, rec, field_id, (ur_array_get_elem_cnt(tmplt, rec, field_id) + 1) * ur_array_get_elem_size(field_id)) == UR_OK) { \
(((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[ur_array_get_elem_cnt(tmplt, rec, field_id) - 1] = (element)); \
}
#define ur_get_ptr_by_id(tmplt, data, field_id)
Get pointer to UniRec field Get pointer to fixed or varible length UniRec field. In contrast to ur_ge...
Definition: unirec.h:442
+
#define UR_OK
No problem.
Definition: unirec.h:90
+
void * rec
+
#define ur_array_get_elem_size(field_id)
Get size of a single element of UniRec field.
Definition: unirec.h:535
+
#define ur_array_get_elem_cnt(tmplt, rec, field_id)
Get number of elements stored in an UniRec array.
Definition: unirec.h:546
+
int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len)
Change length of a array field.
Definition: unirec.c:1170
+
+

Set element to array at last position. Automatically resizes array.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]elementArray element.
+
+
+ +

Definition at line 581 of file unirec.h.

+ +
+
+ +

◆ ur_array_clear

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_clear( tmplt,
 rec,
 field_id 
)   ur_array_resize(tmplt, rec, field_id, 0)
+
+ +

Clear contents of an UniRec array. Array is resized to 0 elements.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
UR_OK if there is no problem. UR_E_INVALID_FIELD_ID if the ID is not in the template.
+ +

Definition at line 604 of file unirec.h.

+ +
+
+ +

◆ ur_array_get

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_get( tmplt,
 rec,
 field_id,
 index 
)   ((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index]
+
+ +

Get element of an array field at given index.

+
Parameters
+ + + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]indexElement index in array.
[in]elementArray element.
+
+
+
Returns
Specified field in an array.
+ +

Definition at line 617 of file unirec.h.

+ +
+
+ +

◆ ur_array_get_elem_cnt

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_get_elem_cnt( tmplt,
 rec,
 field_id 
)   (ur_get_var_len(tmplt, rec, field_id) / ur_array_get_elem_size(field_id))
+
+ +

Get number of elements stored in an UniRec array.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
Number of elements stored in an UniRec array field.
+ +

Definition at line 546 of file unirec.h.

+ +
+
+ +

◆ ur_array_get_elem_size

+ +
+
+ + + + + + + + +
#define ur_array_get_elem_size( field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? -ur_field_type_size[ur_get_type(field_id)] : ur_field_type_size[ur_get_type(field_id)])
+
+ +

Get size of a single element of UniRec field.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
Size of a static field or size of a single element in an array field.
+ +

Definition at line 535 of file unirec.h.

+ +
+
+ +

◆ ur_array_get_elem_type

+ +
+
+ + + + + + + + +
#define ur_array_get_elem_type( field_id)   ur_field_array_elem_type[ur_get_type(field_id)]
+
+ +

Get type of an element stored in an UniRec array.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
UR_TYPE_* value.
+ +

Definition at line 555 of file unirec.h.

+ +
+
+ +

◆ ur_array_set

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_array_set( tmplt,
 rec,
 field_id,
 index,
 element 
)
+
+Value:
if ((index) * ur_array_get_elem_size(field_id) < ur_get_var_len(tmplt, rec, field_id) || ur_array_resize(tmplt, rec, field_id, (index + 1) * ur_array_get_elem_size(field_id)) == UR_OK) { \
(((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index] = (element)); \
}
#define ur_get_ptr_by_id(tmplt, data, field_id)
Get pointer to UniRec field Get pointer to fixed or varible length UniRec field. In contrast to ur_ge...
Definition: unirec.h:442
+
#define UR_OK
No problem.
Definition: unirec.h:90
+
void * rec
+
#define ur_array_get_elem_size(field_id)
Get size of a single element of UniRec field.
Definition: unirec.h:535
+
#define ur_get_var_len(tmplt, rec, field_id)
Get size of a variable sized field in the record. Get size of a variable-length field in the record...
Definition: unirec.h:474
+
int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len)
Change length of a array field.
Definition: unirec.c:1170
+
+

Set element to array at given index. Automatically resizes array when index is out of array bounds. Set contents of a variable-length field in the record. Field has to be part of the record.

+
Parameters
+ + + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]indexElement index in array.
[in]elementArray element.
+
+
+ +

Definition at line 568 of file unirec.h.

+ +
+
+ +

◆ ur_cpy

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_cpy( tmplt,
 src,
 dst 
)   (memcpy(dst,src,ur_rec_size(tmplt,src)))
+
+ +

Copy data from one UniRec to another. Procedure gets template and void pointer of source and destination. Then it copies the data defined by the given template. The destination pointer must have required space allocated.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]srcPointer to source data
[out]dstPointer to destination of copy
+
+
+ +

Definition at line 1056 of file unirec.h.

+ +
+
+ +

◆ ur_create_bidirectional_template

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_create_bidirectional_template( ifc_in,
 ifc_out,
 fields,
 errstr 
)   ur_ctx_create_bidirectional_template(trap_get_global_ctx(), ifc_in, ifc_out, fields, errstr);
+
+ +

Create UniRec template and set it to input and output interface Creates UniRec template (same like ur_create_template) and set this template to input and ouput interface of a module.

+
Parameters
+ + + + + +
[in]ifc_ininput interface number
[in]ifc_outoutput interface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 890 of file unirec.h.

+ +
+
+ +

◆ ur_create_input_template

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_create_input_template( ifc,
 fields,
 errstr 
)   ur_ctx_create_input_template(trap_get_global_ctx(), ifc, fields, errstr);
+
+ +

Create UniRec template and set it to input interface Creates UniRec template (same like ur_create_template) and set this template to input interface of a module.

+
Parameters
+ + + + +
[in]ifcinterface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 793 of file unirec.h.

+ +
+
+ +

◆ ur_create_output_template

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_create_output_template( ifc,
 fields,
 errstr 
)   ur_ctx_create_output_template(trap_get_global_ctx(), ifc, fields, errstr);
+
+ +

Create UniRec template and set it to output interface Creates UniRec template (same like ur_create_template) and set this template to ouput interface of a module.

+
Parameters
+ + + + +
[in]ifcinterface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 806 of file unirec.h.

+ +
+
+ +

◆ ur_get

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get( tmplt,
 data,
 field_id 
)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]))
+
+ +

Get value of UniRec field Get value of a fixed-length UniRec field. For variable-length fields, use ur_get_ptr or ur_get_ptr_by_id.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]dataPointer to the beginning of a record
[in]field_idIdentifier of a field. It must be a token beginning with F_, not a numeric ID (e.g. F_SRC_IP for source IP defined in UR_FIELDS as SRC_IP).
+
+
+
Returns
Value of the field. Data type depends on the type of the field.
+ +

Definition at line 418 of file unirec.h.

+ +
+
+ +

◆ ur_get_len

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get_len( tmplt,
 rec,
 field 
)   ur_is_static(field) ? ur_get_size(field) : ur_get_var_len(tmplt, rec, field)
+
+ +

Get length of UniRec field Get actual length of fixed or variable-length UniRec field.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]fieldIdentifier of a field - e.g. F_SRC_IP for source IP defined in UR_FIELDS as SRC_IP.
+
+
+
Returns
Length of the field in bytes.
+ +

Definition at line 506 of file unirec.h.

+ +
+
+ +

◆ ur_get_name

+ +
+
+ + + + + + + + +
#define ur_get_name( field_id)   ur_field_specs.ur_field_names[field_id]
+
+ +

Get name of UniRec field Get name of any UniRec defined field.

+
Parameters
+ + +
[in]field_idID of a field.
+
+
+
Returns
pointer to name (char *).
+ +

Definition at line 380 of file unirec.h.

+ +
+
+ +

◆ ur_get_ptr

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get_ptr( tmplt,
 data,
 field_id 
)
+
+Value:
(field_id ## _T*)((char *) (ur_is_static(field_id) ? ((char *)(data) + (tmplt)->offset[field_id]) : \
(char *)(data) + (tmplt)->static_size + (*((uint16_t *)((char *)(data) + (tmplt)->offset[field_id])))))
#define ur_is_static(field_id)
Alias for ur_is_fixlen (for backwards compatibility only)
Definition: unirec.h:662
+
+

Get pointer to UniRec field Get pointer to fixed or varible length statically defined UniRec field. For dynamically defined fields, use ur_get_ptr_by_id.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]dataPointer to the beginning of a record
[in]field_idIdentifier of a field. It must be a token beginning with F_, not a numeric ID.
+
+
+
Returns
Pointer to the field. Pointer type depends on the type of the field.
+ +

Definition at line 430 of file unirec.h.

+ +
+
+ +

◆ ur_get_ptr_by_id

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get_ptr_by_id( tmplt,
 data,
 field_id 
)
+
+Value:
(void *)((char *) (ur_is_static(field_id) ? ((char *)(data) + (tmplt)->offset[field_id]) : \
(char *)(data) + (tmplt)->static_size + (*((uint16_t *)((char *)(data) + (tmplt)->offset[field_id])))))
#define ur_is_static(field_id)
Alias for ur_is_fixlen (for backwards compatibility only)
Definition: unirec.h:662
+
+

Get pointer to UniRec field Get pointer to fixed or varible length UniRec field. In contrast to ur_get_ptr, field_id may be a variable (not only F_ token). Returned pointer is always void *.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]dataPointer to the beginning of a record
[in]field_idIdentifier of a field. Token beginning with F_ or a numeric ID.
+
+
+
Returns
Pointer to the field (void *).
+ +

Definition at line 442 of file unirec.h.

+ +
+
+ +

◆ ur_get_size

+ +
+
+ + + + + + + + +
#define ur_get_size( field_id)   ur_field_specs.ur_field_sizes[field_id]
+
+ +

Get size of UniRec field Get size of a fixed-length UniRec field. When variable-length field is passed, return value < 0. To get real length of a variable-length field use ur_get_var_len.

+
Parameters
+ + +
[in]field_idID of a field.
+
+
+
Returns
Size of the field in bytes or -1 if the field is variable-length.
+ +

Definition at line 405 of file unirec.h.

+ +
+
+ +

◆ ur_get_type

+ +
+
+ + + + + + + + +
#define ur_get_type( field_id)   ur_field_specs.ur_field_types[field_id]
+
+ +

Get type of UniRec field Get type of any UniRec defined field.

+
Parameters
+ + +
[in]field_idID of a field.
+
+
+
Returns
Type of the field (ur_field_type_t).
+ +

Definition at line 388 of file unirec.h.

+ +
+
+ +

◆ ur_get_var_len

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get_var_len( tmplt,
 rec,
 field_id 
)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2))
+
+ +

Get size of a variable sized field in the record. Get size of a variable-length field in the record. Given field has to be part of the record.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
Length of the field in the record in bytes.
+ +

Definition at line 474 of file unirec.h.

+ +
+
+ +

◆ ur_get_var_offset

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_get_var_offset( tmplt,
 rec,
 field_id 
)   *((uint16_t *)((char *) rec + tmplt->offset[field_id]))
+
+ +

Get offset of variable-length field in the record. Get offset of a specified variable-length field in the record. Given field has to be part of the record.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
Offset of the field in the record relative to the beginning of the record.
+ +

Definition at line 464 of file unirec.h.

+ +
+
+ +

◆ ur_is_array

+ +
+
+ + + + + + + + +
#define ur_is_array( field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? 1 : 0)
+
+

Check if field is an array.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
1 if field is an array, 0 otherwise.
+ +

Definition at line 526 of file unirec.h.

+ +
+
+ +

◆ ur_is_dynamic

+ +
+
+ + + + + + + + +
#define ur_is_dynamic( field_id)   ur_is_varlen(field_id)
+
+ +

Alias for ur_is_varlen (for backwards compatibility only)

+ +

Definition at line 650 of file unirec.h.

+ +
+
+ +

◆ ur_is_fixlen

+ +
+
+ + + + + + + + +
#define ur_is_fixlen( field_id)   (ur_field_specs.ur_field_sizes[field_id] >= 0)
+
+ +

Is given field fixed-length? Return true (non-zero value) if given ID refers to a field with fixed length.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
non-zero if field is fixed-length, zero otherwise
+ +

Definition at line 658 of file unirec.h.

+ +
+
+ +

◆ ur_is_present

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_is_present( tmplt,
 field_id 
)   ((tmplt)->offset_size > (field_id) && (tmplt)->offset[(field_id)] != UR_INVALID_OFFSET)
+
+ +

Is given field present in given template? Return true (non-zero value) if given template contains field with given ID.

+
Parameters
+ + + +
[in]tmpltPointer to UniRec template
[in]field_idIdentifier of a field.
+
+
+
Returns
non-zero if field is present, zero otherwise
+ +

Definition at line 638 of file unirec.h.

+ +
+
+ +

◆ ur_is_static

+ +
+
+ + + + + + + + +
#define ur_is_static( field_id)   ur_is_fixlen(field_id)
+
+ +

Alias for ur_is_fixlen (for backwards compatibility only)

+ +

Definition at line 662 of file unirec.h.

+ +
+
+ +

◆ ur_is_varlen

+ +
+
+ + + + + + + + +
#define ur_is_varlen( field_id)   (ur_field_specs.ur_field_sizes[field_id] < 0)
+
+ +

Is given field variable-length? Return true (non-zero value) if given ID refers to a field with variable length.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
non-zero if field is variable-length, zero otherwise
+ +

Definition at line 646 of file unirec.h.

+ +
+
+ +

◆ UR_MAX_SIZE

+ +
+
+ + + + +
#define UR_MAX_SIZE   0xffff
+
+ +

Definition at line 1013 of file unirec.h.

+ +
+
+ +

◆ ur_rec_fixlen_size

+ +
+
+ + + + + + + + +
#define ur_rec_fixlen_size( tmplt)   ((tmplt)->static_size)
+
+ +

Get size of fixed-length part of UniRec record Get total size of UniRec record except variable-length fields.

+
Parameters
+ + +
[in]tmpltPointer to UniRec template
+
+
+
Returns
Size of the static part of UniRec record.
+ +

Definition at line 671 of file unirec.h.

+ +
+
+ +

◆ ur_rec_size

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_rec_size( tmplt,
 rec 
)   (ur_rec_fixlen_size(tmplt) + ur_rec_varlen_size(tmplt, rec))
+
+ +

Get size of UniRec record (static and variable length) Get total size of whole UniRec record.

+
Parameters
+ + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
+
+
+
Returns
Size of the UniRec record.
+ +

Definition at line 680 of file unirec.h.

+ +
+
+ +

◆ ur_set

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_set( tmplt,
 data,
 field_id,
 value 
)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]) = (value))
+
+ +

Set value of UniRec (static) field Set value of a fixed-length UniRec field. For variable-length fields, use ur_set_var.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]dataPointer to the beginning of a record
[in]field_idIdentifier of a field. It must be a token beginning with F_, not a numeric ID.
[in]valueThe value the field should be set to.
+
+
+ +

Definition at line 454 of file unirec.h.

+ +
+
+ +

◆ ur_set_input_template

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_set_input_template( ifc,
 tmplt 
)   ur_ctx_set_input_template(trap_get_global_ctx(), ifc, tmplt)
+
+ +

Set UniRec template to input interface.

+
Parameters
+ + + +
[in]ifcinterface number
[in]tmpltpointer to a template
+
+
+
Returns
UR_OK if there is no problem. UR_E_MEMORY if the ID is not in the template.
+ +

Definition at line 863 of file unirec.h.

+ +
+
+ +

◆ ur_set_output_template

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_set_output_template( ifc,
 tmplt 
)   ur_ctx_set_output_template(trap_get_global_ctx(), ifc, tmplt)
+
+ +

Set UniRec template to ouput interface.

+
Parameters
+ + + +
[in]ifcinterface number
[in]tmpltpointer to a template
+
+
+
Returns
UR_OK if there is no problem. UR_E_MEMORY if the ID is not in the template.
+ +

Definition at line 847 of file unirec.h.

+ +
+
+ +

◆ ur_set_string

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_set_string( tmplt,
 rec,
 field_id,
 str 
)   ur_set_var(tmplt, rec, field_id, str, strlen(str))
+
+ +

Set variable-length field to given string. Set contents of a variable-length field in the record. Field has to be part of the record. It copies string terminated with \0 and safely moves other variable-length records.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]strString terminated with \0, which will be copied
+
+
+ +

Definition at line 517 of file unirec.h.

+ +
+
+ +

◆ ur_set_var_len

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_set_var_len( tmplt,
 rec,
 field_id,
 len 
)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2)) = (uint16_t) len
+
+ +

Set size of variable-length field in the record. Set size of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]lenThe value the length should be set to.
+
+
+ +

Definition at line 485 of file unirec.h.

+ +
+
+ +

◆ ur_set_var_offset

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define ur_set_var_offset( tmplt,
 rec,
 field_id,
 offset_val 
)   *((uint16_t *)((char *) rec + tmplt->offset[field_id])) = (uint16_t) offset_val
+
+ +

Set offset of variable-length field in the record. Set offset of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
[in]offset_valThe value the offset should be set to.
+
+
+ +

Definition at line 496 of file unirec.h.

+ +
+
+ +

◆ ur_size_of

+ +
+
+ + + + + + + + +
#define ur_size_of( type)   ur_field_type_size[type]
+
+ +

Get size of UniRec type Get size of fixed-length UniRec type. For variable-length type return value < 0.

+
Parameters
+ + +
[in]typeEnum value of type.
+
+
+
Returns
Size of the field in bytes.
+ +

Definition at line 372 of file unirec.h.

+ +
+
+ +

◆ ur_template_string

+ +
+
+ + + + + + + + +
#define ur_template_string( tmplt)   ur_template_string_delimiter(tmplt, ',')
+
+ +

Get string of a template Get names and sizes of fields separated by comma. Return string has to be freed by user.

+
See also
ur_template_string_delimiter()
+
Parameters
+ + +
[in]tmpltPointer to UniRec template
+
+
+
Returns
String containing list of fields and their types.
+
Note
Caller must free the returned memory.
+ +

Definition at line 364 of file unirec.h.

+ +
+
+ +

◆ ur_values_get_description

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_values_get_description( field,
 value 
)   ur_values_get_description_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
+
+ +

Returns description of specified value This function returns description of specified value and field, which is defined in values file.

+
Parameters
+ + + +
[in]fieldName of field to search value in
[in]valueValue of an item to find
+
+
+
Returns
Pointer to string or NULL if the value was not found
+ +

Definition at line 1186 of file unirec.h.

+ +
+
+ +

◆ ur_values_get_name

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_values_get_name( field,
 value 
)   ur_values_get_name_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
+
+ +

Returns name of specified value This function returns name of specified value and field, which is defined in values file.

+
Parameters
+ + + +
[in]fieldName of field to search value in
[in]valueValue of an item to find
+
+
+
Returns
Pointer to string or NULL if the value was not found
+ +

Definition at line 1176 of file unirec.h.

+ +
+
+

Function Documentation

+ +

◆ compare_fields()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int compare_fields (const void * field1,
const void * field2 
)
+
+ +

Compare fields Compare two fields. This function is for sorting the fields in the right order. First by sizes (larger first) and then by names.

+
Parameters
+ + + +
[in]field1Pointer to first field (field_spec_t)
[in]field2Pointer to second field (field_spec_t)
+
+
+
Returns
-1 if f1 should go before f2, 0 if f1 is the same as f2, 1 otherwise
+ +

Definition at line 785 of file unirec.c.

+ +
+
+ +

◆ ur_array_append_get_ptr()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
char* ur_array_append_get_ptr (const ur_template_ttmplt,
void * rec,
int field_id 
)
+
+ +

Allocate new element at the end of array and return its pointer.

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
Pointer to allocated element at the end or NULL if allocation failed.
+ +

Definition at line 1184 of file unirec.c.

+ +
+
+ +

◆ ur_array_resize()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ur_array_resize (const ur_template_ttmplt,
void * rec,
int field_id,
int len 
)
+
+ +

Change length of a array field.

+
Parameters
+ + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record.
[in]field_idIdentifier of a field.
[in]lenLength of the copied data in bytes.
+
+
+
Returns
UR_OK if there is no problem. UR_E_INVALID_FIELD_ID if the ID is not in the template.
+ +

Definition at line 1170 of file unirec.c.

+ +
+
+ +

◆ ur_clear_varlen()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ur_clear_varlen (const ur_template_ttmplt,
void * rec 
)
+
+ +

Clear variable-length part of a record. For better performance of setting content to variable-length fields, use this function before setting of all the variable-length fields. This function will clear all the variable-length fields, so they don't have to be moved in memory during setting of them.

+
Parameters
+ + + +
[in]tmpltPointer to UniRec template.
[in]recPointer to the beginning of a record.
+
+
+ +

Definition at line 1195 of file unirec.c.

+ +
+
+ +

◆ ur_clone_record()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void* ur_clone_record (const ur_template_ttmplt,
const void * src 
)
+
+inline
+
+ +

Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it with the data given by parameter.

+
Parameters
+ + + +
[in]tmpltPointer to UniRec template
[in]srcPointer to source data (UniRec record of the same template)
+
+
+
Returns
Pointer to a new UniRec
+ +

Definition at line 1243 of file unirec.c.

+ +
+
+ +

◆ ur_copy_fields()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void ur_copy_fields (const ur_template_tdst_tmplt,
void * dst,
const ur_template_tsrc_tmplt,
const void * src 
)
+
+ +

Copy data from one UniRec record to another. Copies all fields present in both templates from src to dst. The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src. "dst" must point to a memory of enough size.

+
Parameters
+ + + + + +
[in]dst_tmpltPointer to destination UniRec template
[in]dstPointer to destination record
[in]src_tmpltPointer to source UniRec template
[in]srcPointer to source record
+
+
+ +

Definition at line 1253 of file unirec.c.

+ +
+
+ +

◆ ur_cpy_string()

+ +
+
+ + + + + + + + +
char* ur_cpy_string (const char * str)
+
+ +

Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user.

+
Parameters
+ + +
[in]strPointer to the string to duplicate
+
+
+
Returns
Pointer to duplicated string on NULL.
+ +

Definition at line 1655 of file unirec.c.

+ +
+
+ +

◆ ur_create_record()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void* ur_create_record (const ur_template_ttmplt,
uint16_t max_var_size 
)
+
+

Create UniRec record. Allocate and zero memory for a record with given template. It allocates N+M bytes, where N is the size of static part of the record (inferred from template), and M is the size of variable part (variable-length fields), which must be provided by caller. No more than 65535 bytes is allocated (even if N+M is greater), since this is the maximal possible size of UniRec record.

Parameters
+ + + +
[in]tmpltPointer to UniRec template.
[in]max_var_sizeSize of variable-length part, i.e. sum of lengths of all variable-length fields. If it is not known at the time of record creation, use UR_MAX_SIZE, which allocates enough memory to hold the largest possible UniRec record (65535 bytes). Set to 0 if there are no variable-length fields in the template.
+
+
+ +

Definition at line 1214 of file unirec.c.

+ +
+
+ +

◆ ur_create_template()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ur_template_t* ur_create_template (const char * fields,
char ** errstr 
)
+
+ +

Create UniRec template Create new UniRec template specified by a string containing names of its fields separated by commas. Example spec-string: "SRC_IP,DST_IP,SRC_PORT,DST_PORT,PROTOCOL,PACKETS" Order of fields is not important (templates with the same set of fields are equivalent). Template created by this function should be destroyed by ur_free_template.

+
Parameters
+ + + +
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 900 of file unirec.c.

+ +
+
+ +

◆ ur_create_template_from_ifc_spec()

+ +
+
+ + + + + + + + +
ur_template_t* ur_create_template_from_ifc_spec (const char * ifc_data_fmt)
+
+ +

Create UniRec template from data format string. Creates new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent)..

+
Parameters
+ + +
[in]ifc_data_fmtString with types and names of fields delimited by commas
+
+
+
Returns
Pointer to the new template or NULL in case of error.
+ +

Definition at line 625 of file unirec.c.

+ +
+
+ +

◆ ur_ctx_create_bidirectional_template()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_template_t* ur_ctx_create_bidirectional_template (trap_ctx_t * ctx,
int ifc_in,
int ifc_out,
const char * fields,
char ** errstr 
)
+
+ +

Create UniRec template and set it to input and output interface on specified context Creates UniRec template, same like ur_create_bidirectional_template, but context is specified.

+
Parameters
+ + + + + + +
[in]ctxspecified context
[in]ifc_ininput interface number
[in]ifc_outoutput interface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 875 of file unirec.c.

+ +
+
+ +

◆ ur_ctx_create_input_template()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_template_t* ur_ctx_create_input_template (trap_ctx_t * ctx,
int ifc,
const char * fields,
char ** errstr 
)
+
+ +

Create UniRec template and set it to input interface on specified context Creates UniRec template, same like ur_create_input_template, but context is specified.

+
Parameters
+ + + + + +
[in]ctxspecified context
[in]ifcinterface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 798 of file unirec.c.

+ +
+
+ +

◆ ur_ctx_create_output_template()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ur_template_t* ur_ctx_create_output_template (trap_ctx_t * ctx,
int ifc,
const char * fields,
char ** errstr 
)
+
+ +

Create UniRec template and set it to output interface on specified context Creates UniRec template, same like ur_create_output_template, but context is specified.

+
Parameters
+ + + + + +
[in]ctxspecified context
[in]ifcinterface number
[in]fieldsString with names of fields delimited by comma
[in]errstrPointer to char * string where the error message will be allocated and written in case of error. NULL if you don't need error message. In case of error, function will allocate string, which has to be freed by user.
+
+
+
Returns
Pointer to newly created template or NULL in case of error.
+ +

Definition at line 817 of file unirec.c.

+ +
+
+ +

◆ ur_ctx_set_input_template()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ur_ctx_set_input_template (trap_ctx_t * ctx,
int ifc,
ur_template_ttmplt 
)
+
+ +

Set UniRec template to input interface on specified context.

+
Parameters
+ + + + +
[in]ctxspecified context
[in]ifcinterface number
[in]tmpltpointer to a template
+
+
+
Returns
UR_OK if there is no problem. UR_E_MEMORY if the ID is not in the template.
+ +

Definition at line 856 of file unirec.c.

+ +
+
+ +

◆ ur_ctx_set_output_template()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ur_ctx_set_output_template (trap_ctx_t * ctx,
int ifc,
ur_template_ttmplt 
)
+
+ +

Set UniRec template to ouput interface on specified context.

+
Parameters
+ + + + +
[in]ctxspecified context
[in]ifcinterface number
[in]tmpltpointer to a template
+
+
+
Returns
UR_OK if there is no problem. UR_E_MEMORY if the ID is not in the template.
+ +

Definition at line 836 of file unirec.c.

+ +
+
+ +

◆ ur_define_field()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int ur_define_field (const char * name,
ur_field_type_t type 
)
+
+ +

Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structures. If the field already exists (name and type are equal) it only returns its ID.

+
Parameters
+ + + +
[in]nameString with name of field.
[in]typeType of field (specified by UR_TYPE_*).
+
+
+
Returns
ID of created or existing field. UR_E_MEMORY if there is an allocation problem. UR_E_INVALID_NAME if the name value is empty. UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
+ +

Definition at line 636 of file unirec.c.

+ +
+
+ +

◆ ur_define_fields_and_update_template()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ur_template_t* ur_define_fields_and_update_template (const char * ifc_data_fmt,
ur_template_ttmplt 
)
+
+ +

Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields) and create new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned.

+
Parameters
+ + + +
[in]ifc_data_fmtString with types and names of fields delimited by commas
[in]tmpltPointer to an existing template.
+
+
+
Returns
Pointer to the updated template or NULL in case of error.
+ +

Definition at line 610 of file unirec.c.

+ +
+
+ +

◆ ur_define_set_of_fields()

+ +
+
+ + + + + + + + +
int ur_define_set_of_fields (const char * ifc_data_fmt)
+
+ +

Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2".

+
Parameters
+ + +
[in]ifc_data_fmtString containing types and names of fields delimited by comma.
+
+
+
Returns
UR_OK on success UR_E_MEMORY if there is an allocation problem. UR_E_INVALID_NAME if the name value is empty. UR_E_INVALID_TYPE if the type does not exist. UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
+ +

Definition at line 558 of file unirec.c.

+ +
+
+ +

◆ ur_expand_template()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ur_template_t* ur_expand_template (const char * ifc_data_fmt,
ur_template_ttmplt 
)
+
+ +

Expand UniRec template Expand existing UniRec template by a string containing types and names of its fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned.

+
Parameters
+ + + +
[in]ifc_data_fmtString with types and names of fields delimited by commas
[in]tmpltPointer to an existing template.
+
+
+
Returns
Pointer to the updated template or NULL in case of error.
+ +

Definition at line 486 of file unirec.c.

+ +
+
+ +

◆ ur_finalize()

+ +
+
+ + + + + + + +
void ur_finalize ()
+
+ +

Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program's end. This function has to be called if some fields are defined during run-time, otherwise this function is needless.

+ +

Definition at line 734 of file unirec.c.

+ +
+
+ +

◆ ur_free_record()

+ +
+
+ + + + + + + + +
void ur_free_record (void * record)
+
+

Free UniRec record. Free memory allocated for UniRec record. You can call system free() on the record as well, this function is there just for completeness.

Parameters
+ + +
[in]recordPointer to the record to free.
+
+
+ +

Definition at line 1223 of file unirec.c.

+ +
+
+ +

◆ ur_free_template()

+ +
+
+ + + + + + + + +
void ur_free_template (ur_template_ttmplt)
+
+ +

Destroy UniRec template Free all memory allocated for a template created previously by ur_create_template.

+
Parameters
+ + +
[in]tmpltPointer to the template.
+
+
+ +

Definition at line 1088 of file unirec.c.

+ +
+
+ +

◆ ur_get_empty_id()

+ +
+
+ + + + + + + +
int ur_get_empty_id ()
+
+ +

Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures.

+
Returns
ID for new field. UR_E_MEMORY (negative value) if there is an allocation problem.
+ +

Definition at line 288 of file unirec.c.

+ +
+
+ +

◆ ur_get_field_type_from_str()

+ +
+
+ + + + + + + + +
int ur_get_field_type_from_str (const char * type)
+
+

Lookup a field type for its textual representation.

+
Parameters
+ + +
[in]typeUniRec type in string format, e.g. "ipaddr" or "uint8"
+
+
+
Returns
Index into ur_field_type_str and ur_field_type_size arrays or UR_E_INVALID_TYPE if the type is not found.
+ +

Definition at line 355 of file unirec.c.

+ +
+
+ +

◆ ur_get_id_by_name()

+ +
+
+ + + + + + + + +
int ur_get_id_by_name (const char * name)
+
+ +

Get ID of a field by its name Get ID of a field by its name.

+
Parameters
+ + +
[in]nameString with name of a field.
+
+
+
Returns
ID of a field. UR_E_INVALID_NAME (negative value) if the name is not known.
+ +

Definition at line 774 of file unirec.c.

+ +
+
+ +

◆ ur_get_var_as_str()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
char* ur_get_var_as_str (const ur_template_ttmplt,
const void * rec,
ur_field_id_t field_id 
)
+
+ +

Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()!

+
Parameters
+ + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record
[in]field_idIdentifier of a field.
+
+
+
Returns
Requested field as a string (char *) or NULL on malloc error. It should be freed using free().
+ +

Definition at line 1229 of file unirec.c.

+ +
+
+ +

◆ ur_ifc_data_fmt_to_field_names()

+ +
+
+ + + + + + + + +
char* ur_ifc_data_fmt_to_field_names (const char * ifc_data_fmt)
+
+ +

Parses field names from data format Function parses field names from data format and returns pointer to new allocated string. Example: "type1 name1,type2 name2" => "name1,name2" New string has to be freed by user.

+
Parameters
+ + +
[in]ifc_data_fmtPointer to the string containing data format
+
+
+
Returns
Pointer to string with names of fields
+ +

Definition at line 434 of file unirec.c.

+ +
+
+ +

◆ ur_init()

+ +
+
+ + + + + + + + +
int ur_init (ur_static_field_specs_t field_specs_static)
+
+ +

Initialize UniRec structures Initialize UniRec structures. Function is called during defining first own field.

+
Parameters
+ + +
[in]field_specs_staticStructure of statically-known UniRec fields.
+
+
+
Returns
UR_E_MEMORY if there is an allocation problem, UR_OK otherwise.
+ +

Definition at line 206 of file unirec.c.

+ +
+
+ +

◆ ur_iter_fields()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ur_iter_t ur_iter_fields (const ur_template_ttmplt,
ur_iter_t id 
)
+
+ +

Iterate over fields of a template in order of a record This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned. Example usage: ur_field_id_t id = UR_ITER_BEGIN while ((id = ur_iter_fields(&tmplt, id)) != UR_ITER_END) { ... } The order of fields is given by the order in which they are defined.

+
Parameters
+ + + +
[in]tmpltTemplate to iterate over.
[in]idField ID returned in last iteration or UR_ITER_BEGIN to get first value.
+
+
+
Returns
ID of the next field or UR_ITER_END if no more fields are present.
+ +

Definition at line 1286 of file unirec.c.

+ +
+
+ +

◆ ur_iter_fields_record_order()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ur_iter_t ur_iter_fields_record_order (const ur_template_ttmplt,
int index 
)
+
+ +

Iterate over fields of a template This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template. Example usage: int i = 0; while ((id = ur_iter_fields(&tmplt, i++)) != UR_ITER_END) { ... } The order of fields is given by the order in the record.

+
Parameters
+ + + +
[in]tmpltTemplate to iterate over.
[in]indexField ID returned in last iteration or UR_ITER_BEGIN to get first value.
+
+
+
Returns
Field ID of the next field or UR_ITER_END if no more fields are present.
+ +

Definition at line 1306 of file unirec.c.

+ +
+
+ +

◆ ur_print_template()

+ +
+
+ + + + + + + + +
void ur_print_template (ur_template_ttmplt)
+
+ +

Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging). If template does not contain any dynamic fields, print '-' instead. param[in] tmplt pointer to the template.

+ +

Definition at line 1115 of file unirec.c.

+ +
+
+ +

◆ ur_rec_varlen_size()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint16_t ur_rec_varlen_size (const ur_template_ttmplt,
const void * rec 
)
+
+ +

Get size of variable sized part of UniRec record Get total size of all variable-length fields in an UniRec record.

+
Parameters
+ + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the record
+
+
+
Returns
Size of the variable part of UniRec record.
+ +

Definition at line 1204 of file unirec.c.

+ +
+
+ +

◆ ur_set_array_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ur_set_array_from_string (const ur_template_ttmpl,
void * data,
ur_field_id_t f_id,
const char * v 
)
+
+ +

Set value of a UniRec array field.

+
Parameters
+ + + + + +
[in]tmplPointer to UniRec template
[out]dataPointer to the beginning of a record
[in]f_idIdentifier of a field. It must be a constant beginning with UR_, not its numeric value.
[in]vThe value the field should be set to, array of fields with ' ' space delimiter.
+
+
+
Returns
0 on success, non-zero otherwise.
+ +

Definition at line 1315 of file unirec.c.

+ +
+
+ +

◆ ur_set_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ur_set_from_string (const ur_template_ttmpl,
void * data,
ur_field_id_t f_id,
const char * v 
)
+
+ +

Set value of a UniRec field.

+
Parameters
+ + + + + +
[in]tmplPointer to UniRec template
[out]dataPointer to the beginning of a record
[in]f_idIdentifier of a field. It must be a constant beginning with UR_, not its numeric value.
[in]vThe value the field should be set to.
+
+
+
Returns
0 on success, non-zero otherwise.
+ +

Definition at line 1487 of file unirec.c.

+ +
+
+ +

◆ ur_set_var()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ur_set_var (const ur_template_ttmplt,
void * rec,
int field_id,
const void * val_ptr,
int val_len 
)
+
+ +

Set content of variable-length UniRec field Copy given data into variable-length UniRec field, set its offset and length in a record and move data which are behind this field. For better performance use function ur_clear_varlen, before setting all variable fields in record.

+
Parameters
+ + + + + + +
[in]tmpltPointer to UniRec template
[in]recPointer to the beginning of a record.
[in]field_idIdentifier of a field.
[in]val_ptrPointer to data which should be copied into the record.
[in]val_lenLength of the copied data in bytes.
+
+
+
Returns
UR_OK if there is no problem. UR_E_INVALID_FIELD_ID if the ID is not in the template.
+ +

Definition at line 1152 of file unirec.c.

+ +
+
+ +

◆ ur_template_compare()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int ur_template_compare (const ur_template_ttmpltA,
const ur_template_ttmpltB 
)
+
+ +

Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is not compared).

+
Note
Function does not check if arguments are valid UniRec templates. Caller must check validity before calling this function. Return value is undefined when any argument IS NOT a valid UniRec template (i.e. some of its field is redefined, etc).
+
Parameters
+ + + +
[in]tmpltAPointer to the first template.
[in]tmpltBPointer to the second template.
+
+
+
Returns
Returns non-zero (1) value if templates matches. Otherwise, it returns 0.
+ +

Definition at line 1104 of file unirec.c.

+ +
+
+ +

◆ ur_template_string_delimiter()

+ +
+
+ + + + + + + + + + + + + + + + + + +
char* ur_template_string_delimiter (const ur_template_ttmplt,
int delimiter 
)
+
+ +

Get UniRec specifier of the tmplt template with delimiter between fields.

+

Get names and sizes of fields separated by given delimiter.

+

Example:

ipaddr DST_IP,ipaddr SRC_IP
Parameters
+ + + +
[in]tmpltPointer to UniRec template
[in]delimiterDelimiter that is placed between the UniRec fields in the template specifier.
+
+
+
Returns
String containing list of fields and their types.
+
Note
Caller must free the returned memory.
+ +

Definition at line 253 of file unirec.c.

+ +
+
+ +

◆ ur_undefine_field()

+ +
+
+ + + + + + + + +
int ur_undefine_field (const char * name)
+
+ +

Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated.

+
Parameters
+ + +
[in]nameName of a field.
+
+
+
Returns
UR_E_MEMORY if there is an allocation problem. UR_E_INVALID_PARAMETER if the field was not created at run-time or the field_id does not exist.
+ +

Definition at line 720 of file unirec.c.

+ +
+
+ +

◆ ur_undefine_field_by_id()

+ +
+
+ + + + + + + + +
int ur_undefine_field_by_id (ur_field_id_t field_id)
+
+ +

Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated.

+
Parameters
+ + +
[in]field_idIdentifier of a field.
+
+
+
Returns
UR_E_MEMORY if there is an allocation problem. UR_E_INVALID_PARAMETER if the field was not created at run-time or the field_id does not exist.
+ +

Definition at line 695 of file unirec.c.

+ +
+
+ +

◆ ur_values_get_description_start_end()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
const char* ur_values_get_description_start_end (uint32_t start,
uint32_t end,
int32_t value 
)
+
+ +

Returns description of specified value (Helper function) Helper function for ur_values_get_description. This function returns description of specified value and field, which is defined in values file. Function needs start and end index of a field.

+
Parameters
+ + + + +
[in]startIndex of first item to search the value in ur_values array
[in]endIndex of last item to search the value in ur_values array
[in]valueValue of an item to find
+
+
+
Returns
Pointer to string or NULL if the value was not found
+ +

Definition at line 1676 of file unirec.c.

+ +
+
+ +

◆ ur_values_get_name_start_end()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
const char* ur_values_get_name_start_end (uint32_t start,
uint32_t end,
int32_t value 
)
+
+ +

Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field.

+
Parameters
+ + + + +
[in]startIndex of first item to search the value in ur_values array
[in]endIndex of last item to search the value in ur_values array
[in]valueValue of an item to find.
+
+
+
Returns
Pointer to string or NULL if the value was not found
+ +

Definition at line 1666 of file unirec.c.

+ +
+
+

Variable Documentation

+ +

◆ ur_field_array_elem_type

+ +
+
+ + + + +
int ur_field_array_elem_type[]
+
+ +

UniRec array element types.

+

Used to get type of an array element. Can be indexed using UR_TYPE_*.

+

UniRec array element types.

+ +

Definition at line 168 of file unirec.c.

+ +
+
+ +

◆ ur_field_specs

+ +
+
+ + + + +
ur_field_specs_t ur_field_specs
+
+ +

Structure that lists UniRec field specifications such as names, types, id.

+ +

Definition at line 201 of file unirec.c.

+ +
+
+ +

◆ UR_FIELD_SPECS_STATIC

+ +
+
+ + + + +
ur_static_field_specs_t UR_FIELD_SPECS_STATIC
+
+ +

Structure that lists staticaly defined UniRec field specifications such as names, types, id (using UR_FIELDS()).

+ +

Definition at line 202 of file unirec.c.

+ +
+
+ +

◆ ur_field_type_size

+ +
+
+ + + + +
const int ur_field_type_size[]
+
+ +

Sizes of UniRec data types.

+

Data types are defined in the ur_field_type_str array.

+ +

Definition at line 94 of file unirec.c.

+ +
+
+ +

◆ ur_field_type_str

+ +
+
+ + + + +
const char* ur_field_type_str[]
+
+ +

UniRec data types.

+

Sizes of data types are defined in the ur_field_type_size array.

+ +

Definition at line 133 of file unirec.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/group__urtime.html b/doc/unirec/group__urtime.html new file mode 100644 index 00000000..2f4653c4 --- /dev/null +++ b/doc/unirec/group__urtime.html @@ -0,0 +1,580 @@ + + + + + + + +UniRec: Timestamps API + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
Timestamps API
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define UR_TIME_NSEC_TO_FRAC   0x44B82FA0AULL
 
#define ur_time_from_sec_nsec(sec, nsec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (nsec) * UR_TIME_NSEC_TO_FRAC) >> 32))
 Convert seconds and nanoseconds to ur_time_t. More...
 
#define ur_time_from_sec_usec(sec, usec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (usec) * 1000 * UR_TIME_NSEC_TO_FRAC) >> 32))
 Convert seconds and microseconds to ur_time_t. More...
 
#define ur_time_from_sec_msec(sec, msec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (msec) * 1000000 * UR_TIME_NSEC_TO_FRAC) >> 32))
 Convert seconds and milliseconds to ur_time_t. More...
 
#define ur_time_get_sec(time)   (uint32_t) ((uint64_t) (time) >> 32)
 Get number of seconds from ur_time_t. More...
 
#define ur_time_get_nsec(time)   (uint32_t) ((((uint64_t) (time) & 0xffffffff) * 1000000000ULL + 0xffffffff) >> 32)
 Get number of nanoseconds from ur_time_t. More...
 
#define ur_time_get_usec(time)   (uint32_t) (ur_time_get_nsec(time) / 1000)
 Get number of microeconds from ur_time_t. More...
 
#define ur_time_get_msec(time)   (uint32_t) (ur_time_get_nsec(time) / 1000000)
 Get number of milliseconds from ur_time_t. More...
 
+ + + + +

+Typedefs

typedef uint64_t ur_time_t
 Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoch in 64bit fixed point number (32bit integral part, 32bit fraction part). More...
 
+ + + + + + + + + +

+Functions

static uint64_t ur_timediff (ur_time_t a, ur_time_t b)
 
static uint64_t ur_timediff_us (ur_time_t a, ur_time_t b)
 
static uint64_t ur_timediff_ns (ur_time_t a, ur_time_t b)
 
uint8_t ur_time_from_string (ur_time_t *ur, const char *str)
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ ur_time_from_sec_msec

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_time_from_sec_msec( sec,
 msec 
)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (msec) * 1000000 * UR_TIME_NSEC_TO_FRAC) >> 32))
+
+ +

Convert seconds and milliseconds to ur_time_t.

+
Parameters
+ + + +
secseconds
msecmilliseconds
+
+
+
Returns
UniRec timestamp (ur_time_t)
+ +

Definition at line 116 of file ur_time.h.

+ +
+
+ +

◆ ur_time_from_sec_nsec

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_time_from_sec_nsec( sec,
 nsec 
)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (nsec) * UR_TIME_NSEC_TO_FRAC) >> 32))
+
+ +

Convert seconds and nanoseconds to ur_time_t.

+
Parameters
+ + + +
secseconds
nsecnanoseconds
+
+
+
Returns
UniRec timestamp (ur_time_t)
+ +

Definition at line 100 of file ur_time.h.

+ +
+
+ +

◆ ur_time_from_sec_usec

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define ur_time_from_sec_usec( sec,
 usec 
)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (usec) * 1000 * UR_TIME_NSEC_TO_FRAC) >> 32))
+
+ +

Convert seconds and microseconds to ur_time_t.

+
Parameters
+ + + +
secseconds
usecmicroseconds
+
+
+
Returns
UniRec timestamp (ur_time_t)
+ +

Definition at line 108 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_msec

+ +
+
+ + + + + + + + +
#define ur_time_get_msec( time)   (uint32_t) (ur_time_get_nsec(time) / 1000000)
+
+ +

Get number of milliseconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
milliseconds
+ +

Definition at line 146 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_nsec

+ +
+
+ + + + + + + + +
#define ur_time_get_nsec( time)   (uint32_t) ((((uint64_t) (time) & 0xffffffff) * 1000000000ULL + 0xffffffff) >> 32)
+
+ +

Get number of nanoseconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
nanoseconds
+ +

Definition at line 132 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_sec

+ +
+
+ + + + + + + + +
#define ur_time_get_sec( time)   (uint32_t) ((uint64_t) (time) >> 32)
+
+ +

Get number of seconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
seconds
+ +

Definition at line 124 of file ur_time.h.

+ +
+
+ +

◆ ur_time_get_usec

+ +
+
+ + + + + + + + +
#define ur_time_get_usec( time)   (uint32_t) (ur_time_get_nsec(time) / 1000)
+
+ +

Get number of microeconds from ur_time_t.

+
Parameters
+ + +
timeUniRec timestamp
+
+
+
Returns
microseconds
+ +

Definition at line 139 of file ur_time.h.

+ +
+
+ +

◆ UR_TIME_NSEC_TO_FRAC

+ +
+
+ + + + +
#define UR_TIME_NSEC_TO_FRAC   0x44B82FA0AULL
+
+

Constant used to convert nanoseconds to fraction of second on 32 bits. Its value is 2^32/1e9 in fixed-point notation, which is (2^32/1e9)*2^32 = 2^64/1e9 (rounded).

+ +

Definition at line 67 of file ur_time.h.

+ +
+
+

Typedef Documentation

+ +

◆ ur_time_t

+ +
+
+ + + + +
typedef uint64_t ur_time_t
+
+ +

Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoch in 64bit fixed point number (32bit integral part, 32bit fraction part).

+ +

Definition at line 61 of file ur_time.h.

+ +
+
+

Function Documentation

+ +

◆ ur_time_from_string()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint8_t ur_time_from_string (ur_time_tur,
const char * str 
)
+
+

Convert string value str into UniRec time ur.

+
Parameters
+ + + +
[out]urTarget pointer to store result.
[in]strString in the following format: 2018-06-27T16:52:54 or 2018-06-27T16:52:54.500, str may end with "Z" (2018-06-27T16:52:54Z or 2018-06-27T16:52:54.500Z) indicating UTC timezone explicitly. UTC is recommended and should be used in any case.
+
+
+
Returns
0 on success, 1 is returned on parsing error (malformed format of str) and ur is set to 0, 2 on bad parameter (NULL was passed).
+ +

Definition at line 1606 of file unirec.c.

+ +
+
+ +

◆ ur_timediff()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static uint64_t ur_timediff (ur_time_t a,
ur_time_t b 
)
+
+inlinestatic
+
+

Return a time difference between A and B in miliseconds.

+
Parameters
+ + + +
[in]aTimestamp A
[in]bTimestamp B
+
+
+
Returns
abs(A - B), the result is in miliseconds.
+ +

Definition at line 157 of file ur_time.h.

+ +
+
+ +

◆ ur_timediff_ns()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static uint64_t ur_timediff_ns (ur_time_t a,
ur_time_t b 
)
+
+inlinestatic
+
+

Return a time difference between A and B in nanoseconds.

+
Parameters
+ + + +
[in]aTimestamp A
[in]bTimestamp B
+
+
+
Returns
abs(A - B), the result is in nanoseconds.
+ +

Definition at line 183 of file ur_time.h.

+ +
+
+ +

◆ ur_timediff_us()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static uint64_t ur_timediff_us (ur_time_t a,
ur_time_t b 
)
+
+inlinestatic
+
+

Return a time difference between A and B in microseconds.

+
Parameters
+ + + +
[in]aTimestamp A
[in]bTimestamp B
+
+
+
Returns
abs(A - B), the result is in microseconds.
+ +

Definition at line 170 of file ur_time.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/index.html b/doc/unirec/index.html new file mode 100644 index 00000000..d6a4c96d --- /dev/null +++ b/doc/unirec/index.html @@ -0,0 +1,90 @@ + + + + + + + +UniRec: UniRec: Content of documentation + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
UniRec: Content of documentation
+
+
+

For more comprehensive description, read this UniRec page.

+

This documentation is divided into the following main sections:

+
+ + + + diff --git a/doc/unirec/index_8txt.html b/doc/unirec/index_8txt.html new file mode 100644 index 00000000..e610e9b9 --- /dev/null +++ b/doc/unirec/index_8txt.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: doc/index.txt File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
doc/index.txt File Reference
+
+
+
+ + + + diff --git a/doc/unirec/inline_8h.html b/doc/unirec/inline_8h.html new file mode 100644 index 00000000..ab158564 --- /dev/null +++ b/doc/unirec/inline_8h.html @@ -0,0 +1,122 @@ + + + + + + + +UniRec: inline.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
inline.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Macros

#define INLINE   static inline
 
#define INLINE_IMPL   inline
 
+

Macro Definition Documentation

+ +

◆ INLINE

+ +
+
+ + + + +
#define INLINE   static inline
+
+ +

Definition at line 12 of file inline.h.

+ +
+
+ +

◆ INLINE_IMPL

+ +
+
+ + + + +
#define INLINE_IMPL   inline
+
+ +

Definition at line 13 of file inline.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/inline_8h_source.html b/doc/unirec/inline_8h_source.html new file mode 100644 index 00000000..e6d47b4b --- /dev/null +++ b/doc/unirec/inline_8h_source.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: inline.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
inline.h
+
+
+Go to the documentation of this file.
1 #ifndef _INLINE_H_
2 #define _INLINE_H_
3 
4 // C90 and C99 interprets external linkability of inline function differently.
5 // Use INLINE and INLINE_IMPL macros to get the same behavior regardless of
6 // of the C standard used.
7 // Note: Probably works only with gcc
8 #ifdef __GNUC_STDC_INLINE__ // C99
9 #define INLINE inline
10 #define INLINE_IMPL extern inline
11 #else // C90
12 #define INLINE static inline
13 #define INLINE_IMPL inline
14 #endif
15 
16 #endif
+ + + + diff --git a/doc/unirec/intro_8md.html b/doc/unirec/intro_8md.html new file mode 100644 index 00000000..ef47083c --- /dev/null +++ b/doc/unirec/intro_8md.html @@ -0,0 +1,79 @@ + + + + + + + +UniRec: doc/intro.md File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
doc/intro.md File Reference
+
+ + + + + diff --git a/doc/unirec/intro_8md_source.html b/doc/unirec/intro_8md_source.html new file mode 100644 index 00000000..53304ff5 --- /dev/null +++ b/doc/unirec/intro_8md_source.html @@ -0,0 +1,77 @@ + + + + + + + +UniRec: doc/intro.md Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
doc/intro.md
+
+
+Go to the documentation of this file.
1 UniRec
2 =======
3 
4 Overview
5 --------
6 UniRec is a data format for storage and transfer of simple unstructured records,
7 i.e. sets of key-value pairs with a fixed set of keys. A record in UniRec format
8 is similar to a C structure but it can be defined at run-time. It thus brings
9 possibility to dynamically create structures in a statically typed language.
10 
11 The main advantage of UniRec is extremely fast access to fields of a record.
12 No parsing is needed, the fields are accessed directly from the record, almost
13 as in a plain C struct.
14 
15 In comparison with access to a struct member, just one additional memory
16 access is needed in order to find position of the field in the record. This
17 access is to a small table which easily fits into a CPU cache.
18 
19 To create an UniRec record, a user first needs to specify a set of fields and
20 their types - a template. Then a memory for the record is allocated and field
21 values can be set using simple macros.
22 
23 NOTE: The following text describes UniRec as used in the C or C++ language.
24 
25 ### Simplified example:
26 
27 ```
28 // Create a template with three fields (their types must be defined earlier)
29 ur_template_t *tmplt = ur_create_template("FIELD1,FIELD2,FIELD3", NULL);
30 
31 // Create a record with that template
32 void *record = ur_create_record(tmplt, 0);
33 
34 // Set values of fields
35 ur_set(tmplt, record, F_FIELD1, 1);
36 ur_set(tmplt, record, F_FIELD2, 234);
37 ur_set(tmplt, record, F_FIELD3, 56);
38 
39 // Read values of the record and print them to standard output
40 printf("%i %i %i\n",
41  ur_get(tmplt, record, F_FIELD1),
42  ur_get(tmplt, record, F_FIELD2),
43  ur_get(tmplt, record, F_FIELD3),
44 );
45 ```
46 
47 The example states that the types of the fields must be defined before a
48 template can be created. If names and types of the fields are known at
49 compile-time, they can be defined at the beginning of a *.c file as in the
50 following example:
51 ```
52 // Specify which fields will be used in the code and what are their types
53 UR_FIELDS(
54  int32 FIELD1,
55  int32 FIELD2,
56  int32 FIELD3,
57 )
58 ```
59 If the set of fields and their types is not known in advance, they may also be
60 defined at run-time. However, access to such fields is then a little more
61 complicated due to limitations of statically types languages (if a compiler
62 doesn't know the type of a field, it can't create a set of instructions to read
63 from or write into it).
64 
65 
66 UniRec data types
67 -----------------
68 
69 An UniRec field may have one of the following types:
70 
71 |name |size| description |
72 |--------|----|--------------------------------------------------------------|
73 |int8 | 1 |8bit singed integer |
74 |int16 | 2 |16bit singed integer |
75 |int32 | 4 |32bit singed integer |
76 |int64 | 8 |64bit singed integer |
77 |uint8 | 1 |8bit unsigned integer |
78 |uint16 | 2 |16bit unsigned integer |
79 |uint32 | 4 |32bit unsigned integer |
80 |uint64 | 8 |64bit unsigned integer |
81 |char | 1 |A single ASCII character |
82 |float | 4 |Single precision floating point number (IEEE 754) |
83 |double | 8 |Double precision floating point number (IEEE 754) |
84 |ipaddr | 16 |Special type for IPv4/IPv6 addresses, see below for details |
85 |macaddr | 6 |Special type for MAC address, see below for details |
86 |time | 8 |Special type for precise timestamps, see below for details |
87 |string | - |Variable-length array of (mostly) printable characters |
88 |bytes | - |Variable-length array of bytes (not expected to be printable characters) |
89 
90 
91 Types "string" and "bytes" are the same from a machine point of view (both are
92 of type char[] in C), the only difference is their semantics. When printing
93 as text, "string" is usually printed directly as ASCII or UTF-8 string,
94 "bytes" is rather interpreted as binary data and printed in hex.
95 
96 A terminating null character ('\0') SHOULD NOT be included at the end of
97 "string" values since this is specific for the C language and data in UniRec
98 should be independent of a programming language.
99 
100 ### ipaddr type
101 Structure to store both IPv4 and IPv6 addresses and associated functions.
102 
103 ### macaddr type
104 Structure to store MAC address and associated functions.
105 
106 ### time type
107 Structure to store timestamps and associated types, macros and function.
108 
109 
110 Field names
111 -----------
112 
113 Name of field may be any string matching the regular expression
114  [A-Za-z][A-Za-z0-9_]*
115 with the following limitations:
116  - It SHOULD NOT end with "_T" as this is reserved in C implementation for
117  symbolic constants storing the type of a field.
118 
119 It is RECOMMENDED that all field names are uppercase.
120 
121 Physical record layout
122 ----------------------
123 
124 An UniRec record consists of field values put one after another in a specific
125 order. There is no header. Information about the template and the size of the
126 record must be provided by other means.
127 
128 The layout of a record is given only by its template (specifying a set of fields
129 and their types) and the following rules.
130 
131 A record is divided into three sections:
132  1. Values of all fixed-length fields
133  2. Meta-information about variable-length fields
134  3. Data of variable-length fields
135 
136 Fixed-length fields in the first section are sorted by their size from largest
137 to smallest. Fields with the same size are sorted alphabetically by their name.
138 
139 The second section contains two 16bit numbers for each variable-length field -
140 offset of the beginning of the field's data and length of the data (in bytes).
141 The offset is counted from the beginning of the record.
142 
143 The meta-information fields are sorted alphabetically by the field names.
144 
145 The third section contains data of variable-length fields in an arbitrary order.
146 The data of variable-length fields SHOULD be placed immediately one after
147 another. There SHOULD be NO "empty spaces" between them and data of the fields
148 SHOULD NOT overlap.
149 
150 The first two sections are called the "fixed-length part" of a record, since their
151 total size is always the same and all data are present on fixed offsets (for a
152 given template). The last section is called "variable-length part" because its total
153 length as well as position of individual fields may be different in each record.
154 
155 ### Example
156 
157 The following picture shows layout of a record containing information about a
158 HTTP connection. The template of this record contains the following fields:
159  ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT,
160  uint8 PROTOCOL, uint8 TCP_FLAGS, uint32 PACKETS, uint32 BYTES,
161  uint16 HTTP_RSP_CODE, string HTTP_URL, string HTTP_USER_AGENT
162 
163 ```
164 byte 0 1 2 3
165  +-------+-------+-------+-------+
166  0 | |
167  4 | DST_IP |
168  8 | |
169 12 | |
170  +-------+-------+-------+-------+
171 16 | |
172 20 | SRC_IP |
173 24 | |
174 28 | |
175  +-------+-------+-------+-------+
176 32 | BYTES |
177  +-------+-------+-------+-------+
178 36 | PACKETS |
179  +-------+-------+-------+-------+
180 40 | DST_PORT | HTTP_RSP_CODE |
181  +-------+-------+-------+-------+
182 44 | SRC_PORT | PROTO | TCP_F |
183  +-------+-------+-------+-------+
184 48 | HTTP_URL(off) | HTTP_URL(len) |
185  +-------+-------+-------+-------+
186 52 | HTTP_USER(off)| HTTP_USER(len)| fixed-length
187  +-------+-------+-------+-------+ -----------------
188 56 | HTTP_URL (data) | variable-length part
189  + +-------+
190 60 | | |
191  +-------+-------+-------+ +
192 64 | HTTP_USER_AGENT (data) |
193  + +-------+-------+
194 68 | |
195  +-------+-------+
196 ```
197 
198 
199 ### Endianness
200 
201 All values, except IP and MAC addresses, are in little endian. IP and MAC addresses are treated
202 rather as sequences of bytes than numbers, so they are left in network order,
203 i.e. big-endian (however, they are encapsulated in a special data type and
204 shouldn't be accessed directly so the internal format should be needed to know).
205 
206 
207 ### Maximal record length
208 
209 Maximal length of the record is limited to 65534 (2^16 - 2) bytes.
210 
211 
212 ### Template definition
213 
214 Templates are usually defined by a string enumerating all the fields in the
215 template, using comma (',') as a separator of field names. Order of field names
216 in such string is not important (since physical order of fields is given by the
217 rules above).
218 
219 C library interface
220 ===================
221 
222 Types and structures
223 --------------------
224 
225 Types, enums and structures defined in unirec.h.
226 ```
227 enum ur_field_type {
228  UR_TYPE_INT8,
229  UR_TYPE_INT16,
230  UR_TYPE_INT32,
231  UR_TYPE_INT64,
232  UR_TYPE_UINT8,
233  UR_TYPE_UINT16,
234  UR_TYPE_UINT32,
235  UR_TYPE_UINT64,
236  UR_TYPE_CHAR,
237  UR_TYPE_FLOAT,
238  UR_TYPE_DOUBLE,
239  UR_TYPE_IP,
240  UR_TYPE_MAC,
241  UR_TYPE_TIME,
242  UR_TYPE_STRING,
243  UR_TYPE_BYTES,
244 };
245 ```
246  An enum value for each of the UniRec types.
247 
248 #### ur_field_id_t
249 Unsigned integer type for holding field IDs.
250 IMPLEMENTATION NOTE: ur_field_id_t = uint16_t
251 
252 #### ur_template_t
253 A structure defining an UniRec template. It contains information about which
254 fields are present in a record with that template and how to access them.
255 For user this is a black box, it is not needed to access the structure's
256 members directly.
257 
258 #### ur_iter_t
259 Iterator type used by ur_iter_fields function
260 
261 #### UR_ITER_BEGIN
262 #### UR_ITER_END
263 Constants used for iteration over fields in a template, see ur_iter_fields
264 function for details.
265 
266 
267 #### UR_MAX_SIZE = 65535
268  Maximal size of an UniRec record.
269 
270 Public functions and macros
271 ---------------------------
272 
273 ### Definition of statically-known UniRec fields.
274 ```
275 UR_FIELDS(type name [, type name [, ...] ])
276 ```
277 This macro allows to define fields used in the program and their types at
278 compile-time. This allows to access such fields in UniRec records more easily
279 and efficiently.
280 
281 This macro should be used in the beginning of each translation unit (i.e. a *.c
282 file) if the fields used (or at least some of them) are known at compile-time.
283 
284 Parameters:
285 - "name" may be any string matching the following regular expression:
286  [A-Za-z][A-Za-z0-9_]*
287  with the following exceptions:
288  - It must not be the same as a keyword in C/C++ or another identifier used in the source codes.
289  To avoid collisions with other identifiers in the UniRec library, do not use
290  identifiers beginning with "UR\_" or "ur\_"
291  - It must not end with _T (as this is reserved for constants specifying types)
292  - It is RECOMMENDED that all field names are upper case.
293 - "type" is one of the types specified in "format specification - data types".
294 
295 There MAY be a comma after the last field name. Also, there MAY be a semicolon
296 after the closing parenthesis at the end of the macro.
297 
298 #### Example:
299 ```
300 UR_FIELDS(
301  ipaddr SRC_IP,
302  ipaddr DST_IP,
303  uint16 SRC_PORT,
304  uint16 DST_PORT,
305  uint8 PROTO,
306 )
307 ```
308 This macro generates code allowing to use the defined fields in ur_get, ur_set
309 and other macros which need symbolic constants to access the fields.
310 
311 For each field specified by this macro, a CPP macro is defined with `F_` prefix
312 in the name and a value of a unique numeric ID. Also, a constant F_name_T is
313 defined with a value of the field's type (as defined in ur_field_type enum).
314 Other internal variables and structures are defined.
315 
316 If there are more than one translation unit accessing UniRec fields, the same set
317 of fields MUST be defined using UR_FIELDS in each of them.
318 
319 
320 ### Cleanup of all internal structures.
321 ```
322 int ur_finalize()
323 ```
324 This function has to be called after all UniRec functions and macros
325 invocations if there were some fields defined at run-time. Otherwise this function
326 does not have any effect, because nothing has been allocated. The function is called
327 typically during a cleanup phase before the program's end.
328 
329 No UniRec function or macro can be called after a call to ur_finalize.
330 
331 
332 ### Run-time definition of a field
333 ```
334 int ur_define_field(const char *name, ur_field_type type)
335 ```
336 This function allows to define a field at run-time.
337 
338 Parameters:
339 "name" - name of the new field, see description of UR_FIELDS for rules on
340 field names.
341 "type" - type of the new field.
342 
343 If a field with the same name already exists in the internal table of defined
344 fields and "type" is the same as the one in the table, the function just returns
345 the ID of the field. If types does not match, a UR_E_TYPE_MISMATCH error code
346 is returned.
347 
348 If no field with "name" is present in the table of fields, a new entry is
349 created with a new unique ID and the given name and type of the field.
350 The new ID is returned.
351 
352 Returns:
353 - ID of a field with the given name if no error occurs.
354 - UR_E_TYPE_MISMATCH if a field with the given name is already defined with a
355  different type.
356 - UR_E_INVALID_NAME if the name is not a valid field name.
357 - UR_E_INVALID_TYPE if the type is not one of the values of enum ur_field_type.
358 - UR_E_MEMORY if memory allocation error occurred.
359 
360 All error codes returned by this function are negative integers, ID is always
361 non-negative.
362 
363 If this function is used in a program, the function ur_finalize() has to be
364 called after all UniRec functions and macros invocations.
365 
366 NOTE: It is not necessary to define fields which were defined by UR_FIELDS.
367 It is recommended to define all fields statically by UR_FIELDS if possible.
368 This function is present only for cases when field names and/or types are not
369 known until run-time.
370 
371 NOTE: Fields defined by this function can be accessed using their numeric IDs
372 only. Symbolic CPP macros are not defined, of course.
373 
374 
375 ### Run-time definition of a set of fields
376 
377 ```
378 int ur_define_set_of_fields(const char *ifc_data_fmt);
379 ```
380 
381 This function allows to define sef of fields at run-time.
382 
383 Define new UniRec fields at run-time. It adds new fields into existing structures.
384 If the field already exists and type is equal nothing will happen. If the type is not equal
385 an error will be returned.
386 
387 Parameters:
388 "fc_data_fmt" - String containing types and names of fields delimited by comma.
389 Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2"
390 
391 
392 Returns:
393 - UR_OK on success
394 - UR_E_MEMORY if there is an allocation problem.
395 - UR_E_INVALID_NAME if the name value is empty.
396 - UR_E_INVALID_TYPE if the type does not exist.
397 - UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
398 
399 
400 ### Undefine field
401 ```
402 int ur_undefine_field(const char *name)
403 int ur_undefine_field_by_id(ur_field_id_t id)
404 ```
405 Allows to revert a previous definition of a field by ur_define_field.
406 
407 Frees the ID of the given field for future re-use. The ID becomes invalid after
408 a call to this function so the field with the given name can not be accessed
409 any more. Note that the same ID may be assigned to another field later.
410 
411 This function is not necessary in most cases. Its only purpose is to allow a
412 re-use of field IDs since their total count is limited to 2^16-1.
413 
414 After this function is used, all the templates using the undefined field have to
415 freed and created again.
416 
417 
418 ### Create UniRec template
419 ```
420 ur_template_t *ur_create_template(const char* fields, char **errstr)
421 ```
422 Creates a structure describing an UniRec template with the given set of fields
423 and returns a pointer to it.
424 
425 The template should be freed by ur_free_template after is not needed any more.
426 
427 Parameters:
428 - "fields" - A string containing names of fields separated by commas, e.g.:
429 "FOO,BAR,BAZ"
430 - "errstr" - (output) In case of an error a pointer to the error message is
431 returned using this parameter, if not set to NULL.
432 
433 Order of field names is not important, i.e. any two strings with the same set of
434 field names but with different order are equivalent.
435 
436 All fields MUST be previously defined, either statically by UR_FIELDS or by
437 calls to ur_define_field.
438 
439 If an error occurs and "errstr" is not NULL, it is set to a string with
440 corresponding error message.
441 
442 
443 Returns:
444 - Pointer to the newly created template or NULL if an error has occurred.
445 
446 
447 ### Create UniRec template for usage with Libtrap
448 ```
449 ur_template_t *ur_create_input_template(int ifc, const char* fields, char **errstr)
450 ```
451 Creates UniRec template and set this template to specified input interface (ifc).
452 
453 This template will be set as a minimum set of fields to be able to receive messages.
454 If the input interface receives superset of fields, the template will be expanded.
455 
456 ```
457 ur_template_t *ur_create_output_template(int ifc, const char* fields, char **errstr)
458 ```
459 Creates UniRec template and set this template to specified output interface (ifc).
460 
461 Set of fields of this template will be set to an output interface.
462 
463 ```
464 ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char* fields, char **errstr)
465 ```
466 Creates UniRec template and set this template to specified input (ifc_in) and output (ifc_out) interface.
467 
468 This template will be set as a minimum set of fields to be able to receive messages.
469 If the input interface receives superset of fields, the template will be expanded and
470 new set of fields will be set to output interface.
471 
472 
473 ### Free UniRec template
474 ```
475 void *ur_free_template(ur_template_t *tmplt)
476 ```
477 Free memory allocated for a template.
478 
479 
480 
481 ### Retrieve value from UniRec record.
482 Following functions are used to retrieve certain field value from UniRec record.
483 
484 Parameters:
485 - "tmplt" - Pointer to UniRec template
486 - "rec" - Pointer to UniRec record, which is created using given template.
487 - "field" - Identifier of a field.
488 
489 ```
490 ur_get(tmplt, rec, field)
491 ```
492 This function returns value of an appropriate type of a specific field (int, uint, ...).
493 Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
494 It can be used just for fixed size fields (not for string and bytes).
495 
496 ```
497 ur_get_ptr(tmplt, rec, field)
498 ```
499 This function returns pointer to a value of an appropriate type. Because of this,
500 the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
501 It can be used for both fixed-length and variable-length fields.
502 
503 ```
504 ur_get_ptr_by_id(tmplt, rec, field)
505 ```
506 This function returns void pointer to a value. Field can be symbolic constant or
507 numerical ID. It can be used for both fixed-length and variable-length fields.
508 (This function is used for fields defined at run-time)
509 
510 ```
511 char* ur_get_var_as_str(tmplt, rec, field);
512 ```
513 Function copies data of a variable-length field from UniRec record and append '\0' character.
514 The function allocates new memory space for the string, it must be freed using free()!
515 Field can be symbolic constant or numerical ID.
516 
517 ### Set value to UniRec record.
518 Following functions are used to set a value to specified field in a record.
519 
520 Parameters:
521 - "tmplt" - Pointer to UniRec template
522 - "rec" - Pointer to UniRec record, which is created using given template.
523 - "field" - Identifier of a field.
524 - "value" - Value which is copied to the record.
525 
526 ```
527 ur_set(tmplt, rec, field, value) // field must be a symbolic constant ...
528 ```
529 This function assumes value of an appropriate type of a specific field (int, uint, ...).
530 Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID.
531 It can be used just for fixed size fields (not for string and bytes).
532 
533 To set dynamically defined field, use ur_get_ptr_by_id() and write to that pointer.
534 
535 ```
536 ur_set_var(tmplt, rec, field, val_ptr, val_len)
537 ```
538 This function is used to set variable-length fields. Field can be symbolic constant or
539 numerical ID.
540 For better performance use function ur_clear_varlen, before setting all variable fields in record.
541 
542 Parameters:
543 - "val_ptr" - Pointer to value.
544 - "val_len" - Length of a value. (length which will be copied)
545 
546 ```
547  ur_clear_varlen(tmplt, rec);
548 ```
549 This function will clear all variable-length fields. It can be used for better performance of setting
550 content to variable-length fields. Use this function before setting of all the variable-length
551 fields.
552 ```
553 ur_set_string(tmplt, rec, field, str) //
554 ```
555 Set string to the UniRec record. Value is a C-style string, length is determined
556 automatically by strlen() ('\0' is not included in the record)
557 
558 - "str" - Pointer to a string.
559 
560 ### Size of a fixed-length, static field
561 ```
562 ur_get_size(field) // field must be a symbolic constant ...; for static fields only
563 ```
564 Returns size of a field. Field has to be statically defined.
565 For variable-length fields it returns -1. To get size of variable-length field use
566 function ur_get_var_len().
567 
568 ### Size of variable-length field
569 ```
570 ur_get_var_len(tmplt, rec, field)
571 ```
572 Returns length of a variable-length field. Field can be symbolic constant or
573 numerical ID.
574 
575 ### Size of a fixed-length part of a record
576 ```
577 ur_rec_fixlen_size(tmplt)
578 ```
579 Returns size of a fixed-length part of a record.
580 
581 ### Size of a variable-length part of a record
582 ```
583 ur_rec_varlen_size(tmplt, rec)
584 ```
585 Returns size of a variable-length part of a record.
586 
587 ### Size of a record
588 ```
589 ur_rec_size(tmplt, rec)
590 ```
591 Returns total size of whole UniRec record.
592 
593 ### Check template's fields
594 ```
595 ur_is_present(tmplt, field)
596 ```
597 Returns non-zero if field is present, zero otherwise.
598 
599 ### Check type of a field (variable-length or fixed-length)
600 ```
601 ur_is_varlen(field)
602 ur_is_fixlen(field)
603 ```
604 Returns non-zero if field is dynamic, zero otherwise.
605 
606 ### ID of a field (dynamic or static)
607 ```
608 ur_field_id_t ur_get_id_by_name(const char *name);
609 ```
610 Function returns id of a field by name of the field, or UR_E_INVALID_NAME if
611 the name is not known.
612 
613 ### Create UniRec record
614 ```
615 void* ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size);
616 ```
617 Allocates memory for a record with given template. It allocates N+M bytes,
618 where N is the size of fixed-length part of the record (inferred from template),
619 and M is the size of variable-length, which must be provided by caller.
620 
621 Parameters:
622 - "tmplt" - Pointer to UniRec template.
623 - "max_var_size" - Size of variable-length part, i.e. sum of lengths of all variable-
624 length fields. If it is not known at the time of record creation, use
625 UR_MAX_SIZE, which allocates enough memory to hold the largest possible UniRec
626 record (65535 bytes). Set to 0 if there are no variable-length fields in the template
627 
628 ### Free UniRec record
629 ```
630 void ur_free_record(void *record);
631 ```
632 Free memory allocated for UniRec record. You can call system free() on the
633 record as well.
634 
635 ### Clone record
636 ```
637 ur_clone_record(tmplt, src)
638 ```
639 Function creates new UniRec record and fills it with the data given by parameter.
640 It returns Pointer to a new UniRec record.
641 
642 Parameters:
643 - "tmplt" Pointer to UniRec template
644 - "src" Pointer to source record
645 
646 
647 ### Copy fields
648 ```
649 void ur_copy_fields(dst_tmplt, dst, src_tmplt, src);
650 ```
651 
652 Copies all fields present in both templates from src to dst.
653 
654 The function compares src_tmplt and dst_tmplt and for each field present in both
655 templates it sets the value of field in dst to a corresponding value in src.
656 
657 Parameters:
658 - "dst_tmplt" - Pointer to destination UniRec template.
659 - "dst" - Pointer to destination record. It must point to a memory of enough size.
660 - "src_tmplt" - Pointer to source UniRec template.
661 - "src" - Pointer to source record.
662 
663 
664 ### Iterate over fields of a template
665 ```
666 ur_iter_fields(tmplt, id);
667 ```
668 This function can be used to iterate over all fields of a given template.
669 It returns ID of the next field present in the template after a given ID.
670 If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more
671 fields are present, UR_ITER_END is returned.The order of fields is given
672 by the order in which they are defined.
673 
674 The order of fields is given by the order in which they are defined.
675 
676 Parameters:
677 - "tmplt" - Pointer to a template to iterate over.
678 - "id" - Field ID returned in last iteration or UR_ITER_BEGIN to get first value.
679 
680 Returns ID of the next field or UR_ITER_END if no more fields are present.
681 
682 Example usage:
683 ```
684 ur_field_id_t id = UR_ITER_BEGIN;
685 while ((id = ur_iter_fields(tmplt, id)) != UR_ITER_END) {
686 ...
687 }
688 ```
689 
690 ```
691 ur_iter_fields_record_order(tmplt, id);
692 ```
693 
694 This function can be used to iterate over all fields of a given template.
695 It returns n-th ID of a record specified by index.
696 If the return value is UR_ITER_END. The index is higher than count of fields
697 in the template.
698 
699 The order of fields is given by the order in the record
700 Parameters:
701 - "tmplt" Template to iterate over.
702 - "id" Field ID returned in last iteration or UR_ITER_BEGIN to
703  get first value.
704 Returns ID of the next field or UR_ITER_END if no more fields are present.
705 
706 Example usage:
707 ```
708 int i = 0;
709 while ((id = ur_iter_fields_record_order(tmplt, i++)) != UR_ITER_END) {
710 ...
711 }
712 ```
+ + + + diff --git a/doc/unirec/ip__prefix__search_8c.html b/doc/unirec/ip__prefix__search_8c.html new file mode 100644 index 00000000..ec6d0b0a --- /dev/null +++ b/doc/unirec/ip__prefix__search_8c.html @@ -0,0 +1,878 @@ + + + + + + + +UniRec: ip_prefix_search.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
ip_prefix_search.c File Reference
+
+
+ +

Init and prefix search. +More...

+
#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include "ip_prefix_search.h"
+#include "ipps_internal.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

uint8_t bit_endian_swap (uint8_t in)
 
uint32_t ** create_ip_v6_net_mask_array ()
 
void destroy_ip_v6_net_mask_array (uint32_t **net_mask_array)
 
int cmp_net_v4 (const void *v1, const void *v2)
 
int cmp_net_v6 (const void *v1, const void *v2)
 
void mask_ipv6 (ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
 
void fill_interval_by_network (const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array)
 
ipps_interval_node_tnew_interval (const ip_addr_t *low_ip, const ip_addr_t *high_ip)
 
ipps_interval_node_tinsert_new_interval (ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip)
 
void ip_dec (const ip_addr_t *ip, ip_addr_t *ip_dec)
 
void ip_inc (const ip_addr_t *ip, ip_addr_t *ip_inc)
 
int ipps_destroy (ipps_context_t *prefix_context)
 
ipps_context_tnew_context ()
 
ipps_context_tipps_init (ipps_network_list_t *network_list)
 
int copy_all_data (ipps_interval_t *dest, ipps_interval_t *src)
 
int add_data (ipps_interval_t *interval, void *data, size_t data_len)
 
ipps_interval_tinit_context (ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array)
 
int ipps_search (ip_addr_t *ip, ipps_context_t *prefix_context, void ***data)
 
int free_data (ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt)
 
int destroy_list (ipps_interval_node_t *interval_list)
 
+

Detailed Description

+

Init and prefix search.

+
Author
Erik Sabik xsabi.nosp@m.k02@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Ondrej Ploteny xplot.nosp@m.e01@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
Date
2013
+
+2014
+
+2016
+ +

Definition in file ip_prefix_search.c.

+

Function Documentation

+ +

◆ add_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int add_data (ipps_interval_tinterval,
void * data,
size_t data_len 
)
+
+

Add data to interval data array Alloc memory size of 'data_len' and hard copy 'data'. Pointer to new data is insert to 'data_array' in interval structure 'interval', increment data counter. Realloc 'data_array' in 'interval' if there is not enough unused pointers

Parameters
+ + + + +
[in]intervalPointer to interval structure with data array and data counter
[in]dataPointer to same data
[in]data_lenNumber of bytes allocated in 'data' return 0 if OK, 1 if alloc fails
+
+
+ +

Definition at line 583 of file ip_prefix_search.c.

+ +
+
+ +

◆ bit_endian_swap()

+ +
+
+ + + + + + + + +
uint8_t bit_endian_swap (uint8_t in)
+
+

Function for swapping bits in byte.

Parameters
+ + +
[in]inInput byte.
+
+
+
Returns
Byte with reversed bits.
+ +

Definition at line 58 of file ip_prefix_search.c.

+ +
+
+ +

◆ cmp_net_v4()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int cmp_net_v4 (const void * v1,
const void * v2 
)
+
+

Compare 2 IPv4 network addresses and mask Compare byte by byte 2 IPv4 addresses. If they are equal, compare mask

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+ +

Definition at line 129 of file ip_prefix_search.c.

+ +
+
+ +

◆ cmp_net_v6()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int cmp_net_v6 (const void * v1,
const void * v2 
)
+
+

Compare 2 IPv6 network addresses and mask Compare byte by byte 2 IPv6 addresses. If they are equal, compare mask

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+ +

Definition at line 152 of file ip_prefix_search.c.

+ +
+
+ +

◆ copy_all_data()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int copy_all_data (ipps_interval_tdest,
ipps_interval_tsrc 
)
+
+

Append data in 'dest' with all data from 'src' interval Concat 'dest' and 'src' data_arrays: if necessary realloc destination data array. Copy all data pointers from src, behind last 'dest' data pointer

Parameters
+ + + +
[out]destPointer to destination interval
[in]srcPointer to source interval
+
+
+
Returns
0 if OK, 1 if data array realloc fails
+ +

Definition at line 553 of file ip_prefix_search.c.

+ +
+
+ +

◆ create_ip_v6_net_mask_array()

+ +
+
+ + + + + + + + +
uint32_t** create_ip_v6_net_mask_array (void )
+
+

Create 2D array for IPv6 networks mask Create 2D array net_mask_array with 129 rows and 4 columns and fill it with every possible IPv6 network mask.

Returns
Pointer to 2D array.
+ +

Definition at line 72 of file ip_prefix_search.c.

+ +
+
+ +

◆ destroy_ip_v6_net_mask_array()

+ +
+
+ + + + + + + + +
void destroy_ip_v6_net_mask_array (uint32_t ** net_mask_array)
+
+

Destroy 2D array for IPv6 networks mask Dealloc 2D array net_mask_array with 129 rows and 4 columns and free every possible IPv6 network mask.

Parameters
+ + +
[in]net_mask_arrayPointer to 2D array
+
+
+
Returns
void
+ +

Definition at line 113 of file ip_prefix_search.c.

+ +
+
+ +

◆ destroy_list()

+ +
+
+ + + + + + + + +
int destroy_list (ipps_interval_node_tinterval_list)
+
+

Dealloc interval list Dealloc all node in 'interval_list', dealloc data Function is call if something get wrong and program need clean garbage in the middle of run

Parameters
+ + +
[in]interval_listPointer to first node in list
+
+
+
Returns
0 if OK, 1 if data collector realloc fails
+ +

Definition at line 1041 of file ip_prefix_search.c.

+ +
+
+ +

◆ fill_interval_by_network()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void fill_interval_by_network (const ipps_network_tnet,
ipps_interval_tinter,
uint32_t ** net_mask_array 
)
+
+

Interval from network and mask Compute low and high IP address (net and broadcast address) from network 'net' using mask, save result to 'inter'

Parameters
+ + + + +
[in]netPointer to network structure
[out]interPointer to result interval
[in]net_mask_arrayPointer to 2D array with every possible net mask
+
+
+
Returns
void
+ +

Definition at line 194 of file ip_prefix_search.c.

+ +
+
+ +

◆ free_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int free_data (ipps_interval_tinterval,
void *** data_collector,
uint32_t * data_coll_cnt 
)
+
+

Dealloc 'data_array' in 'interval'

Parameters
+ + + + +
[in]intervalPointer to prefix interval structure
[out]data_collectorPointer to 2D array with freed data pointers
[out]data_collector_cntNumber of Pointers in 'data_collector'
+
+
+
Returns
0 if realloc is OK, 1 if realloc fail
+ +

Definition at line 1000 of file ip_prefix_search.c.

+ +
+
+ +

◆ init_context()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ipps_interval_t* init_context (ipps_network_t ** networks,
uint32_t network_count,
uint32_t * context_counter,
uint32_t ** net_mask_array 
)
+
+

Initialize array of intervals For each network in 'networks' array compute IP interval and insert it into interval list. All network data are hard copied. Overlapping intervals are split and sorted. If intervals are overlaps, data are allocated only once and pointer to data is duplicated. Overlapping is detected by comparing low and high IP addresses. At the end the sorted list is copied to an array for better access. Returns pointer to sorted array of intervals and fill 'context_counter' by number of intervals.

Parameters
+ + + + + +
[in]networksPointer to array of network structures
[in]network_countNumber of networks in array
[out]context_counterPointer to integer, fill by number of intervals in result
[in]net_mask_arrayPointer to 2D array of network mask
+
+
+
Returns
Pointer to array of interval structures, NULL if memory alloc fails
+ +

Definition at line 630 of file ip_prefix_search.c.

+ +
+
+ +

◆ insert_new_interval()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
ipps_interval_node_t* insert_new_interval (ipps_interval_node_tposition,
const ip_addr_tlow_ip,
const ip_addr_thigh_ip 
)
+
+

Post Insert to interval list Create new interval node and insert them for 'position' node. New created node is initialized and fill by 'low_ip' and 'high_ip' values.

Parameters
+ + + + +
[in]positionPointer to interval node structure, for post insert
[in]low_ipPointer to IP address structure
[in]high_ipPointer to IP address structure
+
+
+
Returns
Pointer to new inserted interval node in list, NULL if malloc fails
+ +

Definition at line 267 of file ip_prefix_search.c.

+ +
+
+ +

◆ ip_dec()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ip_dec (const ip_addr_tip,
ip_addr_tip_dec 
)
+
+

Decrement IP address Decrement IPv4 or IPv6 address 'ip' and save result to 'ip_dec'

Parameters
+ + + +
[in]ipPointer to input ip address structure
[out]ip_decPointer to output ip address structure
+
+
+
Returns
void
+ +

Definition at line 289 of file ip_prefix_search.c.

+ +
+
+ +

◆ ip_inc()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ip_inc (const ip_addr_tip,
ip_addr_tip_inc 
)
+
+

Increment IP address Increment IPv4 or Ipv6 address 'ip' and save result to 'ip_inc'

Parameters
+ + + +
[in]ipPointer to input ip address structure
[out]ip_incPointer to output ip address structure
+
+
+
Returns
void
+ +

Definition at line 316 of file ip_prefix_search.c.

+ +
+
+ +

◆ ipps_destroy()

+ +
+
+ + + + + + + + +
int ipps_destroy (ipps_context_tprefix_context)
+
+

Deinitialize interval_search_context structure Dealloc all memory, garbage collector

Parameters
+ + +
[in]prefix_contextPointer to interval_search_context struct return 0 if dealloc is OK, 1 if free fails
+
+
+ +

Definition at line 342 of file ip_prefix_search.c.

+ +
+
+ +

◆ ipps_init()

+ +
+
+ + + + + + + + +
ipps_context_t* ipps_init (ipps_network_list_tnetwork_list)
+
+

Initialize ipps_context_t structure, fill IPv4 and IPv6 ipps_interval arrays Function compute for all networks in 'network_list' appropriate intervals and copied network data Overlapping intervals are split. Array is sorted by low IP addr of interval. Networks in network list is not necessary sorted, 'ipps_init' mask and sort each network itself

Parameters
+ + +
[in]network_listPointer to network list structure
+
+
+
Returns
NULL if memory alloc fails, Pointer to ipps_context structure
+ +

Definition at line 409 of file ip_prefix_search.c.

+ +
+
+ +

◆ ipps_search()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ipps_search (ip_addr_tip,
ipps_context_tprefix_context,
void *** data 
)
+
+

Binary search in interval_search_context Binary search 'ip' in intervals interval_search_context, 'ip' is compare with 'low_ip' and 'high_ip' of interval. if match, fill 'data' pointer by pointer to data_array of interval and return number of data members if no match return 0 and 'data' pointer not fill Optimized for IPv4 or IPv6 search

Parameters
+ + + + +
[in]ipPointer to ip address structure
[in]prefix_contextPointer to interval_search_context structure
[out]dataPointer to array of void pointers - pointers to data
+
+
+
Returns
int 0 if no match, >0 Number of data members in matched interval
+ +

Definition at line 924 of file ip_prefix_search.c.

+ +
+
+ +

◆ mask_ipv6()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void mask_ipv6 (ip_addr_tip,
uint32_t mask,
ip_addr_tmasked_ipv6,
uint32_t ** net_mask_array 
)
+
+

Mask IPv6 address Mask IPv6 address ip with network mask mask and save result to masked_ipv6.

Parameters
+ + + + + +
[in]ipPointer to IP union.
[in]maskNetwork mask.
[out]masked_ipv6Pointer to IP union.
[in]net_listPointer to networks list structure.
+
+
+
Returns
void.
+ +

Definition at line 177 of file ip_prefix_search.c.

+ +
+
+ +

◆ new_context()

+ +
+
+ + + + + + + + +
ipps_context_t* new_context (void )
+
+

Create and initialize new interval_search_context structure

Returns
Pointer to interval_search_context struct, NULL if alloc fails
+ +

Definition at line 385 of file ip_prefix_search.c.

+ +
+
+ +

◆ new_interval()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ipps_interval_node_t* new_interval (const ip_addr_tlow_ip,
const ip_addr_thigh_ip 
)
+
+

Create new interval node Alloc and initialize new node to interval list

Parameters
+ + + +
[in]low_ipPointer to network structure
[in]high_ipPointer to result interval
+
+
+
Returns
Pointer to new interval node, NULL if malloc fails
+ +

Definition at line 225 of file ip_prefix_search.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/ip__prefix__search_8c_source.html b/doc/unirec/ip__prefix__search_8c_source.html new file mode 100644 index 00000000..95f23a37 --- /dev/null +++ b/doc/unirec/ip__prefix__search_8c_source.html @@ -0,0 +1,132 @@ + + + + + + + +UniRec: ip_prefix_search.c Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
ip_prefix_search.c
+
+
+Go to the documentation of this file.
1 
10 /*
11  * Copyright (C) 2013,2014 CESNET
12  *
13  * LICENSE TERMS
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  * 1. Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in
22  * the documentation and/or other materials provided with the
23  * distribution.
24  * 3. Neither the name of the Company nor the names of its contributors
25  * may be used to endorse or promote products derived from this
26  * software without specific prior written permission.
27  *
28  * ALTERNATIVELY, provided that this notice is retained in full, this
29  * product may be distributed under the terms of the GNU General Public
30  * License (GPL) version 2 or later, in which case the provisions
31  * of the GPL apply INSTEAD OF those given above.
32  *
33  * This software is provided ``as is'', and any express or implied
34  * warranties, including, but not limited to, the implied warranties of
35  * merchantability and fitness for a particular purpose are disclaimed.
36  * In no event shall the company or contributors be liable for any
37  * direct, indirect, incidental, special, exemplary, or consequential
38  * damages (including, but not limited to, procurement of substitute
39  * goods or services; loss of use, data, or profits; or business
40  * interruption) however caused and on any theory of liability, whether
41  * in contract, strict liability, or tort (including negligence or
42  * otherwise) arising in any way out of the use of this software, even
43  * if advised of the possibility of such damage.
44  *
45  */
46 
47 #include <stdio.h>
48 #include <stdint.h>
49 #include <stdlib.h>
50 #include "ip_prefix_search.h"
51 #include "ipps_internal.h"
52 
58 uint8_t bit_endian_swap(uint8_t in)
59 {
60  in = (in & 0xF0) >> 4 | (in & 0x0F) << 4;
61  in = (in & 0xCC) >> 2 | (in & 0x33) << 2;
62  in = (in & 0xAA) >> 1 | (in & 0x55) << 1;
63  return in;
64 }
65 
73 {
74  int i, j;
75  uint32_t **net_mask_array = malloc(129 * sizeof(uint32_t *));
76  if (net_mask_array == NULL) {
77  return NULL;
78  }
79 
80  for (i = 0; i < 129; i++) {
81  net_mask_array[i] = malloc(4 * sizeof(uint32_t));
82  if (net_mask_array[i] == NULL) {
83  for (int k = 0; k < i; k++) {
84  free(net_mask_array[i]);
85  }
86  return NULL;
87  }
88  // Fill every word of IPv6 address
89  net_mask_array[i][0] = 0xFFFFFFFF >> (i == 0 || i >= 32 ? 0 : 32 - i);
90  net_mask_array[i][1] = i <= 32 ? 0 : 0xFFFFFFFF >> (i >= 64 ? 0 : 64 - i);
91  net_mask_array[i][2] = i <= 64 ? 0 : 0xFFFFFFFF >> (i >= 96 ? 0 : 96 - i);
92  net_mask_array[i][3] = i <= 96 ? 0 : 0xFFFFFFFF >> (128 - i);
93 
94  // Swap bits in every byte for compatibility with ip_addr_t stucture
95  for (j = 0; j < 4; ++j) {
96  net_mask_array[i][j] = (bit_endian_swap((net_mask_array[i][j] & 0x000000FF) >> 0) << 0) |
97  (bit_endian_swap((net_mask_array[i][j] & 0x0000FF00) >> 8) << 8) |
98  (bit_endian_swap((net_mask_array[i][j] & 0x00FF0000) >> 16) << 16) |
99  (bit_endian_swap((net_mask_array[i][j] & 0xFF000000) >> 24) << 24);
100  }
101  }
102 
103  return net_mask_array;
104 }
105 
113 void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array)
114 {
115  int index;
116  for (index = 0; index < 129; index++) {
117  free(net_mask_array[index]);
118  }
119  free(net_mask_array);
120 }
121 
129 int cmp_net_v4(const void *v1, const void *v2)
130 {
131  const ipps_network_t *n1 = *(ipps_network_t **)v1;
132  const ipps_network_t *n2 = *(ipps_network_t **)v2;
133 
134  int ip_cmp_result;
135 
136  ip_cmp_result = memcmp(&n1->addr.ui32[2], &n2->addr.ui32[2], 4);
137  /* if they are equal - lower mask (greater network) first */
138  if (ip_cmp_result == 0) {
139  return memcmp(&n1->mask, &n2->mask, 4);
140  } else {
141  return ip_cmp_result;
142  }
143 }
144 
152 int cmp_net_v6(const void *v1, const void *v2)
153 {
154  const ipps_network_t *n1 = *(ipps_network_t **)v1;
155  const ipps_network_t *n2 = *(ipps_network_t **)v2;
156 
157  int ip_cmp_result;
158 
159  ip_cmp_result = memcmp(&n1->addr.ui8, &n2->addr.ui8, 16);
160  /* if they are equal - lower mask (greater network) first */
161  if (ip_cmp_result == 0) {
162  return memcmp(&n1->mask, &n2->mask, 4);
163  } else {
164  return ip_cmp_result;
165  }
166 }
167 
177 void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
178 {
179  int i;
180  for (i = 0; i < 4; i++) {
181  masked_ipv6->ui32[i] = ip->ui32[i] & net_mask_array[mask][i];
182  }
183 }
184 
195  uint32_t **net_mask_array)
196 {
197  inter->data_cnt = 0;
198  inter->data_array = NULL;
199 
200  /* Fill network address */
201  memcpy(&inter->low_ip, &net->addr, 16);
202 
203  /* Fill broadcast address */
204  if (!ip_is6(&net->addr)) {
205  // IPv4
206  inter->high_ip.ui64[0] = 0;
207  inter->high_ip.ui32[2] = net->addr.ui32[2] | ( ~ net_mask_array[net->mask][0]);
208  inter->high_ip.ui32[3] = 0xffffffff;
209  } else {
210  // IPv6
211  int i;
212  for (i = 0; i < 4; i++) {
213  inter->high_ip.ui32[i] = net->addr.ui32[i] | ( ~ net_mask_array[net->mask][i]);
214  }
215  }
216 }
217 
225  ipps_interval_node_t *new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip)
226 {
227 
228  ipps_interval_node_t * new_node = malloc(sizeof(ipps_interval_node_t));
229  if (new_node == NULL) {
230  fprintf(stderr, "ERROR allocating memory for network interval node\n");
231  return NULL;
232  }
233 
234  new_node->interval = malloc(sizeof(ipps_interval_t));
235  if (new_node->interval == NULL) {
236  fprintf(stderr, "ERROR allocating memory for network interval\n");
237  free(new_node);
238  return NULL;
239  }
240  new_node->next = NULL;
241 
242  /* Initialize struct members */
243  memcpy(&new_node->interval->low_ip, low_ip, 16);
244  memcpy(&new_node->interval->high_ip, high_ip, 16);
245  new_node->interval->data_cnt = 0;
246  new_node->interval->array_len = DATASLOTS;
247  new_node->interval->data_array = malloc(DATASLOTS * sizeof(void *));
248  if (new_node->interval->data_array == NULL) {
249  fprintf(stderr, "ERROR allocating memory for data pointers\n");
250  free(new_node->interval);
251  free(new_node);
252  return NULL;
253  }
254 
255  return new_node;
256 }
257 
268  const ip_addr_t *low_ip, const ip_addr_t *high_ip)
269 {
270  ipps_interval_node_t *new_interval_node = new_interval(low_ip, high_ip);
271  if (new_interval_node == NULL) {
272  return NULL;
273  }
274 
275  /* Post Insert */
276  new_interval_node->next = position->next;
277  position->next = new_interval_node;
278 
279  return new_interval_node;
280 }
281 
289 void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec)
290 {
291  if (ip_is6(ip)) {
292  memcpy(ip_dec, ip, 16);
293 
294  uint32_t tmp = 0xffffffff;
295  int i;
296  for (i = 3; i >=0; i--) {
297  ip_dec->ui32[i] = htonl(ntohl(ip->ui32[i]) - 1);
298  if (ip_dec->ui32[i] != tmp) {
299  break;
300  }
301  }
302  } else {
303  ip_dec->ui64[0] = 0;
304  ip_dec->ui32[2] = htonl(ntohl(ip->ui32[2]) - 1);
305  ip_dec->ui32[3] = 0xffffffff;
306  }
307 }
308 
316 void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc)
317 {
318  if (ip_is6(ip)) {
319  memcpy(ip_inc, ip, 16);
320 
321  uint32_t tmp = 0xffffffff;
322  int i;
323  for (i = 3; i >= 0; i--) {
324  ip_inc->ui32[i] = htonl(ntohl(ip->ui32[i]) + 1);
325  if (ip->ui32[i] < tmp) {
326  break;
327  }
328  }
329  } else {
330  ip_inc->ui64[0] = 0;
331  ip_inc->ui32[2] = htonl(ntohl(ip->ui32[2]) + 1);
332  ip_inc->ui32[3] = 0xffffffff;
333  }
334 }
335 
342 int ipps_destroy(ipps_context_t *prefix_context)
343 {
344  int i;
345  void **data_collector; // Array with freed memory pointers
346  uint32_t data_collector_cnt = 0; // Number of pointers in 'data_collector'
347 
348  if (prefix_context == NULL) {
349  fprintf(stderr, "ERROR NULL pointer passed to ipps_destroy\n");
350  return 1;
351  }
352 
353  data_collector = malloc(COLLECTORSLOTS * sizeof(void *));
354  if (data_collector == NULL) {
355  fprintf(stderr, "ERROR allocating memory for freed data collector\n");
356  return 1;
357  }
358 
359  // Dealloc all IPv4 data and intervals
360  for (i = 0; i < prefix_context->v4_count; ++i) {
361  if (free_data(&prefix_context->v4_prefix_intervals[i], &data_collector, &data_collector_cnt)) {
362  return 1;
363  }
364  }
365 
366  // Dealloc all IPv6 data and intervals
367  data_collector_cnt = 0;
368  for (i = 0; i < prefix_context->v6_count; ++i) {
369  if (free_data(&prefix_context->v6_prefix_intervals[i], &data_collector, &data_collector_cnt)) {
370  return 1;
371  }
372  }
373 
374  free(data_collector);
375  free(prefix_context->v4_prefix_intervals);
376  free(prefix_context->v6_prefix_intervals);
377  free(prefix_context);
378  return 0;
379 }
380 
386 {
387  ipps_context_t *prefix_context = malloc(sizeof(ipps_context_t));
388  if (prefix_context == NULL) {
389  fprintf(stderr, "ERROR allocating memory for network mask array\n");
390  return NULL;
391  }
392 
393  prefix_context->v4_count = 0;
394  prefix_context->v6_count = 0;
395  prefix_context->v4_prefix_intervals = NULL;
396  prefix_context->v6_prefix_intervals = NULL;
397 
398  return prefix_context;
399 }
400 
410 {
411  int index;
412  ip_addr_t *masked_ip;
413 
414  if (network_list == NULL) {
415  fprintf(stderr, "ERROR Network list is not initialized");
416  return NULL;
417  }
418 
419  if (network_list->net_count <= 0) {
420  fprintf(stderr, "ERROR Network lists are empty, nothing to do");
421  return NULL;
422  }
423 
424  // Create new interval_search_context
425  ipps_context_t *prefix_context = new_context();
426  if (prefix_context == NULL) {
427  return NULL;
428  }
429 
430  // Create and fill net mask array - for masking IP
431  uint32_t **net_mask_array = create_ip_v6_net_mask_array();
432  if (net_mask_array == NULL) {
433  fprintf(stderr, "ERROR allocating memory for network mask array\n");
434  return NULL;
435  }
436 
437  ipps_network_t *current_net; // Currently precessed network
438  void *tmp;
439 
440  ipps_network_t **networks_v6 = NULL; // Pointers to ipv6 networks
441  ipps_network_t **networks_v4 = NULL; // Pointers to ipv4 networks
442 
443 
444  uint32_t i_v6 = 0; // Number of ipv6 networks
445  uint32_t i_v4 = 0; // Number of ipv4 networks
446 
447  size_t i_v6_alloc = NETWORKSLOTS; // Number of available network pointers
448  size_t i_v4_alloc = NETWORKSLOTS; // Number of available network pointers
449 
450  // Allocate memory for network array
451  if ((networks_v4 = malloc(i_v4_alloc * sizeof(ipps_network_t *))) == NULL ||
452  (networks_v6 = malloc(i_v6_alloc * sizeof(ipps_network_t *))) == NULL) {
453  free(networks_v4);
454  free(networks_v6);
455  ipps_destroy(prefix_context);
456  destroy_ip_v6_net_mask_array(net_mask_array);
457  fprintf(stderr, "ERROR allocating sorted network structures\n");
458  return NULL;
459  }
460 
461  // For each network in array - mask ip address and split to ipv4 or ipv6 network
462  for (index = 0; index < network_list->net_count; ++index)
463  {
464  current_net = &network_list->networks[index];
465  if (ip_is6(&current_net->addr)) {
466  masked_ip = &current_net->addr;
467  mask_ipv6(&current_net->addr, current_net->mask, masked_ip, net_mask_array);
468 
469  i_v6++;
470  if (i_v6_alloc < i_v6) {
471  i_v6_alloc *= 2;
472  tmp = realloc(networks_v6, i_v6_alloc * sizeof(ipps_network_t *));
473  if (tmp == NULL) {
474  fprintf(stderr, "ERROR allocating memory for ipv6 network collector\n");
475  ipps_destroy(prefix_context);
476  destroy_ip_v6_net_mask_array(net_mask_array);
477  free(networks_v4);
478  free(networks_v6);
479  return NULL;
480  }
481  networks_v6 = tmp;
482 
483  }
484  networks_v6[i_v6-1] = current_net;
485  } else {
486  masked_ip = &current_net->addr;
487  masked_ip->ui32[2] = masked_ip->ui32[2] & net_mask_array[current_net->mask][0];
488 
489  i_v4++;
490  if (i_v4_alloc < i_v4) {
491  i_v4_alloc *= 2;
492  tmp = realloc(networks_v4, i_v4_alloc * sizeof(ipps_network_t *));
493  if (tmp == NULL) {
494  fprintf(stderr, "ERROR allocating memory for ipv6 network collector\n");
495  ipps_destroy(prefix_context);
496  destroy_ip_v6_net_mask_array(net_mask_array);
497  free(networks_v4);
498  free(networks_v6);
499  return NULL;
500  }
501  networks_v4 = tmp;
502  }
503  networks_v4[i_v4 - 1] = current_net;
504  }
505  }
506 
507  if (i_v4 > 0 && networks_v4[0] != NULL) {
508  qsort(networks_v4, i_v4, sizeof(ipps_network_t *), cmp_net_v4);
509 
510  // Fill intervals for IPv4 to interval_search_context array, if fail, dealloc and rtrn NULL
511  prefix_context->v4_prefix_intervals = init_context(networks_v4, i_v4,
512  &prefix_context->v4_count, net_mask_array);
513  if (prefix_context->v4_prefix_intervals == NULL) {
514  destroy_ip_v6_net_mask_array(net_mask_array);
515  ipps_destroy(prefix_context);
516  free(networks_v4);
517  free(networks_v6);
518  return NULL;
519  }
520  /************************/
521  }
522  free(networks_v4);
523 
524  if (i_v6 > 0 && networks_v6[0] != NULL) {
525  qsort(networks_v6, i_v6, sizeof(ipps_network_t *), cmp_net_v6);
526 
527  // Fill intervals for IPv6 to interval_search_context array, if fail, dealloc and return NULL
528  prefix_context->v6_prefix_intervals = init_context(networks_v6, i_v6,
529  &prefix_context->v6_count, net_mask_array);
530  if (prefix_context->v6_prefix_intervals == NULL) {
531  destroy_ip_v6_net_mask_array(net_mask_array);
532  ipps_destroy(prefix_context);
533  free(networks_v6);
534  return NULL;
535  }
536 
537  /************************/
538  }
539  free(networks_v6);
540 
541  destroy_ip_v6_net_mask_array(net_mask_array);
542  return prefix_context;
543 }
544 
554 {
555 
556  if (dest->data_cnt + src->data_cnt > dest->array_len) {
557  // no free pointer slots for src data in dest data_array
558  void **tmp;
559  dest->array_len += src->array_len;
560  tmp = realloc (dest->data_array, dest->array_len * sizeof(void *));
561  if (tmp == NULL) {
562  fprintf(stderr, "ERROR allocating memory for network mask array\n");
563  return 1;
564  }
565  dest->data_array = tmp;
566  }
567 
568  memcpy(dest->data_array + dest->data_cnt, src->data_array, src->data_cnt * sizeof(void *));
569  dest->data_cnt += src->data_cnt;
570  return 0;
571 }
572 
583 int add_data(ipps_interval_t *interval, void *data, size_t data_len)
584 {
585  // Alloc new data and copy
586  void *new_data = malloc(data_len);
587  if (new_data == NULL) {
588  fprintf(stderr, "ERROR allocating memory for network mask array\n");
589  return 1;
590  }
591 
592  memcpy(new_data, data, data_len);
593 
594  // Insert new data to interval's data array - first do some space ...
595  interval->data_cnt++;
596  if (interval->data_cnt > interval->array_len) {
597  void **tmp;
598  interval->array_len *= 2;
599  tmp = realloc (interval->data_array, interval->array_len * sizeof(void *));
600  if (tmp == NULL) {
601  fprintf(stderr, "ERROR allocating memory for network mask array\n");
602  free(new_data);
603  return 1;
604  }
605  interval->data_array = tmp;
606  }
607 
608  // ... then push new data to array
609  interval->data_array[interval->data_cnt - 1] = new_data;
610 
611  return 0;
612 }
613 
630 ipps_interval_t *init_context( ipps_network_t **networks, uint32_t network_count,
631  uint32_t *context_counter, uint32_t **net_mask_array)
632 {
633  uint32_t interval_counter = 0;
634 
635  ipps_interval_t current_interval;
636  ipps_interval_node_t *interval_list = NULL;
637 
638  int index = 0;
639 
640  // push first interval from network tree to interval_search_context interval list
641  // compute ip interval - low and high ip addresses
642  fill_interval_by_network(networks[0], &current_interval, net_mask_array);
643  // insert root interval node to list
644  interval_list = new_interval(&current_interval.low_ip, &current_interval.high_ip);
645  if (interval_list == NULL) {
646  return NULL;
647  }
648 
649  if (add_data(interval_list->interval, networks[0]->data, networks[0]->data_len)) {
650  // add data to root node
651  return NULL;
652  }
653  interval_counter++; // number of intervals
654 
655  ipps_interval_node_t *conductor = NULL; // list iterator
656  ipps_interval_node_t *end_of_list = interval_list; // last element in the list
657 
658  int ip_cmp_result; // result of ip comparison
659  ip_addr_t tmp_ip ; // temporary ip addr union for compute first or last IP address of interval
660 
661  conductor = interval_list;
662 
663  // traverse rest of networks tree
664  for (index = 1; index < network_count; ++index) {
665  // fill temporary interval variable by current interval
666  fill_interval_by_network(networks[index], &current_interval, net_mask_array);
667 
668  while (conductor != NULL) {
669  // compare low IP of actual processed interval with high IP all intervals in list
670  ip_cmp_result = ip_cmp( &conductor->interval->high_ip, &current_interval.low_ip);
671 
672  if (ip_cmp_result >= 0) {
673  ip_cmp_result = ip_cmp( &conductor->interval->low_ip, &current_interval.low_ip);
674  if (ip_cmp_result > 0) {
675  // LowI > LowT
676  ip_cmp_result = ip_cmp( &conductor->interval->high_ip, &current_interval.high_ip);
677  if (ip_cmp_result > 0) {
678  // Con <---------->
679  // Cur <---------->
680 
681  fprintf(stderr, "ERROR Inserting to list");
682  destroy_list(interval_list);
683  return NULL;
684  } else if (ip_cmp_result < 0) {
685  // Con <-------->
686  // Cur <------------>
687 
688  fprintf(stderr, "ERROR Inserting to list");
689  destroy_list(interval_list);
690  return NULL;
691  } else {
692  // Con <-------->
693  // Cur <---------->
694 
695  fprintf(stderr, "ERROR Inserting to list");
696  destroy_list(interval_list);
697  return NULL;
698  }
699  } else if (ip_cmp_result < 0) {
700  // LowI < LowT
701  ip_cmp_result = ip_cmp( &conductor->interval->high_ip, &current_interval.high_ip);
702  if (ip_cmp_result > 0) {
703  // Con <---------->
704  // Cur <----->
705 
706  /***********************/
707  /* | | ↓ | |
708  * <----------->
709  * <----->
710  */
711 
712  // Insert new interval to interval tree, conductor post insert
713  if (insert_new_interval(conductor, &current_interval.low_ip,
714  &current_interval.high_ip) == NULL) {
715  destroy_list(interval_list);
716  return NULL;
717  }
718  interval_counter++;
719 
720  // Fill data array in new interval node
721  // Copy original data and add new one from current network
722  if (copy_all_data(conductor->next->interval, conductor->interval)) {
723  destroy_list(interval_list);
724  return NULL;
725  }
726  if (add_data(conductor->next->interval, networks[index]->data, networks[index]->data_len)) {
727  destroy_list(interval_list);
728  return NULL;
729  }
730  /***********************/
731 
732  /***********************/
733  /*
734  * | | |↓ |
735  * Con <----------->
736  * Cur <----->
737  */
738 
739  // Insert new interval to interval list
740  ip_inc(&current_interval.high_ip, &tmp_ip);
741  if (insert_new_interval(conductor->next, &tmp_ip, &conductor->interval->high_ip) == NULL) {
742  destroy_list(interval_list);
743  return NULL;
744  }
745  interval_counter++;
746 
747  if (copy_all_data(conductor->next->next->interval, conductor->interval)) {
748  destroy_list(interval_list);
749  return NULL;
750  }
751 
752  /***********************/
753 
754  /***********************/
755  /* |↓| | |
756  * Con <----------->
757  * Cur <----->
758  */
759 
760  // Modify original interval
761  ip_dec(&current_interval.low_ip, &tmp_ip);
762  memcpy(&conductor->interval->high_ip, &tmp_ip, 16);
763  /***********************/
764 
765  // Modify end of interval list, 2 follower inserted
766  if (end_of_list == conductor) {
767  end_of_list = conductor->next->next;
768  }
769  break;
770  }
771  else if (ip_cmp_result < 0) {
772  // Con <---------->
773  // Cur <----------->
774 
775  fprintf(stderr, "ERROR Inserting to list");
776  destroy_list(interval_list);
777  return NULL;
778  } else {
779  // Con <---------->
780  // Cur <-------->
781 
782  if (insert_new_interval(conductor, &current_interval.low_ip,
783  &conductor->interval->high_ip) == NULL) {
784  destroy_list(interval_list);
785  return NULL;
786  }
787  interval_counter++;
788 
789  if (copy_all_data(conductor->next->interval, conductor->interval)) {
790  destroy_list(interval_list);
791  return NULL;
792  }
793  if (add_data(conductor->next->interval, networks[index]->data,
794  networks[index]->data_len)) {
795  destroy_list(interval_list);
796  return NULL;
797  }
798 
799  if (end_of_list == conductor) {
800  end_of_list = conductor->next;
801  }
802 
803  ip_dec(&current_interval.low_ip, &tmp_ip);
804  memcpy(&conductor->interval->high_ip, &tmp_ip, 16);
805  }
806  } else {
807  ip_cmp_result = ip_cmp( &conductor->interval->high_ip, &current_interval.high_ip);
808  if (ip_cmp_result > 0) {
809  // Con <---------->
810  // Cur <-------->
811 
812  ip_inc(&current_interval.high_ip, &tmp_ip);
813 
814  insert_new_interval(conductor, &tmp_ip, &conductor->interval->high_ip);
815  interval_counter++;
816 
817  copy_all_data(conductor->next->interval, conductor->interval);
818 
819  if (end_of_list == conductor) {
820  end_of_list = conductor->next;
821  }
822  memcpy(&conductor->interval->high_ip, &current_interval.high_ip, 16);
823  if (add_data(conductor->interval, networks[index]->data, networks[index]->data_len)) {
824  destroy_list(interval_list);
825  return NULL;
826  }
827 
828  break;
829  } else if (ip_cmp_result < 0) {
830  // Con <-------->
831  // Cur <---------->
832 
833  fprintf(stderr, "ERROR Inserting to list");
834  destroy_list(interval_list);
835  return NULL;
836  } else {
837  // Con <-------->
838  // Cur <-------->
839 
840  if (add_data(conductor->interval, networks[index]->data,
841  networks[index]->data_len)) {
842  destroy_list(interval_list);
843  return NULL;
844  }
845  }
846  }
847 
848  break;
849  } else if (ip_cmp_result < 0) {
850  // Low ip address of current is higher then high ip of interval list member,
851  // take next interval in list
852  conductor = conductor->next;
853  } else {
854  // Useless branch, memcmp error
855  fprintf(stderr, "ERROR Inserting to list");
856  destroy_list(interval_list);
857  return NULL;
858  }
859  }
860 
861  if (conductor == NULL) {
862  // New interval at the end of list
863  if (insert_new_interval(end_of_list, &current_interval.low_ip, &current_interval.high_ip) == NULL) {
864  destroy_list(interval_list);
865  return NULL;
866  }
867 
868  // Add new data to new end of list
869  end_of_list = end_of_list->next;
870 
871  if (add_data(end_of_list->interval, networks[index]->data, networks[index]->data_len)) {
872  destroy_list(interval_list);
873  return NULL;
874  }
875  interval_counter++;
876 
877  conductor = end_of_list;
878  }
879  }
880 
881  // Alloc new interval array
882  ipps_interval_t *prefix_context = (ipps_interval_t *)malloc(interval_counter * sizeof(ipps_interval_t));
883  if (prefix_context == NULL) {
884  fprintf(stderr, "ERROR allocating memory for prefix interval_search_context\n");
885  destroy_list(interval_list);
886  return NULL;
887  }
888 
889  // Fill interval array
890  // Hard copy intervals from list to array, duplicate data array pointer, free all list node
891  conductor = interval_list;
892  ipps_interval_t *array_iterator = prefix_context;
893  size_t size_of_pref_interval = sizeof(ipps_interval_t);
894  *context_counter = interval_counter;
895 
896  // Iterate whole interval list
897  while (conductor != NULL) {
898  // Copy from list to array
899  memcpy(array_iterator, conductor->interval, size_of_pref_interval);
900  array_iterator++; // next interval in array
901 
902  // Destroy list node, Don't destroy data!
903  interval_list = conductor->next;
904  free(conductor->interval);
905  free(conductor);
906  conductor = interval_list;
907  }
908 
909  return prefix_context;
910 }
911 
924 int ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data)
925 {
926  int first, last, middle; // Array indexes
927 
928  ipps_interval_t *interval_array; // Pointer to IPv4 or IPv6 interval array
929  uint8_t *middle_interval; // Pointer to first byte of current middle interval
930 
931  int ip_high_cmp_result; // Result of comparing high IP of 2 intervals
932  int ip_low_cmp_result; // Result of comparing low IP of 2 intervals
933 
934  void *ip_addr_start; // Ptr to first useful byte in ip_addr_t union, etc offset ui32[2] in IPv4
935 
936  size_t ip_addr_len = sizeof(ip_addr_t);
937  size_t addr_cmp_len; // Number of compare bytes, 4 for IPv4, 16 for IPv6 (IP addr size)
938 
939  size_t low_ip_offset; // Offset of 'low_ip' in 'ipps_interval_t' structure
940  size_t high_ip_offset; // Offset of 'high' in 'ipps_interval_t' structure
941 
942  if (ip_is6(ip)) {
943  if (prefix_context->v6_count == 0) {
944  return 0;
945  }
946  first = 0;
947  last = prefix_context->v6_count - 1;
948  middle = (first + last)>>1;
949 
950  interval_array = prefix_context->v6_prefix_intervals;
951 
952  low_ip_offset = 0; // interval->low_ip is first member of struct
953  high_ip_offset = ip_addr_len; // interval->high_ip is second member of struct
954  addr_cmp_len = 16; // Compare length, 16 bytes for IPv6
955  ip_addr_start = (uint8_t *)ip;
956 
957  } else {
958  if (prefix_context->v4_count == 0) {
959  return 0;
960  }
961  first = 0;
962  last = prefix_context->v4_count - 1;
963  middle = (first + last)>>1;
964 
965  interval_array = prefix_context->v4_prefix_intervals;
966 
967  low_ip_offset = 8; // low_ip.ui32[2]
968  high_ip_offset = ip_addr_len + 8; // high.ui32[2]
969  addr_cmp_len = 4; // Compare length, 4 bytes for IPv4
970 
971  ip_addr_start = ((uint8_t *)ip) + 8; // ip.ui32[2]
972  }
973 
974  while (first <= last ) {
975  middle_interval = (uint8_t *)(interval_array + middle);
976 
977  ip_low_cmp_result = memcmp(middle_interval + low_ip_offset, ip_addr_start, addr_cmp_len);
978  ip_high_cmp_result = memcmp(middle_interval + high_ip_offset, ip_addr_start, addr_cmp_len);
979 
980  if (ip_low_cmp_result <= 0 && ip_high_cmp_result >= 0) {
981  *data = ((ipps_interval_t *)middle_interval)->data_array;
982  return ((ipps_interval_t *)middle_interval)->data_cnt;
983  } else if (ip_high_cmp_result > 0) {
984  last = middle - 1;
985  } else {
986  first = middle + 1;
987  }
988  middle = (first + last) >> 1;
989  }
990  return 0;
991 }
992 
1000 int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt )
1001 {
1002  int j,k;
1003  void **tmp;
1004 
1005  for (j = 0; j < interval->data_cnt; ++j) {
1006  for (k = 0; k < *data_coll_cnt; ++k) {
1007  if (interval->data_array[j] == (*data_collector)[k]) {
1008  interval->data_array[j] = NULL; // pointer has been freed
1009  break;
1010  }
1011  }
1012 
1013  if (k == *data_coll_cnt) {
1014  // Data not match in data_collector, add data pointer to collector and free memory
1015  if (*data_coll_cnt >= COLLECTORSLOTS && *data_coll_cnt % COLLECTORSLOTS == 0) {
1016  tmp = realloc(*data_collector, ((*data_coll_cnt) + COLLECTORSLOTS) * sizeof(void *));
1017  if (tmp == NULL) {
1018  fprintf(stderr, "ERROR allocating memory for network mask array\n");
1019  return 1;
1020  }
1021  *data_collector = tmp;
1022  }
1023 
1024  (*data_collector)[*data_coll_cnt] = interval->data_array[j]; // Add pointer to collector
1025  (*data_coll_cnt)++;
1026 
1027  free(interval->data_array[j]); // free data
1028  }
1029  }
1030  free(interval->data_array); // free pointers to data
1031  return 0;
1032 }
1033 
1042 {
1043  void **data_collector; // pointers to freed memory
1044  uint32_t data_collector_cnt = 0;
1045  ipps_interval_node_t *tmp_interval;
1046 
1047  data_collector = malloc(COLLECTORSLOTS * sizeof(void *));
1048  if (data_collector == NULL) {
1049  fprintf(stderr, "ERROR allocating memory for freed data collector\n");
1050  return 1;
1051  }
1052 
1053  while (interval_list != NULL) {
1054  tmp_interval = interval_list;
1055  interval_list = interval_list->next;
1056 
1057  if (free_data(tmp_interval->interval, &data_collector, &data_collector_cnt)) {
1058  return 1;
1059  }
1060  free(tmp_interval->interval);
1061  free(tmp_interval);
1062  }
1063  free(data_collector);
1064 
1065  return 0;
1066 }
#define NETWORKSLOTS
+
int cmp_net_v4(const void *v1, const void *v2)
+
void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
+
ip_addr_t low_ip
Low IP of interval.
+
Init context and prefix search.
+
struct ipps_interval_node * next
Next node in list, NULL if last node in list.
Definition: ipps_internal.h:54
+
void ** data_array
Array of pointers to data.
+
uint32_t v4_count
Number of intervals in IPv4 array.
+
void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array)
+
uint32_t data_cnt
Number of currently used data pointers in &#39;data_array&#39;.
+
uint8_t ui8[16]
Definition: ipaddr.h:109
+
free(rec)
+
INLINE int ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2)
Definition: ipaddr.h:266
+ +
ipps_interval_t * v6_prefix_intervals
Pointer to IPv6 intervals array.
+
ipps_interval_t * v4_prefix_intervals
Pointer to IPv4 intervals array.
+
ipps_interval_node_t * new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip)
+
ipps_context_t * ipps_init(ipps_network_list_t *network_list)
+
ipps_interval_t * init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array)
+
#define COLLECTORSLOTS
+
int copy_all_data(ipps_interval_t *dest, ipps_interval_t *src)
+
size_t data_len
Number of bytes in &#39;data&#39;.
+
ipps_network_t * networks
Pointer to networks array.
+
int add_data(ipps_interval_t *interval, void *data, size_t data_len)
+
Init context and prefix search - Internal functions and structures.
+
uint8_t bit_endian_swap(uint8_t in)
+
int ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data)
+ +
int ipps_destroy(ipps_context_t *prefix_context)
+
uint32_t ui32[4]
Definition: ipaddr.h:117
+ + +
uint32_t v6_count
Number of intervals in IPv6 array.
+
uint32_t ** create_ip_v6_net_mask_array()
+ +
#define DATASLOTS
+
ipps_interval_t * interval
Pointer to interval structure.
Definition: ipps_internal.h:53
+
INLINE int ip_is6(const ip_addr_t *addr)
Definition: ipaddr.h:143
+
void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec)
+
size_t array_len
Allocated size of &#39;data_array&#39; => total available slots.
+
ipps_context_t * new_context()
+
ip_addr_t addr
Network IP address.
+
memcpy(buffer, rec, ur_rec_size(tmplt, rec))
+
int cmp_net_v6(const void *v1, const void *v2)
+ +
uint32_t mask
Network mask, CIDR notation, use for indexing.
+
uint32_t net_count
Number of networks in &#39;networks&#39; array.
+
int destroy_list(ipps_interval_node_t *interval_list)
+
void fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array)
+
ip_addr_t high_ip
High IP of interval.
+
ipps_interval_node_t * insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip)
+
void * data
Pointer to same data.
+
int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt)
+
void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc)
+
uint64_t ui64[2]
Definition: ipaddr.h:121
+
+ + + + diff --git a/doc/unirec/ip__prefix__search_8h.html b/doc/unirec/ip__prefix__search_8h.html new file mode 100644 index 00000000..14680de2 --- /dev/null +++ b/doc/unirec/ip__prefix__search_8h.html @@ -0,0 +1,470 @@ + + + + + + + +UniRec: ip_prefix_search.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
ip_prefix_search.h File Reference
+
+
+ +

Init context and prefix search. +More...

+
#include "ipaddr.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + +

+Data Structures

struct  ipps_network_t
 
struct  ipps_network_list_t
 
struct  ipps_interval_t
 
struct  ipps_context_t
 
+ + + + + + + +

+Macros

#define DATASLOTS   8
 
#define COLLECTORSLOTS   16
 
#define NETWORKSLOTS   16
 
+ + + + + + + +

+Functions

ipps_context_tipps_init (ipps_network_list_t *networks)
 
int ipps_destroy (ipps_context_t *prefix_context)
 
int ipps_search (ip_addr_t *ip, ipps_context_t *prefix_context, void ***data)
 
+

Detailed Description

+

Init context and prefix search.

+
Author
Erik Sabik xsabi.nosp@m.k02@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Ondrej Ploteny xplot.nosp@m.e01@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
Date
2013
+
+2014
+
+2016
+ +

Definition in file ip_prefix_search.h.

+

Data Structure Documentation

+ +

◆ ipps_network_t

+ +
+
+ + + + +
struct ipps_network_t
+
+

Structure of network and assoc data. Represent input information

+ +

Definition at line 64 of file ip_prefix_search.h.

+
+ + + + + + + + + + + + + +
Data Fields
+ip_addr_t +addr +Network IP address.
+void * +data +Pointer to same data.
+size_t +data_len +Number of bytes in 'data'.
+uint32_t +mask +Network mask, CIDR notation, use for indexing.
+ +
+
+ +

◆ ipps_network_list_t

+ +
+
+ + + + +
struct ipps_network_list_t
+
+

Structure of all networks

+ +

Definition at line 74 of file ip_prefix_search.h.

+
+ + + + + + + +
Data Fields
+uint32_t +net_count +Number of networks in 'networks' array.
+ipps_network_t * +networks +Pointer to networks array.
+ +
+
+ +

◆ ipps_interval_t

+ +
+
+ + + + +
struct ipps_interval_t
+
+

Structure of IP interval. IP interval is range of all IP addresses between low_ip and high_ip

+ +

Definition at line 83 of file ip_prefix_search.h.

+
+ + + + + + + + + + + + + + + + +
Data Fields
+size_t +array_len +Allocated size of 'data_array' => total available slots.
+void ** +data_array +Array of pointers to data.
+uint32_t +data_cnt +Number of currently used data pointers in 'data_array'.
+ip_addr_t +high_ip +High IP of interval.
+ip_addr_t +low_ip +Low IP of interval.
+ +
+
+ +

◆ ipps_context_t

+ +
+
+ + + + +
struct ipps_context_t
+
+

Structure of sorted interval arrays. Used for searching

+ +

Definition at line 96 of file ip_prefix_search.h.

+
+ + + + + + + + + + + + + +
Data Fields
+uint32_t +v4_count +Number of intervals in IPv4 array.
+ipps_interval_t * +v4_prefix_intervals +Pointer to IPv4 intervals array.
+uint32_t +v6_count +Number of intervals in IPv6 array.
+ipps_interval_t * +v6_prefix_intervals +Pointer to IPv6 intervals array.
+ +
+
+

Macro Definition Documentation

+ +

◆ COLLECTORSLOTS

+ +
+
+ + + + +
#define COLLECTORSLOTS   16
+
+ +

Definition at line 56 of file ip_prefix_search.h.

+ +
+
+ +

◆ DATASLOTS

+ +
+
+ + + + +
#define DATASLOTS   8
+
+ +

Definition at line 53 of file ip_prefix_search.h.

+ +
+
+ +

◆ NETWORKSLOTS

+ +
+
+ + + + +
#define NETWORKSLOTS   16
+
+ +

Definition at line 59 of file ip_prefix_search.h.

+ +
+
+

Function Documentation

+ +

◆ ipps_destroy()

+ +
+
+ + + + + + + + +
int ipps_destroy (ipps_context_tprefix_context)
+
+

Deinitialize interval_search_context structure Dealloc all memory, garbage collector

Parameters
+ + +
[in]prefix_contextPointer to interval_search_context struct return 0 if deallocis OK, 1 if free fails
+
+
+

Deinitialize interval_search_context structure Dealloc all memory, garbage collector

Parameters
+ + +
[in]prefix_contextPointer to interval_search_context struct return 0 if dealloc is OK, 1 if free fails
+
+
+ +

Definition at line 342 of file ip_prefix_search.c.

+ +
+
+ +

◆ ipps_init()

+ +
+
+ + + + + + + + +
ipps_context_t* ipps_init (ipps_network_list_tnetwork_list)
+
+

Initialize interval_search_context structure, fill IPv4 and IPv6 interval_search_context arrays Function compute for all networks in 'network_list' appropriate intervals and copied network data Overlapping intervals are split. Array is sorted by low IP addr of interval. Networks in network list is not necessary sorted, 'ipps_init' mask and sort each network itself

Parameters
+ + +
[in]network_listPointer to network list structure
+
+
+
Returns
NULL if memory alloc fails, Pointer to interval_search_context structure
+

Initialize ipps_context_t structure, fill IPv4 and IPv6 ipps_interval arrays Function compute for all networks in 'network_list' appropriate intervals and copied network data Overlapping intervals are split. Array is sorted by low IP addr of interval. Networks in network list is not necessary sorted, 'ipps_init' mask and sort each network itself

Parameters
+ + +
[in]network_listPointer to network list structure
+
+
+
Returns
NULL if memory alloc fails, Pointer to ipps_context structure
+ +

Definition at line 409 of file ip_prefix_search.c.

+ +
+
+ +

◆ ipps_search()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ipps_search (ip_addr_tip,
ipps_context_tprefix_context,
void *** data 
)
+
+

Binary search in interval_search_context Binary search 'ip' in intervals interval_search_context, 'ip' is compare with 'low_ip' and 'high_ip' of interval if match, fill 'data' pointer by data_array of the interval and return number of used data slots if no match return 0 and 'data' pointer not fill Optimized for IPv4 or IPv6 search

Parameters
+ + + + +
[in]ipPointer to ip address structure
[in]prefix_contextPointer to interval_search_context structure
[out]dataPointer to array of void pointers - pointers to data
+
+
+
Returns
int 0 if no match, >0 Number of data members in matched interval
+

Binary search in interval_search_context Binary search 'ip' in intervals interval_search_context, 'ip' is compare with 'low_ip' and 'high_ip' of interval. if match, fill 'data' pointer by pointer to data_array of interval and return number of data members if no match return 0 and 'data' pointer not fill Optimized for IPv4 or IPv6 search

Parameters
+ + + + +
[in]ipPointer to ip address structure
[in]prefix_contextPointer to interval_search_context structure
[out]dataPointer to array of void pointers - pointers to data
+
+
+
Returns
int 0 if no match, >0 Number of data members in matched interval
+ +

Definition at line 924 of file ip_prefix_search.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/ip__prefix__search_8h_source.html b/doc/unirec/ip__prefix__search_8h_source.html new file mode 100644 index 00000000..6af4ea5c --- /dev/null +++ b/doc/unirec/ip__prefix__search_8h_source.html @@ -0,0 +1,101 @@ + + + + + + + +UniRec: ip_prefix_search.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
ip_prefix_search.h
+
+
+Go to the documentation of this file.
1 
10 /*
11  * Copyright (C) 2013,2014 CESNET
12  *
13  * LICENSE TERMS
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  * 1. Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in
22  * the documentation and/or other materials provided with the
23  * distribution.
24  * 3. Neither the name of the Company nor the names of its contributors
25  * may be used to endorse or promote products derived from this
26  * software without specific prior written permission.
27  *
28  * ALTERNATIVELY, provided that this notice is retained in full, this
29  * product may be distributed under the terms of the GNU General Public
30  * License (GPL) version 2 or later, in which case the provisions
31  * of the GPL apply INSTEAD OF those given above.
32  *
33  * This software is provided ``as is'', and any express or implied
34  * warranties, including, but not limited to, the implied warranties of
35  * merchantability and fitness for a particular purpose are disclaimed.
36  * In no event shall the company or contributors be liable for any
37  * direct, indirect, incidental, special, exemplary, or consequential
38  * damages (including, but not limited to, procurement of substitute
39  * goods or services; loss of use, data, or profits; or business
40  * interruption) however caused and on any theory of liability, whether
41  * in contract, strict liability, or tort (including negligence or
42  * otherwise) arising in any way out of the use of this software, even
43  * if advised of the possibility of such damage.
44  *
45  */
46 
47 #ifndef IP_PREFIX_SEARCH_H
48 #define IP_PREFIX_SEARCH_H
49 
50 #include "ipaddr.h"
51 
52 /* Default size of data pointer array */
53 #define DATASLOTS 8
54 
55 /* Default size of data collector */
56 #define COLLECTORSLOTS 16
57 
58 /* Default size of ipv6 and ipv4 network collector */
59 #define NETWORKSLOTS 16
60 
64 typedef struct network {
66  uint32_t mask;
67  void *data;
68  size_t data_len;
70 
74 typedef struct network_list {
75  uint32_t net_count;
78 
83 typedef struct {
84  // Don't move offset is set
87  uint32_t data_cnt;
88  size_t array_len;
89  void **data_array;
91 
96 typedef struct {
97  uint32_t v4_count;
98  uint32_t v6_count;
102 
112 
119 int ipps_destroy(ipps_context_t *prefix_context);
120 
133 int ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data);
134 
135 #endif /* ip_prefix_search.h */
int ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data)
+
ip_addr_t low_ip
Low IP of interval.
+
Structure to store both IPv4 and IPv6 addresses and associated functions.
+
void ** data_array
Array of pointers to data.
+
uint32_t v4_count
Number of intervals in IPv4 array.
+
uint32_t data_cnt
Number of currently used data pointers in &#39;data_array&#39;.
+ +
ipps_interval_t * v6_prefix_intervals
Pointer to IPv6 intervals array.
+
ipps_interval_t * v4_prefix_intervals
Pointer to IPv4 intervals array.
+
size_t data_len
Number of bytes in &#39;data&#39;.
+
ipps_network_t * networks
Pointer to networks array.
+ + + +
uint32_t v6_count
Number of intervals in IPv6 array.
+ +
ipps_context_t * ipps_init(ipps_network_list_t *networks)
+
size_t array_len
Allocated size of &#39;data_array&#39; => total available slots.
+
ip_addr_t addr
Network IP address.
+
uint32_t mask
Network mask, CIDR notation, use for indexing.
+
uint32_t net_count
Number of networks in &#39;networks&#39; array.
+
ip_addr_t high_ip
High IP of interval.
+
void * data
Pointer to same data.
+
int ipps_destroy(ipps_context_t *prefix_context)
+
+ + + + diff --git a/doc/unirec/ipaddr_8h.html b/doc/unirec/ipaddr_8h.html new file mode 100644 index 00000000..7df480d9 --- /dev/null +++ b/doc/unirec/ipaddr_8h.html @@ -0,0 +1,134 @@ + + + + + + + +UniRec: ipaddr.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
ipaddr.h File Reference
+
+
+ +

Structure to store both IPv4 and IPv6 addresses and associated functions. +More...

+
#include "inline.h"
+#include <stdint.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

union  ip_addr_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

INLINE int ip_is4 (const ip_addr_t *addr)
 
INLINE int ip_is6 (const ip_addr_t *addr)
 
INLINE uint32_t ip_get_v4_as_int (ip_addr_t *addr)
 
INLINE char * ip_get_v4_as_bytes (const ip_addr_t *addr)
 
INLINE ip_addr_t ip_from_int (uint32_t i)
 
INLINE ip_addr_t ip_from_4_bytes_be (char b[4])
 
INLINE ip_addr_t ip_from_4_bytes_le (char b[4])
 
INLINE ip_addr_t ip_from_16_bytes_be (char b[16])
 
INLINE ip_addr_t ip_from_16_bytes_le (char b[16])
 
INLINE int ip_cmp (const ip_addr_t *addr1, const ip_addr_t *addr2)
 
INLINE int ip_is_null (const ip_addr_t *addr)
 
INLINE int ip_from_str (const char *str, ip_addr_t *addr)
 
INLINE void ip_to_str (const ip_addr_t *addr, char *str)
 
+

Detailed Description

+

Structure to store both IPv4 and IPv6 addresses and associated functions.

+
Author
Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
+
Date
2013
+
+2014
+ +

Definition in file ipaddr.h.

+
+ + + + diff --git a/doc/unirec/ipaddr_8h_source.html b/doc/unirec/ipaddr_8h_source.html new file mode 100644 index 00000000..bc834d4e --- /dev/null +++ b/doc/unirec/ipaddr_8h_source.html @@ -0,0 +1,97 @@ + + + + + + + +UniRec: ipaddr.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
ipaddr.h
+
+
+Go to the documentation of this file.
1 
38 /*
39  * Copyright (C) 2013,2014 CESNET
40  *
41  * LICENSE TERMS
42  *
43  * Redistribution and use in source and binary forms, with or without
44  * modification, are permitted provided that the following conditions
45  * are met:
46  * 1. Redistributions of source code must retain the above copyright
47  * notice, this list of conditions and the following disclaimer.
48  * 2. Redistributions in binary form must reproduce the above copyright
49  * notice, this list of conditions and the following disclaimer in
50  * the documentation and/or other materials provided with the
51  * distribution.
52  * 3. Neither the name of the Company nor the names of its contributors
53  * may be used to endorse or promote products derived from this
54  * software without specific prior written permission.
55  *
56  * ALTERNATIVELY, provided that this notice is retained in full, this
57  * product may be distributed under the terms of the GNU General Public
58  * License (GPL) version 2 or later, in which case the provisions
59  * of the GPL apply INSTEAD OF those given above.
60  *
61  * This software is provided ``as is'', and any express or implied
62  * warranties, including, but not limited to, the implied warranties of
63  * merchantability and fitness for a particular purpose are disclaimed.
64  * In no event shall the company or contributors be liable for any
65  * direct, indirect, incidental, special, exemplary, or consequential
66  * damages (including, but not limited to, procurement of substitute
67  * goods or services; loss of use, data, or profits; or business
68  * interruption) however caused and on any theory of liability, whether
69  * in contract, strict liability, or tort (including negligence or
70  * otherwise) arising in any way out of the use of this software, even
71  * if advised of the possibility of such damage.
72  *
73  */
74 
75 #ifndef _IPADDR_H_
76 #define _IPADDR_H_
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 #include "inline.h"
83 
84 #include <stdint.h>
85 #include <string.h>
86 #ifndef __WIN32
87 #include <arpa/inet.h>
88 #include <sys/socket.h>
89 #include <sys/types.h>
90 #else
91 #define ntohl(x) ((x & 0x0000000ff) << 24) | ((x & 0x0000ff00) << 8) | \
92  ((x & 0x00ff0000) >> 8) | ((x & 0xff000000) >> 24)
93 #define htonl(x) ntohl(x)
94 #endif
95 
101 typedef union ip_addr_u {
105  uint8_t bytes[16];
109  uint8_t ui8[16];
113  uint16_t ui16[8];
117  uint32_t ui32[4];
121  uint64_t ui64[2];
122 } ip_addr_t;
123 
124 
131 INLINE int ip_is4(const ip_addr_t *addr)
132 {
133  return (addr->ui64[0] == 0 && addr->ui32[3] == 0xffffffff);
134 }
135 
143 INLINE int ip_is6(const ip_addr_t *addr)
144 {
145  return !ip_is4(addr);
146 }
147 
158 {
159  return ntohl(addr->ui32[2]);
160 }
161 
172 {
173  return (char *) &addr->bytes[8];
174 }
175 
176 
184 {
185  ip_addr_t a;
186  a.ui64[0] = 0;
187  a.ui32[2] = htonl(i);
188  a.ui32[3] = 0xffffffff;
189  return a;
190 }
191 
200 {
201  ip_addr_t a;
202  a.ui64[0] = 0;
203  a.bytes[8] = b[0];
204  a.bytes[9] = b[1];
205  a.bytes[10] = b[2];
206  a.bytes[11] = b[3];
207  a.ui32[3] = 0xffffffff;
208  return a;
209 }
210 
219 {
220  ip_addr_t a;
221  a.ui64[0] = 0;
222  a.bytes[8] = b[3];
223  a.bytes[9] = b[2];
224  a.bytes[10] = b[1];
225  a.bytes[11] = b[0];
226  a.ui32[3] = 0xffffffff;
227  return a;
228 }
229 
237 {
238  ip_addr_t a;
239  memcpy(&a, b, 16);
240  return a;
241 }
242 
250 {
251  ip_addr_t a;
252  int i;
253  for (i = 0; i < 16; i++) {
254  a.bytes[i] = b[15-i];
255  }
256  return a;
257 }
258 
266 INLINE int ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2)
267 {
268  return memcmp((const char *)addr1, (const char *)addr2, 16);
269 }
270 
283 INLINE int ip_is_null(const ip_addr_t *addr)
284 {
285  if (addr->ui64[0] == 0) {
286  if (addr->ui64[1] == 0 || (addr->ui32[2] == 0 && addr->ui32[3] == 0xffffffff)) {
287  return 1;
288  }
289  }
290  return 0;
291 }
292 
293 #ifndef __WIN32
294 
301 INLINE int ip_from_str(const char *str, ip_addr_t *addr)
302 {
303  char tmp[16];
304  if (strchr(str, ':') == NULL) { // IPv4
305  if (inet_pton(AF_INET, str, (void *) tmp) != 1) {
306  return 0; // err
307  }
308  *addr = ip_from_4_bytes_be(tmp);
309  return 1;
310  } else { // IPv6
311  if (inet_pton(AF_INET6, str, (void *) tmp) != 1) {
312  return 0; // err
313  }
314  *addr = ip_from_16_bytes_be(tmp);
315  return 1;
316  }
317 }
318 
325 INLINE void ip_to_str(const ip_addr_t *addr, char *str)
326 {
327  if (ip_is4(addr)) { // IPv4
328  inet_ntop(AF_INET, ip_get_v4_as_bytes(addr), str, INET6_ADDRSTRLEN);
329  } else { // IPv6
330  inet_ntop(AF_INET6, addr, str, INET6_ADDRSTRLEN);
331  }
332 }
333 #endif
334 
335 #ifdef __cplusplus
336 }
337 #endif
338 
339 #endif
340 
INLINE ip_addr_t ip_from_16_bytes_le(char b[16])
Definition: ipaddr.h:249
+
INLINE uint32_t ip_get_v4_as_int(ip_addr_t *addr)
Definition: ipaddr.h:157
+ +
INLINE ip_addr_t ip_from_16_bytes_be(char b[16])
Definition: ipaddr.h:236
+
INLINE int ip_is_null(const ip_addr_t *addr)
Definition: ipaddr.h:283
+
uint8_t bytes[16]
Definition: ipaddr.h:105
+
INLINE int ip_from_str(const char *str, ip_addr_t *addr)
Definition: ipaddr.h:301
+
INLINE int ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2)
Definition: ipaddr.h:266
+
INLINE ip_addr_t ip_from_4_bytes_be(char b[4])
Definition: ipaddr.h:199
+
uint32_t ui32[4]
Definition: ipaddr.h:117
+ +
INLINE ip_addr_t ip_from_int(uint32_t i)
Definition: ipaddr.h:183
+
#define INLINE
Definition: inline.h:12
+
INLINE int ip_is6(const ip_addr_t *addr)
Definition: ipaddr.h:143
+
memcpy(buffer, rec, ur_rec_size(tmplt, rec))
+
INLINE void ip_to_str(const ip_addr_t *addr, char *str)
Definition: ipaddr.h:325
+
INLINE int ip_is4(const ip_addr_t *addr)
Definition: ipaddr.h:131
+
INLINE ip_addr_t ip_from_4_bytes_le(char b[4])
Definition: ipaddr.h:218
+
uint64_t ui64[2]
Definition: ipaddr.h:121
+
INLINE char * ip_get_v4_as_bytes(const ip_addr_t *addr)
Definition: ipaddr.h:171
+
+ + + + diff --git a/doc/unirec/ipaddr__cpp_8h.html b/doc/unirec/ipaddr__cpp_8h.html new file mode 100644 index 00000000..4cf3edb0 --- /dev/null +++ b/doc/unirec/ipaddr__cpp_8h.html @@ -0,0 +1,180 @@ + + + + + + + +UniRec: ipaddr_cpp.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.2.6 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
ipaddr_cpp.h File Reference
+
+
+
#include "ipaddr.h"
+#include <string>
+#include <iostream>
+#include <arpa/inet.h>
+
+

Go to the source code of this file.

+ + + + +

+Data Structures

class  IPaddr_cpp
 
+ + + + + +

+Functions

uint64_t swap_bytes (const uint64_t x)
 
std::ostream & operator<< (std::ostream &os, const IPaddr_cpp &ip)
 
+

Function Documentation

+ +

◆ operator<<()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::ostream& operator<< (std::ostream & os,
const IPaddr_cppip 
)
+
+inline
+
+

Print IP address as string.

+
Parameters
+ + + +
[in]osoutput stream
[in]ipIP address to print
+
+
+
Returns
output stream
+ +

Definition at line 136 of file ipaddr_cpp.h.

+ +
+
+ +

◆ swap_bytes()

+ +
+
+ + + + + +
+ + + + + + + + +
uint64_t swap_bytes (const uint64_t x)
+
+inline
+
+

Swap bytes of 64b number.

+
Parameters
+ + +
[in]x64b number to swap bytes for.
+
+
+
Returns
Number with swapped bytes (least significant byte becomes most significant byte in result)
+ +

Definition at line 57 of file ipaddr_cpp.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/ipaddr__cpp_8h_source.html b/doc/unirec/ipaddr__cpp_8h_source.html new file mode 100644 index 00000000..ffc3f6b8 --- /dev/null +++ b/doc/unirec/ipaddr__cpp_8h_source.html @@ -0,0 +1,93 @@ + + + + + + + +UniRec: ipaddr_cpp.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.2.6 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
ipaddr_cpp.h
+
+
+Go to the documentation of this file.
1 #ifndef _IPADDR_CPP_H
2 #define _IPADDR_CPP_H
3 
4 #include "ipaddr.h"
5 #include <string>
6 #include <iostream>
7 #include <arpa/inet.h> // INET6_ADDRSTRLEN value
8 
14 class IPaddr_cpp {
15  bool new_object;
16 public:
17  const ip_addr_t *data;
18  inline IPaddr_cpp();
19 
23  inline IPaddr_cpp(const ip_addr_t *ptr) : data(ptr) {new_object = false;};
24  inline ~IPaddr_cpp();
25  bool operator<(const IPaddr_cpp &key2) const;
26  bool operator<=(const IPaddr_cpp &key2) const;
27  bool operator>(const IPaddr_cpp &key2) const;
28  bool operator>=(const IPaddr_cpp &key2) const;
29  bool operator==(const IPaddr_cpp &key2) const;
30  bool operator!=(const IPaddr_cpp &key2) const;
31  std::string toString() const;
32 };
33 
38 {
39  data = new ip_addr_t;
40  new_object = true;
41 }
42 
47 {
48  if (new_object) delete data;
49 }
50 
57 inline uint64_t swap_bytes(const uint64_t x)
58 {
59  return
60  ((x & 0x00000000000000ffLL) << 56) |
61  ((x & 0x000000000000ff00LL) << 40) |
62  ((x & 0x0000000000ff0000LL) << 24) |
63  ((x & 0x00000000ff000000LL) << 8) |
64  ((x & 0x000000ff00000000LL) >> 8) |
65  ((x & 0x0000ff0000000000LL) >> 24) |
66  ((x & 0x00ff000000000000LL) >> 40) |
67  ((x & 0xff00000000000000LL) >> 56);
68 }
69 
73 inline bool IPaddr_cpp::operator<(const IPaddr_cpp &key2) const {
74  return ((swap_bytes(this->data->ui64[0]) < swap_bytes(key2.data->ui64[0])) ||
75  ((swap_bytes(this->data->ui64[0]) == swap_bytes(key2.data->ui64[0])) &&
76  (swap_bytes(this->data->ui64[1]) < swap_bytes(key2.data->ui64[1]))));
77 }
78 
82 inline bool IPaddr_cpp::operator<=(const IPaddr_cpp &key2) const {
83  return !(*this > key2);
84 }
85 
89 inline bool IPaddr_cpp::operator>(const IPaddr_cpp &key2) const {
90  return ((swap_bytes(this->data->ui64[0]) > swap_bytes(key2.data->ui64[0])) ||
91  ((swap_bytes(this->data->ui64[0]) == swap_bytes(key2.data->ui64[0])) &&
92  (swap_bytes(this->data->ui64[1]) > swap_bytes(key2.data->ui64[1]))));
93 }
94 
98 inline bool IPaddr_cpp::operator>=(const IPaddr_cpp &key2) const {
99  return !(*this < key2);
100 }
101 
105 inline bool IPaddr_cpp::operator==(const IPaddr_cpp &key2) const {
106  return ((this->data->ui64[0] == key2.data->ui64[0]) && (this->data->ui64[1] == key2.data->ui64[1]));
107 }
108 
113 inline bool IPaddr_cpp::operator!=(const IPaddr_cpp &key2) const {
114  return !(*this == key2);
115 }
116 
122 inline std::string IPaddr_cpp::toString() const
123 {
124  char buf[INET6_ADDRSTRLEN];
125  ip_to_str(this->data, buf);
126  return std::string(buf);
127 }
128 
136 inline std::ostream& operator<<(std::ostream &os, const IPaddr_cpp &ip)
137 {
138  return os << ip.toString();
139 }
140 
141 #endif
bool operator>(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:89
+ +
bool operator<(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:73
+
Structure to store both IPv4 and IPv6 addresses and associated functions.
+
bool operator<=(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:82
+
uint64_t swap_bytes(const uint64_t x)
Definition: ipaddr_cpp.h:57
+
bool operator!=(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:113
+
bool operator>=(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:98
+
const ip_addr_t * data
Definition: ipaddr_cpp.h:17
+
bool new_object
Definition: ipaddr_cpp.h:15
+ +
std::ostream & operator<<(std::ostream &os, const IPaddr_cpp &ip)
Definition: ipaddr_cpp.h:136
+
bool operator==(const IPaddr_cpp &key2) const
Definition: ipaddr_cpp.h:105
+
IPaddr_cpp(const ip_addr_t *ptr)
Definition: ipaddr_cpp.h:23
+ +
INLINE void ip_to_str(const ip_addr_t *addr, char *str)
Definition: ipaddr.h:325
+
uint64_t ui64[2]
Definition: ipaddr.h:121
+ +
std::string toString() const
Definition: ipaddr_cpp.h:122
+
+ + + + diff --git a/doc/unirec/ipps__internal_8h.html b/doc/unirec/ipps__internal_8h.html new file mode 100644 index 00000000..cf015b75 --- /dev/null +++ b/doc/unirec/ipps__internal_8h.html @@ -0,0 +1,876 @@ + + + + + + + +UniRec: ipps_internal.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
ipps_internal.h File Reference
+
+
+ +

Init context and prefix search - Internal functions and structures. +More...

+ +

Go to the source code of this file.

+ + + + +

+Data Structures

struct  ipps_interval_node_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

uint32_t ** create_ip_v6_net_mask_array (void)
 
void mask_ipv6 (ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
 
int cmp_net_v4 (const void *v1, const void *v2)
 
int cmp_net_v6 (const void *v1, const void *v2)
 
void fill_interval_by_network (const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array)
 
ipps_interval_node_tnew_interval (const ip_addr_t *low_ip, const ip_addr_t *high_ip)
 
ipps_interval_node_tinsert_new_interval (ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip)
 
void ip_dec (const ip_addr_t *ip, ip_addr_t *ip_dec)
 
void ip_inc (const ip_addr_t *ip, ip_addr_t *ip_inc)
 
ipps_context_tnew_context (void)
 
ipps_interval_tinit_context (ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array)
 
int add_data (ipps_interval_t *interval, void *data, size_t data_len)
 
int copy_all_data (ipps_interval_t *dest, ipps_interval_t *src)
 
void destroy_ip_v6_net_mask_array (uint32_t **net_mask_array)
 
int free_data (ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt)
 
int destroy_list (ipps_interval_node_t *interval_list)
 
+

Detailed Description

+

Init context and prefix search - Internal functions and structures.

+
Author
Erik Sabik xsabi.nosp@m.k02@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Ondrej Ploteny xplot.nosp@m.e01@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
Date
2016
+ +

Definition in file ipps_internal.h.

+

Data Structure Documentation

+ +

◆ ipps_interval_node_t

+ +
+
+ + + + +
struct ipps_interval_node_t
+
+

Structure of temporary list of intervals Used for sort and merge overlaps intervals

+ +

Definition at line 52 of file ipps_internal.h.

+
+ + + + + + + +
Data Fields
+ipps_interval_t * +interval +Pointer to interval structure.
+struct ipps_interval_node * +next +Next node in list, NULL if last node in list.
+ +
+
+

Function Documentation

+ +

◆ add_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int add_data (ipps_interval_tinterval,
void * data,
size_t data_len 
)
+
+

Add data to interval data array Alloc memory size of 'data_len' and hard copy 'data'. Pointer to new data is insert to 'data_array' in interval structure 'interval', increment data counter. Realloc 'data_array' in 'interval' if there is not enough unused pointers

Parameters
+ + + + +
[in]intervalPointer to interval structure with data array and data counter
[in]dataPointer to same data
[in]data_lenNumber of bytes allocated in 'data'
+
+
+
Returns
0 if OK, 1 if alloc fails
+

Add data to interval data array Alloc memory size of 'data_len' and hard copy 'data'. Pointer to new data is insert to 'data_array' in interval structure 'interval', increment data counter. Realloc 'data_array' in 'interval' if there is not enough unused pointers

Parameters
+ + + + +
[in]intervalPointer to interval structure with data array and data counter
[in]dataPointer to same data
[in]data_lenNumber of bytes allocated in 'data' return 0 if OK, 1 if alloc fails
+
+
+ +

Definition at line 583 of file ip_prefix_search.c.

+ +
+
+ +

◆ cmp_net_v4()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int cmp_net_v4 (const void * v1,
const void * v2 
)
+
+

Compare 2 IPv4 network addresses Compare byte by byte 2 IPv4 addresses

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+

Compare 2 IPv4 network addresses and mask Compare byte by byte 2 IPv4 addresses. If they are equal, compare mask

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+ +

Definition at line 129 of file ip_prefix_search.c.

+ +
+
+ +

◆ cmp_net_v6()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int cmp_net_v6 (const void * v1,
const void * v2 
)
+
+

Compare 2 IPv6 network addresses Compare byte by byte 2 IPv6 addresses.

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+

Compare 2 IPv6 network addresses and mask Compare byte by byte 2 IPv6 addresses. If they are equal, compare mask

Parameters
+ + + +
[in]v1Pointer to network structure.
[in]v2Pointer to network structure.
+
+
+
Returns
>0 if v1 IP address is greater than v2 IP address, 0 if equal, <0 if v1 is lower than v2
+ +

Definition at line 152 of file ip_prefix_search.c.

+ +
+
+ +

◆ copy_all_data()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int copy_all_data (ipps_interval_tdest,
ipps_interval_tsrc 
)
+
+

Append data in 'dest' with all data from 'src' interval Concat 'dest' and 'src' data_arrays: if necessary, realloc destination data array. Copy all data pointers from src, behind last 'dest' data pointer

Parameters
+ + + +
[out]destPointer to destination interval
[in]srcPointer to source interval
+
+
+
Returns
0 if OK, 1 if data array realloc fails
+

Append data in 'dest' with all data from 'src' interval Concat 'dest' and 'src' data_arrays: if necessary realloc destination data array. Copy all data pointers from src, behind last 'dest' data pointer

Parameters
+ + + +
[out]destPointer to destination interval
[in]srcPointer to source interval
+
+
+
Returns
0 if OK, 1 if data array realloc fails
+ +

Definition at line 553 of file ip_prefix_search.c.

+ +
+
+ +

◆ create_ip_v6_net_mask_array()

+ +
+
+ + + + + + + + +
uint32_t** create_ip_v6_net_mask_array (void )
+
+

Create 2D array for IPv6 networks mask Create 2D array net_mask_array with 129 rows and 4 columns and fill it with every possible IPv6 network mask.

Returns
Pointer to 2D array.
+

Create 2D array for IPv6 networks mask Create 2D array net_mask_array with 129 rows and 4 columns and fill it with every possible IPv6 network mask.

Returns
Pointer to 2D array.
+ +

Definition at line 72 of file ip_prefix_search.c.

+ +
+
+ +

◆ destroy_ip_v6_net_mask_array()

+ +
+
+ + + + + + + + +
void destroy_ip_v6_net_mask_array (uint32_t ** net_mask_array)
+
+

Dealloc network mask array Dealloc array with every possible IPv6 mask

Parameters
+ + +
[in]net_mask_arrayPointer to 2D array
+
+
+
Returns
void
+

Destroy 2D array for IPv6 networks mask Dealloc 2D array net_mask_array with 129 rows and 4 columns and free every possible IPv6 network mask.

Parameters
+ + +
[in]net_mask_arrayPointer to 2D array
+
+
+
Returns
void
+ +

Definition at line 113 of file ip_prefix_search.c.

+ +
+
+ +

◆ destroy_list()

+ +
+
+ + + + + + + + +
int destroy_list (ipps_interval_node_tinterval_list)
+
+

Dealloc interval list Dealloc all node in 'interval_list', dealloc data Function is call if something get wrong and program need clean garbage in the middle of run

Parameters
+ + +
[in]iterval_listPointer to first node in list
+
+
+
Returns
0 if OK, 1 if data collector realloc fails
+

Dealloc interval list Dealloc all node in 'interval_list', dealloc data Function is call if something get wrong and program need clean garbage in the middle of run

Parameters
+ + +
[in]interval_listPointer to first node in list
+
+
+
Returns
0 if OK, 1 if data collector realloc fails
+ +

Definition at line 1041 of file ip_prefix_search.c.

+ +
+
+ +

◆ fill_interval_by_network()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void fill_interval_by_network (const ipps_network_tnet,
ipps_interval_tinter,
uint32_t ** net_mask_array 
)
+
+

Interval from network and mask Compute low and high IP address (net and broadcast address) from network 'net' using mask, save result to 'inter'

Parameters
+ + + + +
[in]netPointer to network structure
[out]interPointer to result interval
[in]net_mask_arrayPointer to 2D array with every possible net mask
+
+
+
Returns
void
+ +

Definition at line 194 of file ip_prefix_search.c.

+ +
+
+ +

◆ free_data()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int free_data (ipps_interval_tinterval,
void *** data_collector,
uint32_t * data_coll_cnt 
)
+
+

Dealloc 'data_array' in 'interval'

Parameters
+ + + + +
[in]intervalPointer to prefix interval structure
[out]data_collectorPointer to 2D array with freed data pointers
[out]data_collector_cntNumber of Pointers in 'data_collector'
+
+
+
Returns
0 if realloc is OK, 1 if realloc fail
+ +

Definition at line 1000 of file ip_prefix_search.c.

+ +
+
+ +

◆ init_context()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ipps_interval_t* init_context (ipps_network_t ** networks,
uint32_t network_count,
uint32_t * context_counter,
uint32_t ** net_mask_array 
)
+
+

Initialize array of intervals Function for each network in 'networks' array compute IP interval and insert interval to interval list. Each network data are hard copied. Overlapping intervals are splited and sorted. If intervals are overlaps, data are alloc only once and pointer to data is duplicated. Overlapping is detected by compare lows and highs IP addresses. End the end is sorted list copied to array for better access Function return pointer to sorted array of intervals and fill 'context_counter' by numbers of intervals.

Parameters
+ + + + + +
[in]networksPointer to array of network structures
[in]network_countNumber of networks in array
[out]context_counterPointer to integer, fill by number of intervals in result
[in]net_mask_arrayPointer to 2D array of network mask
+
+
+
Returns
NULL if memory alloc fails, Pointer to array of interval structure
+

Initialize array of intervals For each network in 'networks' array compute IP interval and insert it into interval list. All network data are hard copied. Overlapping intervals are split and sorted. If intervals are overlaps, data are allocated only once and pointer to data is duplicated. Overlapping is detected by comparing low and high IP addresses. At the end the sorted list is copied to an array for better access. Returns pointer to sorted array of intervals and fill 'context_counter' by number of intervals.

Parameters
+ + + + + +
[in]networksPointer to array of network structures
[in]network_countNumber of networks in array
[out]context_counterPointer to integer, fill by number of intervals in result
[in]net_mask_arrayPointer to 2D array of network mask
+
+
+
Returns
Pointer to array of interval structures, NULL if memory alloc fails
+ +

Definition at line 630 of file ip_prefix_search.c.

+ +
+
+ +

◆ insert_new_interval()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
ipps_interval_node_t* insert_new_interval (ipps_interval_node_tposition,
const ip_addr_tlow_ip,
const ip_addr_thigh_ip 
)
+
+

Post Insert to interval list Create new interval node and insert them for 'position' node. New created node is initialized and fill by 'low_ip' and 'high_ip' values.

Parameters
+ + + + +
[in]positionPointer to interval node structure, for post insert
[in]low_ipPointer to IP address structure
[in]high_ipPointer to IP address structure
+
+
+
Returns
NULL if malloc fails, else pointer to new inserted interval node in list
+

Post Insert to interval list Create new interval node and insert them for 'position' node. New created node is initialized and fill by 'low_ip' and 'high_ip' values.

Parameters
+ + + + +
[in]positionPointer to interval node structure, for post insert
[in]low_ipPointer to IP address structure
[in]high_ipPointer to IP address structure
+
+
+
Returns
Pointer to new inserted interval node in list, NULL if malloc fails
+ +

Definition at line 267 of file ip_prefix_search.c.

+ +
+
+ +

◆ ip_dec()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ip_dec (const ip_addr_tip,
ip_addr_tip_dec 
)
+
+

Decrement IP address Decrement IPv4 or IPv6 address 'ip' and save result to 'ip_dec'

Parameters
+ + + +
[in]ipPointer to ip address structure
[out]ip_decPointer to ip address structure
+
+
+
Returns
void
+

Decrement IP address Decrement IPv4 or IPv6 address 'ip' and save result to 'ip_dec'

Parameters
+ + + +
[in]ipPointer to input ip address structure
[out]ip_decPointer to output ip address structure
+
+
+
Returns
void
+ +

Definition at line 289 of file ip_prefix_search.c.

+ +
+
+ +

◆ ip_inc()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void ip_inc (const ip_addr_tip,
ip_addr_tip_inc 
)
+
+

Increment IP address Increment IPv4 or Ipv6 address 'ip' and save result to 'ip_inc'

Parameters
+ + + +
[in]ipPointer to network structure
[out]ip_incPointer to result interval
+
+
+
Returns
void
+

Increment IP address Increment IPv4 or Ipv6 address 'ip' and save result to 'ip_inc'

Parameters
+ + + +
[in]ipPointer to input ip address structure
[out]ip_incPointer to output ip address structure
+
+
+
Returns
void
+ +

Definition at line 316 of file ip_prefix_search.c.

+ +
+
+ +

◆ mask_ipv6()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void mask_ipv6 (ip_addr_tip,
uint32_t mask,
ip_addr_tmasked_ipv6,
uint32_t ** net_mask_array 
)
+
+

Mask IPv6 address Mask IPv6 address ip with network mask in_mask and save result to masked_ipv6.

Parameters
+ + + + + +
[in]ipPointer to IP union.
[in]maskNetwork mask.
[out]masked_ipv6Pointer to IP union.
[in]net_listPointer to networks list structure.
+
+
+
Returns
void.
+

Mask IPv6 address Mask IPv6 address ip with network mask mask and save result to masked_ipv6.

Parameters
+ + + + + +
[in]ipPointer to IP union.
[in]maskNetwork mask.
[out]masked_ipv6Pointer to IP union.
[in]net_listPointer to networks list structure.
+
+
+
Returns
void.
+ +

Definition at line 177 of file ip_prefix_search.c.

+ +
+
+ +

◆ new_context()

+ +
+
+ + + + + + + + +
ipps_context_t* new_context (void )
+
+

Create and initialize new interval_search_context structure

Returns
Pointer to interval_search_context struct, NULL if alloc fails
+ +

Definition at line 385 of file ip_prefix_search.c.

+ +
+
+ +

◆ new_interval()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ipps_interval_node_t* new_interval (const ip_addr_tlow_ip,
const ip_addr_thigh_ip 
)
+
+

Create new interval node Alloc and initialize new node to interval list

Parameters
+ + + +
[in]low_ipPointer to network structure
[in]high_ipPointer to result interval
+
+
+
Returns
NULL if malloc fail, pointer to new interval node
+

Create new interval node Alloc and initialize new node to interval list

Parameters
+ + + +
[in]low_ipPointer to network structure
[in]high_ipPointer to result interval
+
+
+
Returns
Pointer to new interval node, NULL if malloc fails
+ +

Definition at line 225 of file ip_prefix_search.c.

+ +
+
+
+ + + + diff --git a/doc/unirec/ipps__internal_8h_source.html b/doc/unirec/ipps__internal_8h_source.html new file mode 100644 index 00000000..bf28a833 --- /dev/null +++ b/doc/unirec/ipps__internal_8h_source.html @@ -0,0 +1,100 @@ + + + + + + + +UniRec: ipps_internal.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
ipps_internal.h
+
+
+Go to the documentation of this file.
1 
8 /*
9  * Copyright (C) 2013,2014 CESNET
10  *
11  * LICENSE TERMS
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in
20  * the documentation and/or other materials provided with the
21  * distribution.
22  * 3. Neither the name of the Company nor the names of its contributors
23  * may be used to endorse or promote products derived from this
24  * software without specific prior written permission.
25  *
26  * ALTERNATIVELY, provided that this notice is retained in full, this
27  * product may be distributed under the terms of the GNU General Public
28  * License (GPL) version 2 or later, in which case the provisions
29  * of the GPL apply INSTEAD OF those given above.
30  *
31  * This software is provided ``as is'', and any express or implied
32  * warranties, including, but not limited to, the implied warranties of
33  * merchantability and fitness for a particular purpose are disclaimed.
34  * In no event shall the company or contributors be liable for any
35  * direct, indirect, incidental, special, exemplary, or consequential
36  * damages (including, but not limited to, procurement of substitute
37  * goods or services; loss of use, data, or profits; or business
38  * interruption) however caused and on any theory of liability, whether
39  * in contract, strict liability, or tort (including negligence or
40  * otherwise) arising in any way out of the use of this software, even
41  * if advised of the possibility of such damage.
42  *
43  */
44 
45 #ifndef IPPS_INTERNAL_H
46 #define IPPS_INTERNAL_H
47 
52 typedef struct ipps_interval_node {
54  struct ipps_interval_node *next;
56 
63 uint32_t **create_ip_v6_net_mask_array(void);
64 
74 void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array);
75 
83 int cmp_net_v4(const void *v1, const void *v2);
84 
92 int cmp_net_v6(const void *v1, const void *v2);
93 
104  uint32_t **net_mask_array);
105 
113 ipps_interval_node_t *new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip);
114 
125  const ip_addr_t *low_ip, const ip_addr_t *high_ip);
126 
134 void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec);
135 
143 void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc);
144 
150 
151 
167 ipps_interval_t *init_context(ipps_network_t **networks, uint32_t network_count,
168  uint32_t *context_counter, uint32_t **net_mask_array);
169 
180 int add_data(ipps_interval_t *interval, void *data, size_t data_len);
181 
191 
198 void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array);
199 
200 
208 int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt);
209 
217 int destroy_list(ipps_interval_node_t *interval_list);
218 
219 #endif /* ip_prefix_search.h */
int destroy_list(ipps_interval_node_t *interval_list)
+
void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc)
+
struct ipps_interval_node * next
Next node in list, NULL if last node in list.
Definition: ipps_internal.h:54
+
ipps_interval_t * init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array)
+ +
int copy_all_data(ipps_interval_t *dest, ipps_interval_t *src)
+
int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt)
+
void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array)
+
void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
+
uint32_t ** create_ip_v6_net_mask_array(void)
+
int add_data(ipps_interval_t *interval, void *data, size_t data_len)
+ + + +
int cmp_net_v6(const void *v1, const void *v2)
+
ipps_interval_t * interval
Pointer to interval structure.
Definition: ipps_internal.h:53
+
ipps_interval_node_t * insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip)
+
int cmp_net_v4(const void *v1, const void *v2)
+
void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec)
+ +
void fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array)
+
ipps_interval_node_t * new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip)
+
ipps_context_t * new_context(void)
+
+ + + + diff --git a/doc/unirec/jquery.js b/doc/unirec/jquery.js new file mode 100644 index 00000000..2771c749 --- /dev/null +++ b/doc/unirec/jquery.js @@ -0,0 +1,115 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' + + + +
+ +
+
links.h File Reference
+
+
+ +

Definition of structures and functions for handling LINK_BIT_FIELD. Implementation is in unirec.c. It uses link mask (hexadecimal, 64bit long number) to determine which links are used and how they are used. It means, that one can use e.g. 9 links, which do not have to fill ones in LINK_BIT_FIELD on positions 1 - 9 necessary but on positions specified by link mask. +More...

+
#include "inline.h"
+
+

Go to the source code of this file.

+
+ + + + +

+Data Structures

+ + + +

+Macros

#define MAX_LINK_COUNT   64
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

ur_links_tur_create_links (const char *mask)
 Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links. More...
 
void ur_free_links (ur_links_t *links)
 Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links. More...
 
INLINE int ur_get_link_index (ur_links_t *links, uint64_t link_bit_field)
 Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found. More...
 
INLINE uint64_t ur_get_link_bit_field_position (ur_links_t *links, unsigned int index)
 Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed. More...
 
INLINE uint64_t ur_get_link_mask (ur_links_t *links)
 Get link mask. More...
 
INLINE unsigned int ur_get_link_count (ur_links_t *links)
 Get link count. More...
 
+

Detailed Description

+

Definition of structures and functions for handling LINK_BIT_FIELD. Implementation is in unirec.c. It uses link mask (hexadecimal, 64bit long number) to determine which links are used and how they are used. It means, that one can use e.g. 9 links, which do not have to fill ones in LINK_BIT_FIELD on positions 1 - 9 necessary but on positions specified by link mask.

+
Author
Pavel Krobot xkrob.nosp@m.o01@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
+
+Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
+
Date
2013
+
+2015
+ +

Definition in file links.h.

+
+ + + + diff --git a/doc/unirec/links_8h_source.html b/doc/unirec/links_8h_source.html new file mode 100644 index 00000000..8ba8551e --- /dev/null +++ b/doc/unirec/links_8h_source.html @@ -0,0 +1,89 @@ + + + + + + + +UniRec: links.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
links.h
+
+
+Go to the documentation of this file.
1 
14  /*
15  * Copyright (C) 2013-2015 CESNET
16  *
17  * LICENSE TERMS
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions
21  * are met:
22  * 1. Redistributions of source code must retain the above copyright
23  * notice, this list of conditions and the following disclaimer.
24  * 2. Redistributions in binary form must reproduce the above copyright
25  * notice, this list of conditions and the following disclaimer in
26  * the documentation and/or other materials provided with the
27  * distribution.
28  * 3. Neither the name of the Company nor the names of its contributors
29  * may be used to endorse or promote products derived from this
30  * software without specific prior written permission.
31  *
32  * ALTERNATIVELY, provided that this notice is retained in full, this
33  * product may be distributed under the terms of the GNU General Public
34  * License (GPL) version 2 or later, in which case the provisions
35  * of the GPL apply INSTEAD OF those given above.
36  *
37  * This software is provided ``as is'', and any express or implied
38  * warranties, including, but not limited to, the implied warranties of
39  * merchantability and fitness for a particular purpose are disclaimed.
40  * In no event shall the company or contributors be liable for any
41  * direct, indirect, incidental, special, exemplary, or consequential
42  * damages (including, but not limited to, procurement of substitute
43  * goods or services; loss of use, data, or profits; or business
44  * interruption) however caused and on any theory of liability, whether
45  * in contract, strict liability, or tort (including negligence or
46  * otherwise) arising in any way out of the use of this software, even
47  * if advised of the possibility of such damage.
48  *
49  */
50 #ifndef _UNIREC_LINKS_H_
51 #define _UNIREC_LINKS_H_
52 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 #include "inline.h"
63 
64 #define MAX_LINK_COUNT 64 //since link mask is held by uint64_t
65 
70 typedef struct {
71  unsigned int link_count;
72  uint64_t link_mask;
73  uint64_t *link_indexes;
74 } ur_links_t;
75 
84 ur_links_t *ur_create_links(const char *mask);
85 
91 void ur_free_links(ur_links_t *links);
92 
103 INLINE int ur_get_link_index(ur_links_t *links, uint64_t link_bit_field)
104 {
105  unsigned int i;
106  for (i = 0; i < links->link_count; ++i) {
107  /* search for corresponding value */
108  if ((link_bit_field >> links->link_indexes[i]) & 1L) {
109  return i;
110  }
111  }
112  /* ERROR */
113  return -1;
114 }
115 
124 INLINE uint64_t ur_get_link_bit_field_position(ur_links_t *links, unsigned int index)
125 {
126  if (index < links->link_count) {//index have to be from interval 0 - (n-1)
127  return links->link_indexes[index];
128  } else {
129  return 0;//returns 0 on error since no link can possibly have value 1 on
130  //position 0 in LINK_BIT_FIELD
131  }
132 }
133 
139 {
140  return links->link_mask;
141 }
142 
147 INLINE unsigned int ur_get_link_count(ur_links_t *links)
148 {
149  return links->link_count;
150 }
151 
152 #ifdef __cplusplus
153 } // extern "C"
154 #endif
155 
160 #endif
161 // END OF links.h
+ + + + + + + +
#define INLINE
Definition: inline.h:12
+ + + +
+ + + + diff --git a/doc/unirec/macaddr_8h.html b/doc/unirec/macaddr_8h.html new file mode 100644 index 00000000..b1a0c051 --- /dev/null +++ b/doc/unirec/macaddr_8h.html @@ -0,0 +1,433 @@ + + + + + + + +UniRec: macaddr.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
macaddr.h File Reference
+
+
+ +

Structure to store MAC address and associated functions. +More...

+
#include <stdint.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <string.h>
+#include "inline.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + +

+Macros

#define MAC_STR_LEN   18
 
#define PRIx8   "x"
 
#define SCNx8   "hhx"
 
#define MAC_ADD_FORMAT_SCN   "%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ""
 
#define MAC_ADD_FORMAT_PRI   "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ""
 
+ + + + + + + + + + + + + +

+Functions

struct __attribute__ ((packed)) mac_addr_s
 
INLINE mac_addr_t mac_from_bytes (uint8_t *array)
 
INLINE int mac_from_str (const char *str, mac_addr_t *addr)
 
INLINE int mac_cmp (const mac_addr_t *addr1, const mac_addr_t *addr2)
 
INLINE void mac_to_str (const mac_addr_t *addr, char *str)
 
INLINE void mac_to_bytes (const mac_addr_t *addr, uint8_t *array)
 
+ + + +

+Variables

 mac_addr_t
 
+

Detailed Description

+

Structure to store MAC address and associated functions.

+
Author
Jiri Havranek havra.nosp@m.ji6@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
+
Date
2017
+ +

Definition in file macaddr.h.

+

Macro Definition Documentation

+ +

◆ MAC_ADD_FORMAT_PRI

+ +
+
+ + + + +
#define MAC_ADD_FORMAT_PRI   "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ""
+
+ +

Definition at line 68 of file macaddr.h.

+ +
+
+ +

◆ MAC_ADD_FORMAT_SCN

+ +
+
+ + + + +
#define MAC_ADD_FORMAT_SCN   "%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ""
+
+ +

Definition at line 67 of file macaddr.h.

+ +
+
+ +

◆ MAC_STR_LEN

+ +
+
+ + + + +
#define MAC_STR_LEN   18
+
+ +

Definition at line 57 of file macaddr.h.

+ +
+
+ +

◆ PRIx8

+ +
+
+ + + + +
#define PRIx8   "x"
+
+ +

Definition at line 60 of file macaddr.h.

+ +
+
+ +

◆ SCNx8

+ +
+
+ + + + +
#define SCNx8   "hhx"
+
+ +

Definition at line 64 of file macaddr.h.

+ +
+
+

Function Documentation

+ +

◆ __attribute__()

+ +
+
+ + + + + + + + +
struct __attribute__ ((packed) )
+
+

Structure containing MAC address bytes.

+ +

Definition at line 73 of file macaddr.h.

+ +
+
+ +

◆ mac_cmp()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int mac_cmp (const mac_addr_taddr1,
const mac_addr_taddr2 
)
+
+

Compare two MAC addresses.

+
Parameters
+ + + +
[in]addr1MAC address as mac_addr_t
[in]addr2MAC address as mac_addr_t
+
+
+
Returns
Positive number (>0) if addr1 > addr2, negative number (<0) if addr1 < addr2, and zero (=0) if addr1 == addr2.
+ +

Definition at line 118 of file macaddr.h.

+ +
+
+ +

◆ mac_from_bytes()

+ +
+
+ + + + + + + + +
INLINE mac_addr_t mac_from_bytes (uint8_t * array)
+
+

Convert 6B array into mac_addr_t.

+
Parameters
+ + +
[in]array6B array containing MAC address bytes.
+
+
+
Returns
MAC address stored as mac_addr_t.
+ +

Definition at line 83 of file macaddr.h.

+ +
+
+ +

◆ mac_from_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE int mac_from_str (const char * str,
mac_addr_taddr 
)
+
+

Convert string into mac_addr_t.

+
Parameters
+ + + +
[in]strString for conversion.
[out]addrPointer to memory where to store MAC address.
+
+
+
Returns
1 on success, 0 on error i.e. string is not a valid MAC address.
+ +

Definition at line 99 of file macaddr.h.

+ +
+
+ +

◆ mac_to_bytes()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE void mac_to_bytes (const mac_addr_taddr,
uint8_t * array 
)
+
+

Convert mac_addr_t into bytes array.

+
Parameters
+ + + +
[in]addrPointer to MAC address.
[out]arrayPointer to memory where to store MAC address bytes. It must be of at least 6B size.
+
+
+ +

Definition at line 144 of file macaddr.h.

+ +
+
+ +

◆ mac_to_str()

+ +
+
+ + + + + + + + + + + + + + + + + + +
INLINE void mac_to_str (const mac_addr_taddr,
char * str 
)
+
+

Convert mac_addr_t into string.

+
Parameters
+ + + +
[in]addrPointer to MAC address.
[out]strPointer to memory where to store converted MAC address. It must be of at least MAC_STR_LEN size.
+
+
+ +

Definition at line 129 of file macaddr.h.

+ +
+
+

Variable Documentation

+ +

◆ mac_addr_t

+ +
+
+ + + + +
mac_addr_t
+
+ +

Definition at line 75 of file macaddr.h.

+ +
+
+
+ + + + diff --git a/doc/unirec/macaddr_8h_source.html b/doc/unirec/macaddr_8h_source.html new file mode 100644 index 00000000..a0469bac --- /dev/null +++ b/doc/unirec/macaddr_8h_source.html @@ -0,0 +1,90 @@ + + + + + + + +UniRec: macaddr.h Source File + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
macaddr.h
+
+
+Go to the documentation of this file.
1 
7 /*
8  * Copyright (C) 2017 CESNET
9  *
10  * LICENSE TERMS
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  * 3. Neither the name of the Company nor the names of its contributors
22  * may be used to endorse or promote products derived from this
23  * software without specific prior written permission.
24  *
25  * ALTERNATIVELY, provided that this notice is retained in full, this
26  * product may be distributed under the terms of the GNU General Public
27  * License (GPL) version 2 or later, in which case the provisions
28  * of the GPL apply INSTEAD OF those given above.
29  *
30  * This software is provided ``as is'', and any express or implied
31  * warranties, including, but not limited to, the implied warranties of
32  * merchantability and fitness for a particular purpose are disclaimed.
33  * In no event shall the company or contributors be liable for any
34  * direct, indirect, incidental, special, exemplary, or consequential
35  * damages (including, but not limited to, procurement of substitute
36  * goods or services; loss of use, data, or profits; or business
37  * interruption) however caused and on any theory of liability, whether
38  * in contract, strict liability, or tort (including negligence or
39  * otherwise) arising in any way out of the use of this software, even
40  * if advised of the possibility of such damage.
41  *
42  */
43 
44 #ifndef _MACADDR_H_
45 #define _MACADDR_H_
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #include <stdint.h>
52 #include <stdio.h>
53 #include <inttypes.h>
54 #include <string.h>
55 #include "inline.h"
56 
57 #define MAC_STR_LEN 18
58 
59 #ifndef PRIx8
60 #define PRIx8 "x"
61 #endif
62 
63 #ifndef SCNx8
64 #define SCNx8 "hhx"
65 #endif
66 
67 #define MAC_ADD_FORMAT_SCN "%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ""
68 #define MAC_ADD_FORMAT_PRI "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ""
69 
73 typedef struct __attribute__((packed)) mac_addr_s {
74  uint8_t bytes[6];
76 
84 {
85  mac_addr_t tmp;
86 
87  memcpy(&tmp.bytes, array, 6);
88 
89  return tmp;
90 }
91 
99 INLINE int mac_from_str(const char *str, mac_addr_t *addr)
100 {
101  int res = sscanf(str, MAC_ADD_FORMAT_SCN, &addr->bytes[0], &addr->bytes[1], &addr->bytes[2],
102  &addr->bytes[3], &addr->bytes[4], &addr->bytes[5]);
103  if (res == 6) {
104  return 1;
105  } else {
106  memset(addr->bytes, 0, 6);
107  return 0;
108  }
109 }
110 
118 INLINE int mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2)
119 {
120  return memcmp(addr1->bytes, addr2->bytes, 6);
121 }
122 
129 INLINE void mac_to_str(const mac_addr_t *addr, char *str)
130 {
131  if (str != NULL) {
132  snprintf(str, MAC_STR_LEN, MAC_ADD_FORMAT_PRI,
133  addr->bytes[0], addr->bytes[1], addr->bytes[2],
134  addr->bytes[3], addr->bytes[4], addr->bytes[5]);
135  }
136 }
137 
144 INLINE void mac_to_bytes(const mac_addr_t *addr, uint8_t *array)
145 {
146  memcpy(array, (void *) addr->bytes, 6);
147 }
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif
+
#define MAC_ADD_FORMAT_SCN
Definition: macaddr.h:67
+
INLINE void mac_to_str(const mac_addr_t *addr, char *str)
Definition: macaddr.h:129
+
mac_addr_t
Definition: macaddr.h:75
+
INLINE void mac_to_bytes(const mac_addr_t *addr, uint8_t *array)
Definition: macaddr.h:144
+
#define MAC_ADD_FORMAT_PRI
Definition: macaddr.h:68
+
INLINE mac_addr_t mac_from_bytes(uint8_t *array)
Definition: macaddr.h:83
+
INLINE int mac_from_str(const char *str, mac_addr_t *addr)
Definition: macaddr.h:99
+
#define INLINE
Definition: inline.h:12
+
memcpy(buffer, rec, ur_rec_size(tmplt, rec))
+
#define MAC_STR_LEN
Definition: macaddr.h:57
+
struct __attribute__((packed)) mac_addr_s
Definition: macaddr.h:73
+
INLINE int mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2)
Definition: macaddr.h:118
+
+ + + + diff --git a/doc/unirec/md_README-ip_prefix_search.html b/doc/unirec/md_README-ip_prefix_search.html new file mode 100644 index 00000000..f9bf6969 --- /dev/null +++ b/doc/unirec/md_README-ip_prefix_search.html @@ -0,0 +1,101 @@ + + + + + + + +UniRec: IP prefix binary search + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
IP prefix binary search
+
+
+

This structure is an ordered array data structure that is used to store a dynamic set, where the keys are low and high IP addresses of prefix. Binary search compares low and high IP with the searched IP address and returns data associated with match prefix.

+

The prefix array can be used for storing any data (string, int). For example, it can be used to aggregate information from multiple blacklists. Data type is specific to each user and their source format (source file, delimiters, data format or data length,...), so user MUST define function load_networks(), which load and parse information, and data about networks from any of their source and fill 'ipps_network_list' structure.

+

Before using the search, call the ipps_init() function. The function creates all necessary structures for storing and accessing the data and return structure of IPv4 and IPv6 array of prefixes with data (network context).

+

The parameters are:

    +
  • Structure with networks array and networks counter
  • +
+

For searching, use the function ipps_search(). Function returns number of data associated with match prefix and return pointer to data as parameter:

+
    +
  • Structure of ip prefix context, ipps_context_t
  • +
  • IP address union
  • +
  • Void pointer to data array
  • +
+

For example, if blacklist contains:

+
192.168.1.0/24 aaa
192.168.1.0/25 bbb
192.168.1.128/25 ccc
{init()```}
* From 1.0 to 1.127 with data "aaa" and "bbb"
* From 1.128 to 1.255 with data "aaa" and "ccc":

192.168.1.0 192.168.1.255 ↓ ↓ <--—aaa-—> <-bbb-><-ccc->

and ```ip_prefix_search()``` is called with 192.168.1.100, search return number 2 and pointer to data "aaa" and "bbb".
For 192.168.1.200, return also number 2 but data are "aaa" and "ccc". For 192.1.1.1, search return 0 and pointer
to data is not fill.
For destruction of a whole structure and data there is ```ipps_destroy()``` function, parameter is pointer to
the ```ipps_context_t structure```, that has to be destroyed. Also, a list of networks is necessary to destroy with
function ```destroy_networks()``` (this function isn't a part of library and the user must define it).
Recommended control flow is:
1. ```load_networks(
    +
  1. ipps_init()
  2. +
  3. destroy_networks()
  4. +
  5. ipps_search()
  6. +
  7. ipps_destroy()
  8. +
+
+

Example file

+

``` /**

    +
  • +
+
+ + + + diff --git a/doc/unirec/md_README.html b/doc/unirec/md_README.html new file mode 100644 index 00000000..685e13da --- /dev/null +++ b/doc/unirec/md_README.html @@ -0,0 +1,307 @@ + + + + + + + +UniRec: UniRec + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
UniRec
+
+
+

Overview

+

UniRec is a data format for storage and transfer of simple unstructured records, i.e. sets of key-value pairs with a fixed set of keys. A record in UniRec format is similar to a C structure but it can be defined at run-time. It thus brings possibility to dynamically create structures in a statically typed language.

+

The main advantage of UniRec is extremely fast access to fields of a record. No parsing is needed, the fields are accessed directly from the record, almost as in a plain C struct.

+

In comparison with access to a struct member, just one additional memory access is needed in order to find position of the field in the record. This access is to a small table which easily fits into a CPU cache.

+

To create an UniRec record, a user first needs to specify a set of fields and their types - a template. Then a memory for the record is allocated and field values can be set using simple macros.

+

NOTE: The following text describes UniRec as used in the C or C++ language.

+

Simplified example:

+
// Create a template with three fields (their types must be defined earlier)
ur_template_t *tmplt = ur_create_template("FIELD1,FIELD2,FIELD3", NULL);
// Create a record with that template
void *record = ur_create_record(tmplt, 0);
// Set values of fields
ur_set(tmplt, record, F_FIELD1, 1);
ur_set(tmplt, record, F_FIELD2, 234);
ur_set(tmplt, record, F_FIELD3, 56);
// Read values of the record and print them to standard output
printf("%i %i %i\n",
ur_get(tmplt, record, F_FIELD1),
ur_get(tmplt, record, F_FIELD2),
ur_get(tmplt, record, F_FIELD3),
);

The example states that the types of the fields must be defined before a template can be created. If names and types of the fields are known at compile-time, they can be defined at the beginning of a *.c file as in the following example:

// Specify which fields will be used in the code and what are their types
UR_FIELDS(
int32 FIELD1,
int32 FIELD2,
int32 FIELD3,
)

If the set of fields and their types is not known in advance, they may also be defined at run-time. However, access to such fields is then a little more complicated due to limitations of statically types languages (if a compiler doesn't know the type of a field, it can't create a set of instructions to read from or write into it).

+

UniRec data types

+

An UniRec field may have one of the following types:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name size description
int8 1 8bit singed integer
int16 2 16bit singed integer
int32 4 32bit singed integer
int64 8 64bit singed integer
uint8 1 8bit unsigned integer
uint16 2 16bit unsigned integer
uint32 4 32bit unsigned integer
uint64 8 64bit unsigned integer
char 1 A single ASCII character
float 4 Single precision floating point number (IEEE 754)
double 8 Double precision floating point number (IEEE 754)
ipaddr 16 Special type for IPv4/IPv6 addresses, see below for details
macaddr 6 Special type for MAC address, see below for details
time 8 Special type for precise timestamps, see below for details
string - Variable-length array of (mostly) printable characters
bytes - Variable-length array of bytes (not expected to be printable characters)
+

Types "string" and "bytes" are the same from a machine point of view (both are of type char[] in C), the only difference is their semantics. When printing as text, "string" is usually printed directly as ASCII or UTF-8 string, "bytes" is rather interpreted as binary data and printed in hex.

+

A terminating null character ('\0') SHOULD NOT be included at the end of "string" values since this is specific for the C language and data in UniRec should be independent of a programming language.

+

ipaddr type

+

Structure to store both IPv4 and IPv6 addresses and associated functions.

+

macaddr type

+

Structure to store MAC address and associated functions.

+

time type

+

Structure to store timestamps and associated types, macros and function.

+

Field names

+

Name of field may be any string matching the regular expression [A-Za-z][A-Za-z0-9_]* with the following limitations:

    +
  • It SHOULD NOT end with "_T" as this is reserved in C implementation for symbolic constants storing the type of a field.
  • +
+

It is RECOMMENDED that all field names are uppercase.

+

Physical record layout

+

An UniRec record consists of field values put one after another in a specific order. There is no header. Information about the template and the size of the record must be provided by other means.

+

The layout of a record is given only by its template (specifying a set of fields and their types) and the following rules.

+

A record is divided into three sections:

    +
  1. Values of all fixed-length fields
  2. +
  3. Meta-information about variable-length fields
  4. +
  5. Data of variable-length fields
  6. +
+

Fixed-length fields in the first section are sorted by their size from largest to smallest. Fields with the same size are sorted alphabetically by their name.

+

The second section contains two 16bit numbers for each variable-length field - offset of the beginning of the field's data and length of the data (in bytes). The offset is counted from the beginning of the record.

+

The meta-information fields are sorted alphabetically by the field names.

+

The third section contains data of variable-length fields in an arbitrary order. The data of variable-length fields SHOULD be placed immediately one after another. There SHOULD be NO "empty spaces" between them and data of the fields SHOULD NOT overlap.

+

The first two sections are called the "fixed-length part" of a record, since their total size is always the same and all data are present on fixed offsets (for a given template). The last section is called "variable-length part" because its total length as well as position of individual fields may be different in each record.

+

Example

+

The following picture shows layout of a record containing information about a HTTP connection. The template of this record contains the following fields: ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT, uint8 PROTOCOL, uint8 TCP_FLAGS, uint32 PACKETS, uint32 BYTES, uint16 HTTP_RSP_CODE, string HTTP_URL, string HTTP_USER_AGENT

+
byte 0 1 2 3
+-------+-------+-------+-------+
0 | |
4 | DST_IP |
8 | |
12 | |
+-------+-------+-------+-------+
16 | |
20 | SRC_IP |
24 | |
28 | |
+-------+-------+-------+-------+
32 | BYTES |
+-------+-------+-------+-------+
36 | PACKETS |
+-------+-------+-------+-------+
40 | DST_PORT | HTTP_RSP_CODE |
+-------+-------+-------+-------+
44 | SRC_PORT | PROTO | TCP_F |
+-------+-------+-------+-------+
48 | HTTP_URL(off) | HTTP_URL(len) |
+-------+-------+-------+-------+
52 | HTTP_USER(off)| HTTP_USER(len)| fixed-length
+-------+-------+-------+-------+ -----------------
56 | HTTP_URL (data) | variable-length part
+ +-------+
60 | | |
+-------+-------+-------+ +
64 | HTTP_USER_AGENT (data) |
+ +-------+-------+
68 | |
+-------+-------+

Endianness

+

All values, except IP and MAC addresses, are in little endian. IP and MAC addresses are treated rather as sequences of bytes than numbers, so they are left in network order, i.e. big-endian (however, they are encapsulated in a special data type and shouldn't be accessed directly so the internal format should be needed to know).

+

Maximal record length

+

Maximal length of the record is limited to 65534 (2^16 - 2) bytes.

+

Template definition

+

Templates are usually defined by a string enumerating all the fields in the template, using comma (',') as a separator of field names. Order of field names in such string is not important (since physical order of fields is given by the rules above).

+

C library interface

+

Types and structures

+

Types, enums and structures defined in unirec.h.

enum ur_field_type {
UR_TYPE_INT8,
UR_TYPE_INT16,
UR_TYPE_INT32,
UR_TYPE_INT64,
UR_TYPE_UINT8,
UR_TYPE_UINT16,
UR_TYPE_UINT32,
UR_TYPE_UINT64,
UR_TYPE_CHAR,
UR_TYPE_FLOAT,
UR_TYPE_DOUBLE,
UR_TYPE_IP,
UR_TYPE_MAC,
UR_TYPE_TIME,
UR_TYPE_STRING,
UR_TYPE_BYTES,
};

An enum value for each of the UniRec types.

+

ur_field_id_t

+

Unsigned integer type for holding field IDs. IMPLEMENTATION NOTE: ur_field_id_t = uint16_t

+

ur_template_t

+

A structure defining an UniRec template. It contains information about which fields are present in a record with that template and how to access them. For user this is a black box, it is not needed to access the structure's members directly.

+

ur_iter_t

+

Iterator type used by ur_iter_fields function

+

UR_ITER_BEGIN

+

UR_ITER_END

+

Constants used for iteration over fields in a template, see ur_iter_fields function for details.

+

UR_MAX_SIZE = 65535

+

Maximal size of an UniRec record.

+

Public functions and macros

+

### Definition of statically-known UniRec fields.

UR_FIELDS(type name [, type name [, ...] ])

This macro allows to define fields used in the program and their types at compile-time. This allows to access such fields in UniRec records more easily and efficiently.

+

This macro should be used in the beginning of each translation unit (i.e. a *.c file) if the fields used (or at least some of them) are known at compile-time.

+

Parameters:

    +
  • "name" may be any string matching the following regular expression: [A-Za-z][A-Za-z0-9_]* with the following exceptions:
      +
    • It must not be the same as a keyword in C/C++ or another identifier used in the source codes. To avoid collisions with other identifiers in the UniRec library, do not use identifiers beginning with "UR\_" or "ur\_"
    • +
    • It must not end with _T (as this is reserved for constants specifying types)
    • +
    • It is RECOMMENDED that all field names are upper case.
    • +
    +
  • +
  • "type" is one of the types specified in "format specification - data types".
  • +
+

There MAY be a comma after the last field name. Also, there MAY be a semicolon after the closing parenthesis at the end of the macro.

+

#### Example:

UR_FIELDS(
ipaddr SRC_IP,
ipaddr DST_IP,
uint16 SRC_PORT,
uint16 DST_PORT,
uint8 PROTO,
)

This macro generates code allowing to use the defined fields in ur_get, ur_set and other macros which need symbolic constants to access the fields.

+

For each field specified by this macro, a CPP macro is defined with F_ prefix in the name and a value of a unique numeric ID. Also, a constant F_name_T is defined with a value of the field's type (as defined in ur_field_type enum). Other internal variables and structures are defined.

+

If there are more than one translation unit accessing UniRec fields, the same set of fields MUST be defined using UR_FIELDS in each of them.

+

### Cleanup of all internal structures.

int ur_finalize()

This function has to be called after all UniRec functions and macros invocations if there were some fields defined at run-time. Otherwise this function does not have any effect, because nothing has been allocated. The function is called typically during a cleanup phase before the program's end.

+

No UniRec function or macro can be called after a call to ur_finalize.

+

### Run-time definition of a field

int ur_define_field(const char *name, ur_field_type type)

This function allows to define a field at run-time.

+

Parameters: "name" - name of the new field, see description of UR_FIELDS for rules on field names. "type" - type of the new field.

+

If a field with the same name already exists in the internal table of defined fields and "type" is the same as the one in the table, the function just returns the ID of the field. If types does not match, a UR_E_TYPE_MISMATCH error code is returned.

+

If no field with "name" is present in the table of fields, a new entry is created with a new unique ID and the given name and type of the field. The new ID is returned.

+

Returns:

    +
  • ID of a field with the given name if no error occurs.
  • +
  • UR_E_TYPE_MISMATCH if a field with the given name is already defined with a different type.
  • +
  • UR_E_INVALID_NAME if the name is not a valid field name.
  • +
  • UR_E_INVALID_TYPE if the type is not one of the values of enum ur_field_type.
  • +
  • UR_E_MEMORY if memory allocation error occurred.
  • +
+

All error codes returned by this function are negative integers, ID is always non-negative.

+

If this function is used in a program, the function ur_finalize() has to be called after all UniRec functions and macros invocations.

+

NOTE: It is not necessary to define fields which were defined by UR_FIELDS. It is recommended to define all fields statically by UR_FIELDS if possible. This function is present only for cases when field names and/or types are not known until run-time.

+

NOTE: Fields defined by this function can be accessed using their numeric IDs only. Symbolic CPP macros are not defined, of course.

+

Run-time definition of a set of fields

+
int ur_define_set_of_fields(const char *ifc_data_fmt);

This function allows to define sef of fields at run-time.

+

Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned.

+

Parameters: "fc_data_fmt" - String containing types and names of fields delimited by comma. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2"

+

Returns:

    +
  • UR_OK on success
  • +
  • UR_E_MEMORY if there is an allocation problem.
  • +
  • UR_E_INVALID_NAME if the name value is empty.
  • +
  • UR_E_INVALID_TYPE if the type does not exist.
  • +
  • UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
  • +
+

### Undefine field

int ur_undefine_field(const char *name)
int ur_undefine_field_by_id(ur_field_id_t id)

Allows to revert a previous definition of a field by ur_define_field.

+

Frees the ID of the given field for future re-use. The ID becomes invalid after a call to this function so the field with the given name can not be accessed any more. Note that the same ID may be assigned to another field later.

+

This function is not necessary in most cases. Its only purpose is to allow a re-use of field IDs since their total count is limited to 2^16-1.

+

After this function is used, all the templates using the undefined field have to freed and created again.

+

### Create UniRec template

ur_template_t *ur_create_template(const char* fields, char **errstr)

Creates a structure describing an UniRec template with the given set of fields and returns a pointer to it.

+

The template should be freed by ur_free_template after is not needed any more.

+

Parameters:

    +
  • "fields" - A string containing names of fields separated by commas, e.g.: "FOO,BAR,BAZ"
  • +
  • "errstr" - (output) In case of an error a pointer to the error message is returned using this parameter, if not set to NULL.
  • +
+

Order of field names is not important, i.e. any two strings with the same set of field names but with different order are equivalent.

+

All fields MUST be previously defined, either statically by UR_FIELDS or by calls to ur_define_field.

+

If an error occurs and "errstr" is not NULL, it is set to a string with corresponding error message.

+

Returns:

    +
  • Pointer to the newly created template or NULL if an error has occurred.
  • +
+

### Create UniRec template for usage with Libtrap

ur_template_t *ur_create_input_template(int ifc, const char* fields, char **errstr)

Creates UniRec template and set this template to specified input interface (ifc).

+

This template will be set as a minimum set of fields to be able to receive messages. If the input interface receives superset of fields, the template will be expanded.

+
ur_template_t *ur_create_output_template(int ifc, const char* fields, char **errstr)

Creates UniRec template and set this template to specified output interface (ifc).

+

Set of fields of this template will be set to an output interface.

+
ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char* fields, char **errstr)

Creates UniRec template and set this template to specified input (ifc_in) and output (ifc_out) interface.

+

This template will be set as a minimum set of fields to be able to receive messages. If the input interface receives superset of fields, the template will be expanded and new set of fields will be set to output interface.

+

### Free UniRec template

void *ur_free_template(ur_template_t *tmplt)

Free memory allocated for a template.

+

Retrieve value from UniRec record.

+

Following functions are used to retrieve certain field value from UniRec record.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template
  • +
  • "rec" - Pointer to UniRec record, which is created using given template.
  • +
  • "field" - Identifier of a field.
  • +
+
ur_get(tmplt, rec, field)

This function returns value of an appropriate type of a specific field (int, uint, ...). Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used just for fixed size fields (not for string and bytes).

+
ur_get_ptr(tmplt, rec, field)

This function returns pointer to a value of an appropriate type. Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used for both fixed-length and variable-length fields.

+
ur_get_ptr_by_id(tmplt, rec, field)

This function returns void pointer to a value. Field can be symbolic constant or numerical ID. It can be used for both fixed-length and variable-length fields. (This function is used for fields defined at run-time)

+
char* ur_get_var_as_str(tmplt, rec, field);

Function copies data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()! Field can be symbolic constant or numerical ID.

+

Set value to UniRec record.

+

Following functions are used to set a value to specified field in a record.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template
  • +
  • "rec" - Pointer to UniRec record, which is created using given template.
  • +
  • "field" - Identifier of a field.
  • +
  • "value" - Value which is copied to the record.
  • +
+
ur_set(tmplt, rec, field, value) // field must be a symbolic constant ...

This function assumes value of an appropriate type of a specific field (int, uint, ...). Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used just for fixed size fields (not for string and bytes).

+

To set dynamically defined field, use ur_get_ptr_by_id() and write to that pointer.

+
ur_set_var(tmplt, rec, field, val_ptr, val_len)

This function is used to set variable-length fields. Field can be symbolic constant or numerical ID. For better performance use function ur_clear_varlen, before setting all variable fields in record.

+

Parameters:

    +
  • "val_ptr" - Pointer to value.
  • +
  • "val_len" - Length of a value. (length which will be copied)
  • +
+
ur_clear_varlen(tmplt, rec);

This function will clear all variable-length fields. It can be used for better performance of setting content to variable-length fields. Use this function before setting of all the variable-length fields.

ur_set_string(tmplt, rec, field, str) //

Set string to the UniRec record. Value is a C-style string, length is determined automatically by strlen() ('\0' is not included in the record)

+
    +
  • "str" - Pointer to a string.
  • +
+

### Size of a fixed-length, static field

ur_get_size(field) // field must be a symbolic constant ...; for static fields only

Returns size of a field. Field has to be statically defined. For variable-length fields it returns -1. To get size of variable-length field use function ur_get_var_len().

+

### Size of variable-length field

ur_get_var_len(tmplt, rec, field)

Returns length of a variable-length field. Field can be symbolic constant or numerical ID.

+

### Size of a fixed-length part of a record

ur_rec_fixlen_size(tmplt)

Returns size of a fixed-length part of a record.

+

### Size of a variable-length part of a record

ur_rec_varlen_size(tmplt, rec)

Returns size of a variable-length part of a record.

+

### Size of a record

ur_rec_size(tmplt, rec)

Returns total size of whole UniRec record.

+

### Check template's fields

ur_is_present(tmplt, field)

Returns non-zero if field is present, zero otherwise.

+

### Check type of a field (variable-length or fixed-length)

ur_is_varlen(field)
ur_is_fixlen(field)

Returns non-zero if field is dynamic, zero otherwise.

+

### ID of a field (dynamic or static)

ur_field_id_t ur_get_id_by_name(const char *name);

Function returns id of a field by name of the field, or UR_E_INVALID_NAME if the name is not known.

+

### Create UniRec record

void* ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size);

Allocates memory for a record with given template. It allocates N+M bytes, where N is the size of fixed-length part of the record (inferred from template), and M is the size of variable-length, which must be provided by caller.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template.
  • +
  • "max_var_size" - Size of variable-length part, i.e. sum of lengths of all variable- length fields. If it is not known at the time of record creation, use UR_MAX_SIZE, which allocates enough memory to hold the largest possible UniRec record (65535 bytes). Set to 0 if there are no variable-length fields in the template
  • +
+

### Free UniRec record

void ur_free_record(void *record);

Free memory allocated for UniRec record. You can call system free() on the record as well.

+

### Clone record

ur_clone_record(tmplt, src)

Function creates new UniRec record and fills it with the data given by parameter. It returns Pointer to a new UniRec record.

+

Parameters:

    +
  • "tmplt" Pointer to UniRec template
  • +
  • "src" Pointer to source record
  • +
+

### Copy fields

void ur_copy_fields(dst_tmplt, dst, src_tmplt, src);

Copies all fields present in both templates from src to dst.

+

The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src.

+

Parameters:

    +
  • "dst_tmplt" - Pointer to destination UniRec template.
  • +
  • "dst" - Pointer to destination record. It must point to a memory of enough size.
  • +
  • "src_tmplt" - Pointer to source UniRec template.
  • +
  • "src" - Pointer to source record.
  • +
+

### Iterate over fields of a template

ur_iter_fields(tmplt, id);

This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned.The order of fields is given by the order in which they are defined.

+

The order of fields is given by the order in which they are defined.

+

Parameters:

    +
  • "tmplt" - Pointer to a template to iterate over.
  • +
  • "id" - Field ID returned in last iteration or UR_ITER_BEGIN to get first value.
  • +
+

Returns ID of the next field or UR_ITER_END if no more fields are present.

+

Example usage:

ur_field_id_t id = UR_ITER_BEGIN;
while ((id = ur_iter_fields(tmplt, id)) != UR_ITER_END) {
...
}
ur_iter_fields_record_order(tmplt, id);

This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template.

+

The order of fields is given by the order in the record Parameters:

    +
  • "tmplt" Template to iterate over.
  • +
  • "id" Field ID returned in last iteration or UR_ITER_BEGIN to get first value. Returns ID of the next field or UR_ITER_END if no more fields are present.
  • +
+

Example usage:

int i = 0;
while ((id = ur_iter_fields_record_order(tmplt, i++)) != UR_ITER_END) {
...
}
+ + + + diff --git a/doc/unirec/md_doc_intro.html b/doc/unirec/md_doc_intro.html new file mode 100644 index 00000000..685e13da --- /dev/null +++ b/doc/unirec/md_doc_intro.html @@ -0,0 +1,307 @@ + + + + + + + +UniRec: UniRec + + + + + + + + + +
+
+ + + + + + +
+
UniRec +  2.9.3 +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+
+
UniRec
+
+
+

Overview

+

UniRec is a data format for storage and transfer of simple unstructured records, i.e. sets of key-value pairs with a fixed set of keys. A record in UniRec format is similar to a C structure but it can be defined at run-time. It thus brings possibility to dynamically create structures in a statically typed language.

+

The main advantage of UniRec is extremely fast access to fields of a record. No parsing is needed, the fields are accessed directly from the record, almost as in a plain C struct.

+

In comparison with access to a struct member, just one additional memory access is needed in order to find position of the field in the record. This access is to a small table which easily fits into a CPU cache.

+

To create an UniRec record, a user first needs to specify a set of fields and their types - a template. Then a memory for the record is allocated and field values can be set using simple macros.

+

NOTE: The following text describes UniRec as used in the C or C++ language.

+

Simplified example:

+
// Create a template with three fields (their types must be defined earlier)
ur_template_t *tmplt = ur_create_template("FIELD1,FIELD2,FIELD3", NULL);
// Create a record with that template
void *record = ur_create_record(tmplt, 0);
// Set values of fields
ur_set(tmplt, record, F_FIELD1, 1);
ur_set(tmplt, record, F_FIELD2, 234);
ur_set(tmplt, record, F_FIELD3, 56);
// Read values of the record and print them to standard output
printf("%i %i %i\n",
ur_get(tmplt, record, F_FIELD1),
ur_get(tmplt, record, F_FIELD2),
ur_get(tmplt, record, F_FIELD3),
);

The example states that the types of the fields must be defined before a template can be created. If names and types of the fields are known at compile-time, they can be defined at the beginning of a *.c file as in the following example:

// Specify which fields will be used in the code and what are their types
UR_FIELDS(
int32 FIELD1,
int32 FIELD2,
int32 FIELD3,
)

If the set of fields and their types is not known in advance, they may also be defined at run-time. However, access to such fields is then a little more complicated due to limitations of statically types languages (if a compiler doesn't know the type of a field, it can't create a set of instructions to read from or write into it).

+

UniRec data types

+

An UniRec field may have one of the following types:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name size description
int8 1 8bit singed integer
int16 2 16bit singed integer
int32 4 32bit singed integer
int64 8 64bit singed integer
uint8 1 8bit unsigned integer
uint16 2 16bit unsigned integer
uint32 4 32bit unsigned integer
uint64 8 64bit unsigned integer
char 1 A single ASCII character
float 4 Single precision floating point number (IEEE 754)
double 8 Double precision floating point number (IEEE 754)
ipaddr 16 Special type for IPv4/IPv6 addresses, see below for details
macaddr 6 Special type for MAC address, see below for details
time 8 Special type for precise timestamps, see below for details
string - Variable-length array of (mostly) printable characters
bytes - Variable-length array of bytes (not expected to be printable characters)
+

Types "string" and "bytes" are the same from a machine point of view (both are of type char[] in C), the only difference is their semantics. When printing as text, "string" is usually printed directly as ASCII or UTF-8 string, "bytes" is rather interpreted as binary data and printed in hex.

+

A terminating null character ('\0') SHOULD NOT be included at the end of "string" values since this is specific for the C language and data in UniRec should be independent of a programming language.

+

ipaddr type

+

Structure to store both IPv4 and IPv6 addresses and associated functions.

+

macaddr type

+

Structure to store MAC address and associated functions.

+

time type

+

Structure to store timestamps and associated types, macros and function.

+

Field names

+

Name of field may be any string matching the regular expression [A-Za-z][A-Za-z0-9_]* with the following limitations:

    +
  • It SHOULD NOT end with "_T" as this is reserved in C implementation for symbolic constants storing the type of a field.
  • +
+

It is RECOMMENDED that all field names are uppercase.

+

Physical record layout

+

An UniRec record consists of field values put one after another in a specific order. There is no header. Information about the template and the size of the record must be provided by other means.

+

The layout of a record is given only by its template (specifying a set of fields and their types) and the following rules.

+

A record is divided into three sections:

    +
  1. Values of all fixed-length fields
  2. +
  3. Meta-information about variable-length fields
  4. +
  5. Data of variable-length fields
  6. +
+

Fixed-length fields in the first section are sorted by their size from largest to smallest. Fields with the same size are sorted alphabetically by their name.

+

The second section contains two 16bit numbers for each variable-length field - offset of the beginning of the field's data and length of the data (in bytes). The offset is counted from the beginning of the record.

+

The meta-information fields are sorted alphabetically by the field names.

+

The third section contains data of variable-length fields in an arbitrary order. The data of variable-length fields SHOULD be placed immediately one after another. There SHOULD be NO "empty spaces" between them and data of the fields SHOULD NOT overlap.

+

The first two sections are called the "fixed-length part" of a record, since their total size is always the same and all data are present on fixed offsets (for a given template). The last section is called "variable-length part" because its total length as well as position of individual fields may be different in each record.

+

Example

+

The following picture shows layout of a record containing information about a HTTP connection. The template of this record contains the following fields: ipaddr SRC_IP, ipaddr DST_IP, uint16 SRC_PORT, uint16 DST_PORT, uint8 PROTOCOL, uint8 TCP_FLAGS, uint32 PACKETS, uint32 BYTES, uint16 HTTP_RSP_CODE, string HTTP_URL, string HTTP_USER_AGENT

+
byte 0 1 2 3
+-------+-------+-------+-------+
0 | |
4 | DST_IP |
8 | |
12 | |
+-------+-------+-------+-------+
16 | |
20 | SRC_IP |
24 | |
28 | |
+-------+-------+-------+-------+
32 | BYTES |
+-------+-------+-------+-------+
36 | PACKETS |
+-------+-------+-------+-------+
40 | DST_PORT | HTTP_RSP_CODE |
+-------+-------+-------+-------+
44 | SRC_PORT | PROTO | TCP_F |
+-------+-------+-------+-------+
48 | HTTP_URL(off) | HTTP_URL(len) |
+-------+-------+-------+-------+
52 | HTTP_USER(off)| HTTP_USER(len)| fixed-length
+-------+-------+-------+-------+ -----------------
56 | HTTP_URL (data) | variable-length part
+ +-------+
60 | | |
+-------+-------+-------+ +
64 | HTTP_USER_AGENT (data) |
+ +-------+-------+
68 | |
+-------+-------+

Endianness

+

All values, except IP and MAC addresses, are in little endian. IP and MAC addresses are treated rather as sequences of bytes than numbers, so they are left in network order, i.e. big-endian (however, they are encapsulated in a special data type and shouldn't be accessed directly so the internal format should be needed to know).

+

Maximal record length

+

Maximal length of the record is limited to 65534 (2^16 - 2) bytes.

+

Template definition

+

Templates are usually defined by a string enumerating all the fields in the template, using comma (',') as a separator of field names. Order of field names in such string is not important (since physical order of fields is given by the rules above).

+

C library interface

+

Types and structures

+

Types, enums and structures defined in unirec.h.

enum ur_field_type {
UR_TYPE_INT8,
UR_TYPE_INT16,
UR_TYPE_INT32,
UR_TYPE_INT64,
UR_TYPE_UINT8,
UR_TYPE_UINT16,
UR_TYPE_UINT32,
UR_TYPE_UINT64,
UR_TYPE_CHAR,
UR_TYPE_FLOAT,
UR_TYPE_DOUBLE,
UR_TYPE_IP,
UR_TYPE_MAC,
UR_TYPE_TIME,
UR_TYPE_STRING,
UR_TYPE_BYTES,
};

An enum value for each of the UniRec types.

+

ur_field_id_t

+

Unsigned integer type for holding field IDs. IMPLEMENTATION NOTE: ur_field_id_t = uint16_t

+

ur_template_t

+

A structure defining an UniRec template. It contains information about which fields are present in a record with that template and how to access them. For user this is a black box, it is not needed to access the structure's members directly.

+

ur_iter_t

+

Iterator type used by ur_iter_fields function

+

UR_ITER_BEGIN

+

UR_ITER_END

+

Constants used for iteration over fields in a template, see ur_iter_fields function for details.

+

UR_MAX_SIZE = 65535

+

Maximal size of an UniRec record.

+

Public functions and macros

+

### Definition of statically-known UniRec fields.

UR_FIELDS(type name [, type name [, ...] ])

This macro allows to define fields used in the program and their types at compile-time. This allows to access such fields in UniRec records more easily and efficiently.

+

This macro should be used in the beginning of each translation unit (i.e. a *.c file) if the fields used (or at least some of them) are known at compile-time.

+

Parameters:

    +
  • "name" may be any string matching the following regular expression: [A-Za-z][A-Za-z0-9_]* with the following exceptions:
      +
    • It must not be the same as a keyword in C/C++ or another identifier used in the source codes. To avoid collisions with other identifiers in the UniRec library, do not use identifiers beginning with "UR\_" or "ur\_"
    • +
    • It must not end with _T (as this is reserved for constants specifying types)
    • +
    • It is RECOMMENDED that all field names are upper case.
    • +
    +
  • +
  • "type" is one of the types specified in "format specification - data types".
  • +
+

There MAY be a comma after the last field name. Also, there MAY be a semicolon after the closing parenthesis at the end of the macro.

+

#### Example:

UR_FIELDS(
ipaddr SRC_IP,
ipaddr DST_IP,
uint16 SRC_PORT,
uint16 DST_PORT,
uint8 PROTO,
)

This macro generates code allowing to use the defined fields in ur_get, ur_set and other macros which need symbolic constants to access the fields.

+

For each field specified by this macro, a CPP macro is defined with F_ prefix in the name and a value of a unique numeric ID. Also, a constant F_name_T is defined with a value of the field's type (as defined in ur_field_type enum). Other internal variables and structures are defined.

+

If there are more than one translation unit accessing UniRec fields, the same set of fields MUST be defined using UR_FIELDS in each of them.

+

### Cleanup of all internal structures.

int ur_finalize()

This function has to be called after all UniRec functions and macros invocations if there were some fields defined at run-time. Otherwise this function does not have any effect, because nothing has been allocated. The function is called typically during a cleanup phase before the program's end.

+

No UniRec function or macro can be called after a call to ur_finalize.

+

### Run-time definition of a field

int ur_define_field(const char *name, ur_field_type type)

This function allows to define a field at run-time.

+

Parameters: "name" - name of the new field, see description of UR_FIELDS for rules on field names. "type" - type of the new field.

+

If a field with the same name already exists in the internal table of defined fields and "type" is the same as the one in the table, the function just returns the ID of the field. If types does not match, a UR_E_TYPE_MISMATCH error code is returned.

+

If no field with "name" is present in the table of fields, a new entry is created with a new unique ID and the given name and type of the field. The new ID is returned.

+

Returns:

    +
  • ID of a field with the given name if no error occurs.
  • +
  • UR_E_TYPE_MISMATCH if a field with the given name is already defined with a different type.
  • +
  • UR_E_INVALID_NAME if the name is not a valid field name.
  • +
  • UR_E_INVALID_TYPE if the type is not one of the values of enum ur_field_type.
  • +
  • UR_E_MEMORY if memory allocation error occurred.
  • +
+

All error codes returned by this function are negative integers, ID is always non-negative.

+

If this function is used in a program, the function ur_finalize() has to be called after all UniRec functions and macros invocations.

+

NOTE: It is not necessary to define fields which were defined by UR_FIELDS. It is recommended to define all fields statically by UR_FIELDS if possible. This function is present only for cases when field names and/or types are not known until run-time.

+

NOTE: Fields defined by this function can be accessed using their numeric IDs only. Symbolic CPP macros are not defined, of course.

+

Run-time definition of a set of fields

+
int ur_define_set_of_fields(const char *ifc_data_fmt);

This function allows to define sef of fields at run-time.

+

Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned.

+

Parameters: "fc_data_fmt" - String containing types and names of fields delimited by comma. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2"

+

Returns:

    +
  • UR_OK on success
  • +
  • UR_E_MEMORY if there is an allocation problem.
  • +
  • UR_E_INVALID_NAME if the name value is empty.
  • +
  • UR_E_INVALID_TYPE if the type does not exist.
  • +
  • UR_E_TYPE_MISMATCH if the name already exists, but the type is different.
  • +
+

### Undefine field

int ur_undefine_field(const char *name)
int ur_undefine_field_by_id(ur_field_id_t id)

Allows to revert a previous definition of a field by ur_define_field.

+

Frees the ID of the given field for future re-use. The ID becomes invalid after a call to this function so the field with the given name can not be accessed any more. Note that the same ID may be assigned to another field later.

+

This function is not necessary in most cases. Its only purpose is to allow a re-use of field IDs since their total count is limited to 2^16-1.

+

After this function is used, all the templates using the undefined field have to freed and created again.

+

### Create UniRec template

ur_template_t *ur_create_template(const char* fields, char **errstr)

Creates a structure describing an UniRec template with the given set of fields and returns a pointer to it.

+

The template should be freed by ur_free_template after is not needed any more.

+

Parameters:

    +
  • "fields" - A string containing names of fields separated by commas, e.g.: "FOO,BAR,BAZ"
  • +
  • "errstr" - (output) In case of an error a pointer to the error message is returned using this parameter, if not set to NULL.
  • +
+

Order of field names is not important, i.e. any two strings with the same set of field names but with different order are equivalent.

+

All fields MUST be previously defined, either statically by UR_FIELDS or by calls to ur_define_field.

+

If an error occurs and "errstr" is not NULL, it is set to a string with corresponding error message.

+

Returns:

    +
  • Pointer to the newly created template or NULL if an error has occurred.
  • +
+

### Create UniRec template for usage with Libtrap

ur_template_t *ur_create_input_template(int ifc, const char* fields, char **errstr)

Creates UniRec template and set this template to specified input interface (ifc).

+

This template will be set as a minimum set of fields to be able to receive messages. If the input interface receives superset of fields, the template will be expanded.

+
ur_template_t *ur_create_output_template(int ifc, const char* fields, char **errstr)

Creates UniRec template and set this template to specified output interface (ifc).

+

Set of fields of this template will be set to an output interface.

+
ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char* fields, char **errstr)

Creates UniRec template and set this template to specified input (ifc_in) and output (ifc_out) interface.

+

This template will be set as a minimum set of fields to be able to receive messages. If the input interface receives superset of fields, the template will be expanded and new set of fields will be set to output interface.

+

### Free UniRec template

void *ur_free_template(ur_template_t *tmplt)

Free memory allocated for a template.

+

Retrieve value from UniRec record.

+

Following functions are used to retrieve certain field value from UniRec record.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template
  • +
  • "rec" - Pointer to UniRec record, which is created using given template.
  • +
  • "field" - Identifier of a field.
  • +
+
ur_get(tmplt, rec, field)

This function returns value of an appropriate type of a specific field (int, uint, ...). Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used just for fixed size fields (not for string and bytes).

+
ur_get_ptr(tmplt, rec, field)

This function returns pointer to a value of an appropriate type. Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used for both fixed-length and variable-length fields.

+
ur_get_ptr_by_id(tmplt, rec, field)

This function returns void pointer to a value. Field can be symbolic constant or numerical ID. It can be used for both fixed-length and variable-length fields. (This function is used for fields defined at run-time)

+
char* ur_get_var_as_str(tmplt, rec, field);

Function copies data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()! Field can be symbolic constant or numerical ID.

+

Set value to UniRec record.

+

Following functions are used to set a value to specified field in a record.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template
  • +
  • "rec" - Pointer to UniRec record, which is created using given template.
  • +
  • "field" - Identifier of a field.
  • +
  • "value" - Value which is copied to the record.
  • +
+
ur_set(tmplt, rec, field, value) // field must be a symbolic constant ...

This function assumes value of an appropriate type of a specific field (int, uint, ...). Because of this, the field must be a symbolic constant (i.e. "F_name") not a numerical ID. It can be used just for fixed size fields (not for string and bytes).

+

To set dynamically defined field, use ur_get_ptr_by_id() and write to that pointer.

+
ur_set_var(tmplt, rec, field, val_ptr, val_len)

This function is used to set variable-length fields. Field can be symbolic constant or numerical ID. For better performance use function ur_clear_varlen, before setting all variable fields in record.

+

Parameters:

    +
  • "val_ptr" - Pointer to value.
  • +
  • "val_len" - Length of a value. (length which will be copied)
  • +
+
ur_clear_varlen(tmplt, rec);

This function will clear all variable-length fields. It can be used for better performance of setting content to variable-length fields. Use this function before setting of all the variable-length fields.

ur_set_string(tmplt, rec, field, str) //

Set string to the UniRec record. Value is a C-style string, length is determined automatically by strlen() ('\0' is not included in the record)

+
    +
  • "str" - Pointer to a string.
  • +
+

### Size of a fixed-length, static field

ur_get_size(field) // field must be a symbolic constant ...; for static fields only

Returns size of a field. Field has to be statically defined. For variable-length fields it returns -1. To get size of variable-length field use function ur_get_var_len().

+

### Size of variable-length field

ur_get_var_len(tmplt, rec, field)

Returns length of a variable-length field. Field can be symbolic constant or numerical ID.

+

### Size of a fixed-length part of a record

ur_rec_fixlen_size(tmplt)

Returns size of a fixed-length part of a record.

+

### Size of a variable-length part of a record

ur_rec_varlen_size(tmplt, rec)

Returns size of a variable-length part of a record.

+

### Size of a record

ur_rec_size(tmplt, rec)

Returns total size of whole UniRec record.

+

### Check template's fields

ur_is_present(tmplt, field)

Returns non-zero if field is present, zero otherwise.

+

### Check type of a field (variable-length or fixed-length)

ur_is_varlen(field)
ur_is_fixlen(field)

Returns non-zero if field is dynamic, zero otherwise.

+

### ID of a field (dynamic or static)

ur_field_id_t ur_get_id_by_name(const char *name);

Function returns id of a field by name of the field, or UR_E_INVALID_NAME if the name is not known.

+

### Create UniRec record

void* ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size);

Allocates memory for a record with given template. It allocates N+M bytes, where N is the size of fixed-length part of the record (inferred from template), and M is the size of variable-length, which must be provided by caller.

+

Parameters:

    +
  • "tmplt" - Pointer to UniRec template.
  • +
  • "max_var_size" - Size of variable-length part, i.e. sum of lengths of all variable- length fields. If it is not known at the time of record creation, use UR_MAX_SIZE, which allocates enough memory to hold the largest possible UniRec record (65535 bytes). Set to 0 if there are no variable-length fields in the template
  • +
+

### Free UniRec record

void ur_free_record(void *record);

Free memory allocated for UniRec record. You can call system free() on the record as well.

+

### Clone record

ur_clone_record(tmplt, src)

Function creates new UniRec record and fills it with the data given by parameter. It returns Pointer to a new UniRec record.

+

Parameters:

    +
  • "tmplt" Pointer to UniRec template
  • +
  • "src" Pointer to source record
  • +
+

### Copy fields

void ur_copy_fields(dst_tmplt, dst, src_tmplt, src);

Copies all fields present in both templates from src to dst.

+

The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src.

+

Parameters:

    +
  • "dst_tmplt" - Pointer to destination UniRec template.
  • +
  • "dst" - Pointer to destination record. It must point to a memory of enough size.
  • +
  • "src_tmplt" - Pointer to source UniRec template.
  • +
  • "src" - Pointer to source record.
  • +
+

### Iterate over fields of a template

ur_iter_fields(tmplt, id);

This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned.The order of fields is given by the order in which they are defined.

+

The order of fields is given by the order in which they are defined.

+

Parameters:

    +
  • "tmplt" - Pointer to a template to iterate over.
  • +
  • "id" - Field ID returned in last iteration or UR_ITER_BEGIN to get first value.
  • +
+

Returns ID of the next field or UR_ITER_END if no more fields are present.

+

Example usage:

ur_field_id_t id = UR_ITER_BEGIN;
while ((id = ur_iter_fields(tmplt, id)) != UR_ITER_END) {
...
}
ur_iter_fields_record_order(tmplt, id);

This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template.

+

The order of fields is given by the order in the record Parameters:

    +
  • "tmplt" Template to iterate over.
  • +
  • "id" Field ID returned in last iteration or UR_ITER_BEGIN to get first value. Returns ID of the next field or UR_ITER_END if no more fields are present.
  • +
+

Example usage:

int i = 0;
while ((id = ur_iter_fields_record_order(tmplt, i++)) != UR_ITER_END) {
...
}
+ + + + diff --git a/doc/unirec/menu.js b/doc/unirec/menu.js new file mode 100644 index 00000000..89aaf575 --- /dev/null +++ b/doc/unirec/menu.js @@ -0,0 +1,50 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+=''; + } + return result; + } + + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchEnabled) { + if (serverSide) { + $('#main-menu').append('
  • '); + } else { + $('#main-menu').append('
  • '); + } + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/doc/unirec/menudata.js b/doc/unirec/menudata.js new file mode 100644 index 00000000..0cba5e70 --- /dev/null +++ b/doc/unirec/menudata.js @@ -0,0 +1,115 @@ +/* +@ @licstart The following is the entire license notice for the +JavaScript code in this file. + +Copyright (C) 1997-2017 by Dimitri van Heesch + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +@licend The above is the entire license notice +for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Related Pages",url:"pages.html"}, +{text:"Modules",url:"modules.html"}, +{text:"Data Structures",url:"annotated.html",children:[ +{text:"Data Structures",url:"annotated.html"}, +{text:"Data Structure Index",url:"classes.html"}, +{text:"Data Fields",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"a",url:"functions.html#index_a"}, +{text:"b",url:"functions.html#index_b"}, +{text:"c",url:"functions.html#index_c"}, +{text:"d",url:"functions.html#index_d"}, +{text:"f",url:"functions.html#index_f"}, +{text:"h",url:"functions.html#index_h"}, +{text:"i",url:"functions.html#index_i"}, +{text:"l",url:"functions.html#index_l"}, +{text:"m",url:"functions.html#index_m"}, +{text:"n",url:"functions.html#index_n"}, +{text:"o",url:"functions.html#index_o"}, +{text:"s",url:"functions.html#index_s"}, +{text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}, +{text:"v",url:"functions.html#index_v"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"a",url:"functions_vars.html#index_a"}, +{text:"b",url:"functions_vars.html#index_b"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"d",url:"functions_vars.html#index_d"}, +{text:"f",url:"functions_vars.html#index_f"}, +{text:"h",url:"functions_vars.html#index_h"}, +{text:"i",url:"functions_vars.html#index_i"}, +{text:"l",url:"functions_vars.html#index_l"}, +{text:"m",url:"functions_vars.html#index_m"}, +{text:"n",url:"functions_vars.html#index_n"}, +{text:"o",url:"functions_vars.html#index_o"}, +{text:"s",url:"functions_vars.html#index_s"}, +{text:"t",url:"functions_vars.html#index_t"}, +{text:"u",url:"functions_vars.html#index_u"}, +{text:"v",url:"functions_vars.html#index_v"}]}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"Globals",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"_",url:"globals.html#index__"}, +{text:"a",url:"globals_a.html#index_a"}, +{text:"b",url:"globals_b.html#index_b"}, +{text:"c",url:"globals_c.html#index_c"}, +{text:"d",url:"globals_d.html#index_d"}, +{text:"f",url:"globals_f.html#index_f"}, +{text:"h",url:"globals_h.html#index_h"}, +{text:"i",url:"globals_i.html#index_i"}, +{text:"l",url:"globals_l.html#index_l"}, +{text:"m",url:"globals_m.html#index_m"}, +{text:"n",url:"globals_n.html#index_n"}, +{text:"p",url:"globals_p.html#index_p"}, +{text:"r",url:"globals_r.html#index_r"}, +{text:"s",url:"globals_s.html#index_s"}, +{text:"t",url:"globals_t.html#index_t"}, +{text:"u",url:"globals_u.html#index_u"}, +{text:"v",url:"globals_v.html#index_v"}]}, +{text:"Functions",url:"globals_func.html",children:[ +{text:"_",url:"globals_func.html#index__"}, +{text:"a",url:"globals_func_a.html#index_a"}, +{text:"b",url:"globals_func_b.html#index_b"}, +{text:"c",url:"globals_func_c.html#index_c"}, +{text:"d",url:"globals_func_d.html#index_d"}, +{text:"f",url:"globals_func_f.html#index_f"}, +{text:"i",url:"globals_func_i.html#index_i"}, +{text:"m",url:"globals_func_m.html#index_m"}, +{text:"n",url:"globals_func_n.html#index_n"}, +{text:"p",url:"globals_func_p.html#index_p"}, +{text:"u",url:"globals_func_u.html#index_u"}]}, +{text:"Variables",url:"globals_vars.html"}, +{text:"Typedefs",url:"globals_type.html"}, +{text:"Enumerations",url:"globals_enum.html"}, +{text:"Enumerator",url:"globals_eval.html",children:[ +{text:"u",url:"globals_eval.html#index_u"}]}, +{text:"Macros",url:"globals_defs.html",children:[ +{text:"_",url:"globals_defs.html#index__"}, +{text:"c",url:"globals_defs.html#index_c"}, +{text:"d",url:"globals_defs.html#index_d"}, +{text:"h",url:"globals_defs.html#index_h"}, +{text:"i",url:"globals_defs.html#index_i"}, +{text:"l",url:"globals_defs.html#index_l"}, +{text:"m",url:"globals_defs.html#index_m"}, +{text:"n",url:"globals_defs.html#index_n"}, +{text:"p",url:"globals_defs.html#index_p"}, +{text:"s",url:"globals_defs.html#index_s"}, +{text:"t",url:"globals_defs.html#index_t"}, +{text:"u",url:"globals_defs.html#index_u"}, +{text:"v",url:"globals_defs.html#index_v"}]}]}]}]} diff --git a/doc/unirec/modules.html b/doc/unirec/modules.html new file mode 100644 index 00000000..848ade1d --- /dev/null +++ b/doc/unirec/modules.html @@ -0,0 +1,87 @@ + + + + + + + +UniRec: Modules + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    Modules
    +
    + + + + + diff --git a/doc/unirec/nav_f.png b/doc/unirec/nav_f.png new file mode 100644 index 00000000..72a58a52 Binary files /dev/null and b/doc/unirec/nav_f.png differ diff --git a/doc/unirec/nav_g.png b/doc/unirec/nav_g.png new file mode 100644 index 00000000..2093a237 Binary files /dev/null and b/doc/unirec/nav_g.png differ diff --git a/doc/unirec/nav_h.png b/doc/unirec/nav_h.png new file mode 100644 index 00000000..33389b10 Binary files /dev/null and b/doc/unirec/nav_h.png differ diff --git a/doc/unirec/open.png b/doc/unirec/open.png new file mode 100644 index 00000000..30f75c7e Binary files /dev/null and b/doc/unirec/open.png differ diff --git a/doc/unirec/pages.html b/doc/unirec/pages.html new file mode 100644 index 00000000..40a2beca --- /dev/null +++ b/doc/unirec/pages.html @@ -0,0 +1,84 @@ + + + + + + + +UniRec: Related Pages + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    Related Pages
    +
    +
    +
    Here is a list of all related documentation pages:
    +
    + + + + diff --git a/doc/unirec/search/all_0.html b/doc/unirec/search/all_0.html new file mode 100644 index 00000000..5125b940 --- /dev/null +++ b/doc/unirec/search/all_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_0.js b/doc/unirec/search/all_0.js new file mode 100644 index 00000000..24e03286 --- /dev/null +++ b/doc/unirec/search/all_0.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['_5f_5fattribute_5f_5f',['__attribute__',['../macaddr_8h.html#a202b86560da53b16227e10045265cefa',1,'macaddr.h']]], + ['_5f_5fstdc_5flimit_5fmacros',['__STDC_LIMIT_MACROS',['../unirec_8h.html#aeb7e7a856ab7a794b05b6b63ef36ea3e',1,'unirec.h']]], + ['_5f_5fuse_5fxopen',['__USE_XOPEN',['../unirec_8c.html#a8773045a81f883f2ab00761f45e8642c',1,'unirec.c']]], + ['_5fbsd_5fsource',['_BSD_SOURCE',['../unirec_8c.html#ad3d8a3bd0c0b677acef144f2c2ef6d73',1,'unirec.c']]], + ['_5fdefault_5fsource',['_DEFAULT_SOURCE',['../unirec_8c.html#a8fb447618db946a9e2a596d9ea18763f',1,'unirec.c']]], + ['_5fxopen_5fsource',['_XOPEN_SOURCE',['../unirec_8c.html#a78c99ffd76a7bb3c8c74db76207e9ab4',1,'unirec.c']]] +]; diff --git a/doc/unirec/search/all_1.html b/doc/unirec/search/all_1.html new file mode 100644 index 00000000..b8ff8711 --- /dev/null +++ b/doc/unirec/search/all_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_1.js b/doc/unirec/search/all_1.js new file mode 100644 index 00000000..317c2f01 --- /dev/null +++ b/doc/unirec/search/all_1.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['add_5fdata',['add_data',['../ip__prefix__search_8c.html#a9864b24744feaad0462a326e434a8f9b',1,'add_data(ipps_interval_t *interval, void *data, size_t data_len): ip_prefix_search.c'],['../ipps__internal_8h.html#a9864b24744feaad0462a326e434a8f9b',1,'add_data(ipps_interval_t *interval, void *data, size_t data_len): ip_prefix_search.c']]], + ['addr',['addr',['../ip__prefix__search_8h.html#af40b27d3ab53f236728bf696b85beaa4',1,'ipps_network_t']]], + ['argv',['argv',['../example__unirec_8c.html#af2efa898e9eed6fe6715279cb1ec35b0',1,'example_unirec.c']]], + ['array_5flen',['array_len',['../ip__prefix__search_8h.html#ad8134e855f83cab01e22e291cab33e46',1,'ipps_interval_t']]] +]; diff --git a/doc/unirec/search/all_10.html b/doc/unirec/search/all_10.html new file mode 100644 index 00000000..50bc449e --- /dev/null +++ b/doc/unirec/search/all_10.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_10.js b/doc/unirec/search/all_10.js new file mode 100644 index 00000000..6ac7e3e9 --- /dev/null +++ b/doc/unirec/search/all_10.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['time_5fwith_5fsys_5ftime',['TIME_WITH_SYS_TIME',['../config_8h.html#a2b44ef64cf38e064ef11e11f35271380',1,'config.h']]], + ['tmplt',['tmplt',['../group__unirec2csv.html#af9610db66cf3ffc3d6714ac6fea56c5a',1,'urcsv_t']]], + ['tmplt1',['tmplt1',['../example__unirec_8c.html#a593f6e2ec4c598e1fdee4cadf6b59bf6',1,'example_unirec.c']]], + ['tmplt2',['tmplt2',['../example__unirec_8c.html#a67205fb81bdf5e95cf28eb5ab0c8af67',1,'example_unirec.c']]], + ['trap_5fctx_5freceive',['TRAP_CTX_RECEIVE',['../group__libtraphelpers.html#gac3f8ae5f2495115a5b4c04d02646c7b3',1,'unirec.h']]], + ['trap_5freceive',['TRAP_RECEIVE',['../group__libtraphelpers.html#gae7a20329dfe3f847174cf076d5054cac',1,'unirec.h']]], + ['timestamps_20api',['Timestamps API',['../group__urtime.html',1,'']]] +]; diff --git a/doc/unirec/search/all_11.html b/doc/unirec/search/all_11.html new file mode 100644 index 00000000..b35c8bf0 --- /dev/null +++ b/doc/unirec/search/all_11.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_11.js b/doc/unirec/search/all_11.js new file mode 100644 index 00000000..05c019ef --- /dev/null +++ b/doc/unirec/search/all_11.js @@ -0,0 +1,230 @@ +var searchData= +[ + ['unirec_3a_20content_20of_20documentation',['UniRec: Content of documentation',['../index.html',1,'']]], + ['unirec',['UniRec',['../md_doc_intro.html',1,'']]], + ['unirec',['UniRec',['../md_README.html',1,'']]], + ['ui16',['ui16',['../group__uripaddr.html#a7037d9d99f039e7b067b7d6425d8d9d1',1,'ip_addr_t']]], + ['ui32',['ui32',['../group__uripaddr.html#a2305ae4c4f3a44cc13f4c7acc15fba40',1,'ip_addr_t']]], + ['ui64',['ui64',['../group__uripaddr.html#a2a293ee262feeb6206a9c0b4a1623575',1,'ip_addr_t']]], + ['ui8',['ui8',['../group__uripaddr.html#a1b4c6707d88d198cdf8fc2400c270b30',1,'ip_addr_t']]], + ['unirec_2ec',['unirec.c',['../unirec_8c.html',1,'']]], + ['unirec_2eh',['unirec.h',['../unirec_8h.html',1,'']]], + ['unirec2csv_2ec',['unirec2csv.c',['../unirec2csv_8c.html',1,'']]], + ['unirec2csv_2eh',['unirec2csv.h',['../unirec2csv_8h.html',1,'']]], + ['ur_5fallocated_5ffields',['ur_allocated_fields',['../unirec_8h.html#abe745769ca4dd67bf653de0687033da9',1,'ur_field_specs_t']]], + ['ur_5farray_5falloc',['UR_ARRAY_ALLOC',['../unirec_8h.html#a6ed30dfa27fa7805e7331d11b6c32e06',1,'unirec.h']]], + ['ur_5farray_5fallocate',['ur_array_allocate',['../group__urtemplate.html#ga5dfdf2e69ec5498aee45a5f401154a10',1,'unirec.h']]], + ['ur_5farray_5fappend',['ur_array_append',['../group__urtemplate.html#ga4e639638c4136863ae875b0622039c95',1,'unirec.h']]], + ['ur_5farray_5fappend_5fget_5fptr',['ur_array_append_get_ptr',['../group__urtemplate.html#ga75d85b3a23dbd6c4c82d21747d4506b0',1,'ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id): unirec.c'],['../group__urtemplate.html#ga75d85b3a23dbd6c4c82d21747d4506b0',1,'ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id): unirec.c']]], + ['ur_5farray_5fclear',['ur_array_clear',['../group__urtemplate.html#gaba7a2278e2f8ee60048d0188e04acbdb',1,'unirec.h']]], + ['ur_5farray_5fdelimiter',['UR_ARRAY_DELIMITER',['../unirec_8h.html#a243a2fc72cac677ccc100e8a853b965a',1,'unirec.h']]], + ['ur_5farray_5fget',['ur_array_get',['../group__urtemplate.html#ga382ab2ea34097f2a55303ef8b953a3a5',1,'unirec.h']]], + ['ur_5farray_5fget_5felem_5fcnt',['ur_array_get_elem_cnt',['../group__urtemplate.html#gac5353703ff967c462766f4e55b63e90b',1,'unirec.h']]], + ['ur_5farray_5fget_5felem_5fsize',['ur_array_get_elem_size',['../group__urtemplate.html#gac8cca7b8b7ad644c7e09078a694f701c',1,'unirec.h']]], + ['ur_5farray_5fget_5felem_5ftype',['ur_array_get_elem_type',['../group__urtemplate.html#ga79d29f865b6f6bcdac7a186f6919f071',1,'unirec.h']]], + ['ur_5farray_5fresize',['ur_array_resize',['../group__urtemplate.html#ga61e624b3e32c5c6e79dcab1ebcc6d31f',1,'ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len): unirec.c'],['../group__urtemplate.html#ga61e624b3e32c5c6e79dcab1ebcc6d31f',1,'ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len): unirec.c']]], + ['ur_5farray_5fset',['ur_array_set',['../group__urtemplate.html#ga3026242086e13048c784f8c1c0af8295',1,'unirec.h']]], + ['ur_5fclear_5fvarlen',['ur_clear_varlen',['../group__urtemplate.html#ga1a1a56a89c745a13823db8ef01fcb07b',1,'ur_clear_varlen(const ur_template_t *tmplt, void *rec): unirec.c'],['../group__urtemplate.html#ga1a1a56a89c745a13823db8ef01fcb07b',1,'ur_clear_varlen(const ur_template_t *tmplt, void *rec): unirec.c']]], + ['ur_5fclone_5frecord',['ur_clone_record',['../group__urtemplate.html#gab57dab204aa7abf9f0dbde89f0ee408d',1,'ur_clone_record(const ur_template_t *tmplt, const void *src): unirec.c'],['../group__urtemplate.html#gab57dab204aa7abf9f0dbde89f0ee408d',1,'ur_clone_record(const ur_template_t *tmplt, const void *src): unirec.c']]], + ['ur_5fcopy_5ffields',['ur_copy_fields',['../example__unirec_8c.html#ae337d496c308d0b4350a7a0ad8fa5e52',1,'ur_copy_fields(tmplt2, buffer2, tmplt1, buffer): example_unirec.c'],['../group__urtemplate.html#gade89057b16556ff28d540a1f0473ab81',1,'ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src): unirec.c'],['../group__urtemplate.html#gade89057b16556ff28d540a1f0473ab81',1,'ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src): unirec.c']]], + ['ur_5fcount_5fof_5ftypes',['UR_COUNT_OF_TYPES',['../unirec_8h.html#a9d12294a70c27484f1f273d14c2231a1',1,'unirec.h']]], + ['ur_5fcpy',['ur_cpy',['../group__urtemplate.html#ga645c638cf460d10d00abb5fbf53216ec',1,'unirec.h']]], + ['ur_5fcpy_5fstring',['ur_cpy_string',['../group__urtemplate.html#ga11693505eb5de52b6b2b021aeaf1a7e1',1,'ur_cpy_string(const char *str): unirec.c'],['../group__urtemplate.html#ga11693505eb5de52b6b2b021aeaf1a7e1',1,'ur_cpy_string(const char *str): unirec.c']]], + ['ur_5fcreate_5fbidirectional_5ftemplate',['ur_create_bidirectional_template',['../group__urtemplate.html#ga2e7425a74c3b15819986ef351d80d117',1,'unirec.h']]], + ['ur_5fcreate_5finput_5ftemplate',['ur_create_input_template',['../group__urtemplate.html#ga65944d32290d933cdc6c8e1b724a35ff',1,'unirec.h']]], + ['ur_5fcreate_5flinks',['ur_create_links',['../group__urlinks.html#ga79615b30cdec474a94bb5ce5f3eeb34f',1,'ur_create_links(const char *mask): unirec.c'],['../group__urlinks.html#ga79615b30cdec474a94bb5ce5f3eeb34f',1,'ur_create_links(const char *mask): unirec.c']]], + ['ur_5fcreate_5foutput_5ftemplate',['ur_create_output_template',['../group__urtemplate.html#ga1a0e3a1ab4e88e9c84b8b64f6d3fa0c0',1,'unirec.h']]], + ['ur_5fcreate_5frecord',['ur_create_record',['../group__urtemplate.html#ga7e2d113dfd7629182d2b18c29c408707',1,'ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size): unirec.c'],['../group__urtemplate.html#ga7e2d113dfd7629182d2b18c29c408707',1,'ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size): unirec.c']]], + ['ur_5fcreate_5ftemplate',['ur_create_template',['../group__urtemplate.html#gaec94dfdd45a6af36f412cc06f9b0106d',1,'ur_create_template(const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gaec94dfdd45a6af36f412cc06f9b0106d',1,'ur_create_template(const char *fields, char **errstr): unirec.c']]], + ['ur_5fcreate_5ftemplate_5ffrom_5fifc_5fspec',['ur_create_template_from_ifc_spec',['../group__urtemplate.html#gae1a76a48d18a09ee2f32ed638bbcbcf7',1,'ur_create_template_from_ifc_spec(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#gae1a76a48d18a09ee2f32ed638bbcbcf7',1,'ur_create_template_from_ifc_spec(const char *ifc_data_fmt): unirec.c']]], + ['ur_5fctx_5fcreate_5fbidirectional_5ftemplate',['ur_ctx_create_bidirectional_template',['../group__urtemplate.html#ga5ac83d4ba9ab47e065f7847272beac67',1,'ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#ga5ac83d4ba9ab47e065f7847272beac67',1,'ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fcreate_5finput_5ftemplate',['ur_ctx_create_input_template',['../group__urtemplate.html#gabc843c9ffe0367e0e2d40bbf4f3c6053',1,'ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gabc843c9ffe0367e0e2d40bbf4f3c6053',1,'ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fcreate_5foutput_5ftemplate',['ur_ctx_create_output_template',['../group__urtemplate.html#gab80b3d4a916e0657f57062c9477d5bd0',1,'ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gab80b3d4a916e0657f57062c9477d5bd0',1,'ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fset_5finput_5ftemplate',['ur_ctx_set_input_template',['../group__urtemplate.html#gaa21b5e95ade1d2d6993fcf9f9a6c4548',1,'ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gaa21b5e95ade1d2d6993fcf9f9a6c4548',1,'ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c']]], + ['ur_5fctx_5fset_5foutput_5ftemplate',['ur_ctx_set_output_template',['../group__urtemplate.html#gaa27853144707572d1e6a5e0f0a37edae',1,'ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gaa27853144707572d1e6a5e0f0a37edae',1,'ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c']]], + ['ur_5fdefault_5flength_5fof_5ffield_5fname',['UR_DEFAULT_LENGTH_OF_FIELD_NAME',['../unirec_8h.html#a4821db36ecbefac234e93423e1572d8b',1,'unirec.h']]], + ['ur_5fdefault_5flength_5fof_5ffield_5ftype',['UR_DEFAULT_LENGTH_OF_FIELD_TYPE',['../unirec_8h.html#a19c4a8e87b02d9f08120d80ee99d377d',1,'unirec.h']]], + ['ur_5fdefault_5flength_5fof_5ftemplate',['UR_DEFAULT_LENGTH_OF_TEMPLATE',['../unirec_8h.html#a6d4be6c0e3ab412dad7052b6b92cf064',1,'unirec.h']]], + ['ur_5fdefine_5ffield',['ur_define_field',['../group__urtemplate.html#gae9296343268e2117e4f53705c0cdf3a5',1,'ur_define_field(const char *name, ur_field_type_t type): unirec.c'],['../group__urtemplate.html#gae9296343268e2117e4f53705c0cdf3a5',1,'ur_define_field(const char *name, ur_field_type_t type): unirec.c']]], + ['ur_5fdefine_5ffields_5fand_5fupdate_5ftemplate',['ur_define_fields_and_update_template',['../group__urtemplate.html#ga4b090390e3e2728d2d59168eb532633a',1,'ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga4b090390e3e2728d2d59168eb532633a',1,'ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c']]], + ['ur_5fdefine_5fset_5fof_5ffields',['ur_define_set_of_fields',['../group__urtemplate.html#gadc5a6441796f8df8c63645298170f8f4',1,'ur_define_set_of_fields(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#gadc5a6441796f8df8c63645298170f8f4',1,'ur_define_set_of_fields(const char *ifc_data_fmt): unirec.c']]], + ['ur_5fe_5finvalid_5ffield_5fid',['UR_E_INVALID_FIELD_ID',['../unirec_8h.html#ae983554dcd55068c660732abb7cc29a9',1,'unirec.h']]], + ['ur_5fe_5finvalid_5fname',['UR_E_INVALID_NAME',['../unirec_8h.html#a3286791b4d19706d580fb5dbf07ed5f4',1,'unirec.h']]], + ['ur_5fe_5finvalid_5fparameter',['UR_E_INVALID_PARAMETER',['../unirec_8h.html#ab5f672a177d78e7c11abe1922c424b92',1,'unirec.h']]], + ['ur_5fe_5finvalid_5ftype',['UR_E_INVALID_TYPE',['../unirec_8h.html#ab7dca2db4854ed9db6ffff65d4d9d10a',1,'unirec.h']]], + ['ur_5fe_5fmemory',['UR_E_MEMORY',['../unirec_8h.html#a0e9b91b96ad7672de1171b543e5d68f6',1,'unirec.h']]], + ['ur_5fe_5ftype_5fmismatch',['UR_E_TYPE_MISMATCH',['../unirec_8h.html#a272389ab0926da72541efdaf1bf9377c',1,'unirec.h']]], + ['ur_5fexpand_5ftemplate',['ur_expand_template',['../group__urtemplate.html#gac2b52aaae2bd3aa7d38b119a95a275e9',1,'ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gac2b52aaae2bd3aa7d38b119a95a275e9',1,'ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c']]], + ['ur_5ffield_5farray_5felem_5ftype',['ur_field_array_elem_type',['../group__urtemplate.html#gab50744832dee040515e0723ac30c85b9',1,'ur_field_array_elem_type(): unirec.c'],['../group__urtemplate.html#gab50744832dee040515e0723ac30c85b9',1,'ur_field_array_elem_type(): unirec.c']]], + ['ur_5ffield_5fid_5flinked_5flist_5fs',['ur_field_id_linked_list_s',['../unirec_8h.html#structur__field__id__linked__list__s',1,'']]], + ['ur_5ffield_5fid_5fmax',['UR_FIELD_ID_MAX',['../unirec_8h.html#aac640f7c39c04cb3b3ca150da6e46454',1,'unirec.h']]], + ['ur_5ffield_5fid_5ft',['ur_field_id_t',['../unirec_8h.html#a17cba425af74e590b73d23d4e0fda44a',1,'unirec.h']]], + ['ur_5ffield_5fnames',['ur_field_names',['../unirec_8h.html#a98353be825cf3f1fb16c73e048ea0b74',1,'ur_static_field_specs_t::ur_field_names()'],['../unirec_8h.html#a9ef90bbaacc4b629a182cca2fe3f6ed3',1,'ur_field_specs_t::ur_field_names()']]], + ['ur_5ffield_5fsizes',['ur_field_sizes',['../unirec_8h.html#a802e8538253f5509acc14f2da2b225f6',1,'ur_static_field_specs_t::ur_field_sizes()'],['../unirec_8h.html#a91ce0528dfa853da3ca1dcd377a1ceeb',1,'ur_field_specs_t::ur_field_sizes()']]], + ['ur_5ffield_5fspecs',['ur_field_specs',['../group__urtemplate.html#ga8b963edd959e1d4bdd91d82807a384ba',1,'ur_field_specs(): unirec.c'],['../group__urtemplate.html#ga8b963edd959e1d4bdd91d82807a384ba',1,'ur_field_specs(): unirec.c']]], + ['ur_5ffield_5fspecs_5fstatic',['UR_FIELD_SPECS_STATIC',['../group__urtemplate.html#ga67e3a2f4dff881d18a6a3c8cc67b906b',1,'UR_FIELD_SPECS_STATIC(): unirec.c'],['../group__urtemplate.html#ga67e3a2f4dff881d18a6a3c8cc67b906b',1,'UR_FIELD_SPECS_STATIC(): unirec.c']]], + ['ur_5ffield_5fspecs_5ft',['ur_field_specs_t',['../unirec_8h.html#structur__field__specs__t',1,'']]], + ['ur_5ffield_5ftype_5fsize',['ur_field_type_size',['../group__urtemplate.html#ga81f8d7af996a01f4b6e4ac086d483eb0',1,'ur_field_type_size(): unirec.c'],['../group__urtemplate.html#ga81f8d7af996a01f4b6e4ac086d483eb0',1,'ur_field_type_size(): unirec.c']]], + ['ur_5ffield_5ftype_5fstr',['ur_field_type_str',['../group__urtemplate.html#ga2a84dc8eb5478757192b2df4004c148a',1,'ur_field_type_str(): unirec.c'],['../group__urtemplate.html#ga2a84dc8eb5478757192b2df4004c148a',1,'ur_field_type_str(): unirec.c']]], + ['ur_5ffield_5ftype_5ft',['ur_field_type_t',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030',1,'unirec.h']]], + ['ur_5ffield_5ftypes',['ur_field_types',['../unirec_8h.html#ad5306965acd4764b31d6634a0947e7a2',1,'ur_static_field_specs_t::ur_field_types()'],['../unirec_8h.html#a34d9bd7272e5f6d60ba60afef4d59e82',1,'ur_field_specs_t::ur_field_types()']]], + ['ur_5ffields',['UR_FIELDS',['../unirec_8h.html#ab0c059e36cea5fa00b0180248543a123',1,'UR_FIELDS(): unirec.h'],['../example__unirec_8c.html#aa00785ea0941e5b770ae8d1fc33e6d1d',1,'UR_FIELDS(uint32 FOO, uint32 BAR, ipaddr IP, string STR1, string STR2,) int main(int argc: example_unirec.c']]], + ['ur_5ffinalize',['ur_finalize',['../example__unirec_8c.html#a27c079b5e81042d3a6abe210afc17124',1,'ur_finalize(): unirec.c'],['../group__urtemplate.html#ga77bb16e4585117517a5d7aabebcb8a0a',1,'ur_finalize(): unirec.c'],['../group__urtemplate.html#ga77bb16e4585117517a5d7aabebcb8a0a',1,'ur_finalize(): unirec.c']]], + ['ur_5ffree_5flinks',['ur_free_links',['../group__urlinks.html#ga7e1802498fc99e49f98eada58ff0d883',1,'ur_free_links(ur_links_t *links): unirec.c'],['../group__urlinks.html#ga7e1802498fc99e49f98eada58ff0d883',1,'ur_free_links(ur_links_t *links): unirec.c']]], + ['ur_5ffree_5frecord',['ur_free_record',['../group__urtemplate.html#gaf622ee72f07d52a617a22be35088d77e',1,'ur_free_record(void *record): unirec.c'],['../group__urtemplate.html#gaf622ee72f07d52a617a22be35088d77e',1,'ur_free_record(void *record): unirec.c']]], + ['ur_5ffree_5ftemplate',['ur_free_template',['../example__unirec_8c.html#a37220cca7f0b15555963b48d2b1f5eb3',1,'ur_free_template(tmplt): example_unirec.c'],['../example__unirec_8c.html#a3a718a067ebd0d06ab0e6861737fb0cf',1,'ur_free_template(tmplt1): example_unirec.c'],['../example__unirec_8c.html#af2c2fdadf7f8dca4d5b0756d2dd8b9f3',1,'ur_free_template(tmplt2): example_unirec.c'],['../group__urtemplate.html#ga6bfac2d2161cf28551a467a382feda7e',1,'ur_free_template(ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga6bfac2d2161cf28551a467a382feda7e',1,'ur_free_template(ur_template_t *tmplt): unirec.c']]], + ['ur_5fget',['ur_get',['../group__urtemplate.html#gabb1a3fb3e2a05cc0fc77bb79b0da06f3',1,'unirec.h']]], + ['ur_5fget_5fempty_5fid',['ur_get_empty_id',['../group__urtemplate.html#ga98890a8d9702c533d4d1d1e7921f74e6',1,'ur_get_empty_id(): unirec.c'],['../group__urtemplate.html#ga98890a8d9702c533d4d1d1e7921f74e6',1,'ur_get_empty_id(): unirec.c']]], + ['ur_5fget_5ffield_5ftype_5ffrom_5fstr',['ur_get_field_type_from_str',['../group__urtemplate.html#gae511d9e52485818f2513fe5f2e1d564c',1,'ur_get_field_type_from_str(const char *type): unirec.c'],['../group__urtemplate.html#gae511d9e52485818f2513fe5f2e1d564c',1,'ur_get_field_type_from_str(const char *type): unirec.c']]], + ['ur_5fget_5fid_5fby_5fname',['ur_get_id_by_name',['../group__urtemplate.html#gae04af6d1916490e641f7640e440a8e7c',1,'ur_get_id_by_name(const char *name): unirec.c'],['../group__urtemplate.html#gae04af6d1916490e641f7640e440a8e7c',1,'ur_get_id_by_name(const char *name): unirec.c']]], + ['ur_5fget_5flen',['ur_get_len',['../group__urtemplate.html#gacd8ba93602d9f4038e165ce0e7f4a716',1,'unirec.h']]], + ['ur_5fget_5flink_5fbit_5ffield_5fposition',['ur_get_link_bit_field_position',['../group__urlinks.html#ga469c39d33966e8752fc53a4fba154d10',1,'ur_get_link_bit_field_position(ur_links_t *links, unsigned int index): links.h'],['../group__urlinks.html#ga469c39d33966e8752fc53a4fba154d10',1,'ur_get_link_bit_field_position(ur_links_t *links, unsigned int index): links.h']]], + ['ur_5fget_5flink_5fcount',['ur_get_link_count',['../group__urlinks.html#ga9ae62c9d1c388c62669aa5dfdeb97977',1,'ur_get_link_count(ur_links_t *links): links.h'],['../group__urlinks.html#ga9ae62c9d1c388c62669aa5dfdeb97977',1,'ur_get_link_count(ur_links_t *links): links.h']]], + ['ur_5fget_5flink_5findex',['ur_get_link_index',['../group__urlinks.html#ga20fe681784b2536ad4293ed1d2932da2',1,'ur_get_link_index(ur_links_t *links, uint64_t link_bit_field): links.h'],['../group__urlinks.html#ga20fe681784b2536ad4293ed1d2932da2',1,'ur_get_link_index(ur_links_t *links, uint64_t link_bit_field): links.h']]], + ['ur_5fget_5flink_5fmask',['ur_get_link_mask',['../group__urlinks.html#gab0da3a3f0c637c7f49640f74a262e6a0',1,'ur_get_link_mask(ur_links_t *links): links.h'],['../group__urlinks.html#gab0da3a3f0c637c7f49640f74a262e6a0',1,'ur_get_link_mask(ur_links_t *links): links.h']]], + ['ur_5fget_5fname',['ur_get_name',['../group__urtemplate.html#gad04c00ef18b154d71d41826d30ceec08',1,'unirec.h']]], + ['ur_5fget_5fptr',['ur_get_ptr',['../group__urtemplate.html#ga1c6433c8677beb6eb9befca1f770919c',1,'unirec.h']]], + ['ur_5fget_5fptr_5fby_5fid',['ur_get_ptr_by_id',['../group__urtemplate.html#gafa84d61d75b3ab18b1b7262e9b31a6d3',1,'ur_get_ptr_by_id(): unirec.h'],['../example__unirec_8c.html#a1be5c783827bbb7c21da30485dbf4d6f',1,'ur_get_ptr_by_id(tmplt2, buffer2, new_id)): example_unirec.c']]], + ['ur_5fget_5fsize',['ur_get_size',['../group__urtemplate.html#ga770ecf70233ae337f3aa4af9540a11ba',1,'unirec.h']]], + ['ur_5fget_5ftype',['ur_get_type',['../group__urtemplate.html#gae46ff3befebabc8c83372030a98df592',1,'unirec.h']]], + ['ur_5fget_5ftype_5fand_5fname_5ffrom_5fstring',['ur_get_type_and_name_from_string',['../unirec_8c.html#a1dad0e5a16c5828870041e64270e1943',1,'unirec.c']]], + ['ur_5fget_5fvar_5fas_5fstr',['ur_get_var_as_str',['../group__urtemplate.html#ga8b5745a7f8f493f0ccd9a2099e191efd',1,'ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id): unirec.c'],['../group__urtemplate.html#ga8b5745a7f8f493f0ccd9a2099e191efd',1,'ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id): unirec.c']]], + ['ur_5fget_5fvar_5flen',['ur_get_var_len',['../group__urtemplate.html#gaa95364028416eca5e5741dee2533e35a',1,'unirec.h']]], + ['ur_5fget_5fvar_5foffset',['ur_get_var_offset',['../group__urtemplate.html#ga6661b319bc4874c2ab67d5d780eeddf2',1,'unirec.h']]], + ['ur_5fifc_5fdata_5ffmt_5fto_5ffield_5fnames',['ur_ifc_data_fmt_to_field_names',['../group__urtemplate.html#ga31d468a710c302abfc212784c99ef889',1,'ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#ga31d468a710c302abfc212784c99ef889',1,'ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt): unirec.c']]], + ['ur_5finit',['ur_init',['../group__urtemplate.html#ga238d68dc4d1dc5b0369e907b0e2d9711',1,'ur_init(ur_static_field_specs_t field_specs_static): unirec.c'],['../group__urtemplate.html#ga238d68dc4d1dc5b0369e907b0e2d9711',1,'ur_init(ur_static_field_specs_t field_specs_static): unirec.c']]], + ['ur_5finitial_5fsize_5ffields_5ftable',['UR_INITIAL_SIZE_FIELDS_TABLE',['../unirec_8h.html#aa5d7494a2e5265dce181ecdcfaeaaaea',1,'unirec.h']]], + ['ur_5finitialized',['UR_INITIALIZED',['../unirec_8h.html#a1c3c1c127c05a89b0e87197d022e7107',1,'unirec.h']]], + ['ur_5finvalid_5ffield',['UR_INVALID_FIELD',['../unirec_8h.html#a378cb4e4ce3b8c02b30690e8857c3875',1,'unirec.h']]], + ['ur_5finvalid_5foffset',['UR_INVALID_OFFSET',['../unirec_8h.html#a82342fa356ae9d09be33db986f6d2df2',1,'unirec.h']]], + ['ur_5fis_5farray',['ur_is_array',['../group__urtemplate.html#ga6552e5aeff1fb9a56f38088d5aad84a1',1,'unirec.h']]], + ['ur_5fis_5fdynamic',['ur_is_dynamic',['../group__urtemplate.html#gab57c3017aef297977968847da9e05911',1,'unirec.h']]], + ['ur_5fis_5ffixlen',['ur_is_fixlen',['../group__urtemplate.html#ga9943882334417879956e79261450cd06',1,'unirec.h']]], + ['ur_5fis_5fpresent',['ur_is_present',['../group__urtemplate.html#gafd4879120b30f35f9753e2104eb55920',1,'unirec.h']]], + ['ur_5fis_5fstatic',['ur_is_static',['../group__urtemplate.html#gaa98993f5da922c40edc2c8adb8a949ad',1,'unirec.h']]], + ['ur_5fis_5fvarlen',['ur_is_varlen',['../group__urtemplate.html#ga25036db976a342e9e321805601e3be4b',1,'unirec.h']]], + ['ur_5fiter_5fbegin',['UR_ITER_BEGIN',['../unirec_8h.html#a193dc30952d6b8be7caeba1e6e5f2671',1,'unirec.h']]], + ['ur_5fiter_5fend',['UR_ITER_END',['../unirec_8h.html#accf8d970c42f19c249ece4959a7f38b6',1,'unirec.h']]], + ['ur_5fiter_5ffields',['ur_iter_fields',['../group__urtemplate.html#gafb2182af09a35e3ba1bc868c311f3a80',1,'ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id): unirec.c'],['../group__urtemplate.html#gafb2182af09a35e3ba1bc868c311f3a80',1,'ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id): unirec.c']]], + ['ur_5fiter_5ffields_5frecord_5forder',['ur_iter_fields_record_order',['../group__urtemplate.html#ga8877cbc958a4943aaf720154f8338ae3',1,'ur_iter_fields_record_order(const ur_template_t *tmplt, int index): unirec.c'],['../group__urtemplate.html#ga8877cbc958a4943aaf720154f8338ae3',1,'ur_iter_fields_record_order(const ur_template_t *tmplt, int index): unirec.c']]], + ['ur_5fiter_5ft',['ur_iter_t',['../unirec_8h.html#a0d8bbc1307c342a3a83bc2f5193e5fdf',1,'unirec.h']]], + ['ur_5flast_5fid',['ur_last_id',['../unirec_8h.html#a8489cc7746e8177392cdd13465e96547',1,'ur_static_field_specs_t::ur_last_id()'],['../unirec_8h.html#a0876b58dc84e725e78e94f0081e25c67',1,'ur_field_specs_t::ur_last_id()']]], + ['ur_5flast_5fstatically_5fdefined_5fid',['ur_last_statically_defined_id',['../unirec_8h.html#a2e28bd09fc5056730e543d023cf0a2da',1,'ur_field_specs_t']]], + ['ur_5flinks_5ft',['ur_links_t',['../group__urlinks.html#structur__links__t',1,'']]], + ['ur_5fmax_5fsize',['UR_MAX_SIZE',['../group__urtemplate.html#ga83da2388aae5bf3884c4d54a7ad842a7',1,'unirec.h']]], + ['ur_5fmemory_5ferror',['UR_MEMORY_ERROR',['../unirec_8c.html#abd6a82288d5136644ea1e3f8c68f6192',1,'unirec.c']]], + ['ur_5fno_5fdynamic_5fvalues',['UR_NO_DYNAMIC_VALUES',['../unirec_8h.html#a8b797b7bc9ad2159ef020009f031542a',1,'unirec.h']]], + ['ur_5fok',['UR_OK',['../unirec_8h.html#a1a0440dd1b14a93428a69a10581fe8b9',1,'unirec.h']]], + ['ur_5fprint_5ftemplate',['ur_print_template',['../group__urtemplate.html#ga10c9d739b4b74b4547099b9095857dff',1,'ur_print_template(ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga10c9d739b4b74b4547099b9095857dff',1,'ur_print_template(ur_template_t *tmplt): unirec.c']]], + ['ur_5frec_5ffixlen_5fsize',['ur_rec_fixlen_size',['../group__urtemplate.html#ga17d837166e63b47a453f56f00541b0d8',1,'unirec.h']]], + ['ur_5frec_5fsize',['ur_rec_size',['../group__urtemplate.html#ga73f11893596046e5871fc3d520ccc39e',1,'unirec.h']]], + ['ur_5frec_5fvarlen_5fsize',['ur_rec_varlen_size',['../group__urtemplate.html#ga52dad8336d06db586dd23820263f5fc2',1,'ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec): unirec.c'],['../group__urtemplate.html#ga52dad8336d06db586dd23820263f5fc2',1,'ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec): unirec.c']]], + ['ur_5fset',['ur_set',['../group__urtemplate.html#gaacb5b955da2943c6dcee5dea67aad0ae',1,'ur_set(): unirec.h'],['../example__unirec_8c.html#a44c9be2acf8f825c1a5f5b85cfa28416',1,'ur_set(tmplt, rec, F_FOO, 12345): example_unirec.c'],['../example__unirec_8c.html#af952cdb0251e5f01a680df18486f11fd',1,'ur_set(tmplt, rec, F_BAR, 54321): example_unirec.c'],['../example__unirec_8c.html#a472a257c163330eccae1d616f885c574',1,'ur_set(tmplt, rec, F_IP, ip_from_int(12345678)): example_unirec.c']]], + ['ur_5fset_5farray_5ffrom_5fstring',['ur_set_array_from_string',['../group__urtemplate.html#gae2f3f81ef535393f36ccf1ad49a4e510',1,'ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c'],['../group__urtemplate.html#gae2f3f81ef535393f36ccf1ad49a4e510',1,'ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c']]], + ['ur_5fset_5ffrom_5fstring',['ur_set_from_string',['../group__urtemplate.html#gae60aa0708ffef7cadd5a1d7663eb8083',1,'ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c'],['../group__urtemplate.html#gae60aa0708ffef7cadd5a1d7663eb8083',1,'ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c']]], + ['ur_5fset_5finput_5ftemplate',['ur_set_input_template',['../group__urtemplate.html#gac5c9dd8b4d0e9f2bc0ed417fe97764bb',1,'unirec.h']]], + ['ur_5fset_5foutput_5ftemplate',['ur_set_output_template',['../group__urtemplate.html#ga5a28e97a9356a4c325bfb4df47f94056',1,'unirec.h']]], + ['ur_5fset_5fstring',['ur_set_string',['../group__urtemplate.html#ga5aec2178fd7977aad6ec7d3bc409286f',1,'ur_set_string(): unirec.h'],['../example__unirec_8c.html#af0a3ce43925405b52081928f5d9577a6',1,'ur_set_string(tmplt, rec, F_STR1, "Hello World!"): example_unirec.c'],['../example__unirec_8c.html#ae55f23c8dd2f392576f2a69a2205c507',1,'ur_set_string(tmplt2, buffer2, F_STR2, "The second string"): example_unirec.c']]], + ['ur_5fset_5fvar',['ur_set_var',['../group__urtemplate.html#gadc58a81c9f7eb5a1ec3ba36d97612068',1,'ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len): unirec.c'],['../group__urtemplate.html#gadc58a81c9f7eb5a1ec3ba36d97612068',1,'ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len): unirec.c']]], + ['ur_5fset_5fvar_5flen',['ur_set_var_len',['../group__urtemplate.html#gacbb93d997a64d88206be15d99e926326',1,'unirec.h']]], + ['ur_5fset_5fvar_5foffset',['ur_set_var_offset',['../group__urtemplate.html#ga185fb29f27d79c9005e3f01a23953398',1,'unirec.h']]], + ['ur_5fsize_5fof',['ur_size_of',['../group__urtemplate.html#gaa88f0c45cc9901eabe9baabb88dc1d68',1,'unirec.h']]], + ['ur_5fstatic_5ffield_5fspecs_5ft',['ur_static_field_specs_t',['../unirec_8h.html#structur__static__field__specs__t',1,'']]], + ['ur_5ftemplate_5fcompare',['ur_template_compare',['../group__urtemplate.html#gaadde868d2fc5dd09710fddb8e629bb87',1,'ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB): unirec.c'],['../group__urtemplate.html#gaadde868d2fc5dd09710fddb8e629bb87',1,'ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB): unirec.c']]], + ['ur_5ftemplate_5fstring',['ur_template_string',['../group__urtemplate.html#ga7c3f3afcdfe5ad24f148ec9231b6e799',1,'unirec.h']]], + ['ur_5ftemplate_5fstring_5fdelimiter',['ur_template_string_delimiter',['../group__urtemplate.html#gabfbfcce0fe6729ceb692d09541336c33',1,'ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter): unirec.c'],['../group__urtemplate.html#gabfbfcce0fe6729ceb692d09541336c33',1,'ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter): unirec.c']]], + ['ur_5ftemplate_5ft',['ur_template_t',['../unirec_8h.html#structur__template__t',1,'']]], + ['ur_5ftime_2eh',['ur_time.h',['../ur__time_8h.html',1,'']]], + ['ur_5ftime_5ffrom_5fsec_5fmsec',['ur_time_from_sec_msec',['../group__urtime.html#ga8a7a7eb122f30c16d0b3c18bbf313d50',1,'ur_time.h']]], + ['ur_5ftime_5ffrom_5fsec_5fnsec',['ur_time_from_sec_nsec',['../group__urtime.html#gaf602d09ec17718d694202ce4eb05b383',1,'ur_time.h']]], + ['ur_5ftime_5ffrom_5fsec_5fusec',['ur_time_from_sec_usec',['../group__urtime.html#ga287527535da0290d720da8c4aaf21a6f',1,'ur_time.h']]], + ['ur_5ftime_5ffrom_5fstring',['ur_time_from_string',['../group__urtime.html#gac3eefb5beaa508724b2ea4f452926096',1,'ur_time_from_string(ur_time_t *ur, const char *str): unirec.c'],['../group__urtime.html#gac3eefb5beaa508724b2ea4f452926096',1,'ur_time_from_string(ur_time_t *ur, const char *str): unirec.c']]], + ['ur_5ftime_5fget_5fmsec',['ur_time_get_msec',['../group__urtime.html#ga427dae14973a034c807ed2603fee1f6e',1,'ur_time.h']]], + ['ur_5ftime_5fget_5fnsec',['ur_time_get_nsec',['../group__urtime.html#ga293e48bc100219ca246cb621abfeea7e',1,'ur_time.h']]], + ['ur_5ftime_5fget_5fsec',['ur_time_get_sec',['../group__urtime.html#ga19172b0ee74eb297f1f54bc868e50667',1,'ur_time.h']]], + ['ur_5ftime_5fget_5fusec',['ur_time_get_usec',['../group__urtime.html#ga5774265d525bcac313c6438d3425d9c7',1,'ur_time.h']]], + ['ur_5ftime_5fnsec_5fto_5ffrac',['UR_TIME_NSEC_TO_FRAC',['../group__urtime.html#gabf9c66312d957c70464b9cee3d757996',1,'ur_time.h']]], + ['ur_5ftime_5ft',['ur_time_t',['../group__urtime.html#ga9d13a2ac3696e74a33a93aa0461a3899',1,'ur_time.h']]], + ['ur_5ftimediff',['ur_timediff',['../group__urtime.html#ga2ae8aeccd3d51c898d627c5990e56640',1,'ur_time.h']]], + ['ur_5ftimediff_5fns',['ur_timediff_ns',['../group__urtime.html#gaae51ca7f8ebf8fc99e5d0fab05856e84',1,'ur_time.h']]], + ['ur_5ftimediff_5fus',['ur_timediff_us',['../group__urtime.html#gad153e75baab956f32bc8e8553e24b713',1,'ur_time.h']]], + ['ur_5ftmplt_5fdirection',['ur_tmplt_direction',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4ae',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fbi',['UR_TMPLT_DIRECTION_BI',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aead92326143d975004bacb08640930fead',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fin',['UR_TMPLT_DIRECTION_IN',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aea3c0e3d8b88bb1a4e7bbe44878ee16840',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fno',['UR_TMPLT_DIRECTION_NO',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aea9807b1695bbfc8402e79d493d37ca434',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fout',['UR_TMPLT_DIRECTION_OUT',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aeac22b0048de587bc9d53bf5f4bf3dade6',1,'unirec.h']]], + ['ur_5ftype_5fa_5fdouble',['UR_TYPE_A_DOUBLE',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0c1842f638c23e9c7a2bb0713e61c77d',1,'unirec.h']]], + ['ur_5ftype_5fa_5ffloat',['UR_TYPE_A_FLOAT',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aa5ca4aa48c327c055fe123af7e378f0d',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint16',['UR_TYPE_A_INT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a55a41f0046863f726ca928d4f1f0ff9b',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint32',['UR_TYPE_A_INT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a29ab493b2740a556d98711af608dae7b',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint64',['UR_TYPE_A_INT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0bae68cb3e9261cd3701d4e4ae6e5b95',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint8',['UR_TYPE_A_INT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a4df09d1f670ddf5d9c9dbcb673363644',1,'unirec.h']]], + ['ur_5ftype_5fa_5fip',['UR_TYPE_A_IP',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a1e45c640bb5f4ca8076a0376966dc2fb',1,'unirec.h']]], + ['ur_5ftype_5fa_5fmac',['UR_TYPE_A_MAC',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030abba7da5eebad49147205de8d9728597d',1,'unirec.h']]], + ['ur_5ftype_5fa_5ftime',['UR_TYPE_A_TIME',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad3bc3f2010aabdf48e1ecd2a37eec7f2',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint16',['UR_TYPE_A_UINT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0b5171d1d7a246b38f54432225643c88',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint32',['UR_TYPE_A_UINT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0240abefd383c0b55f967dffbca5b120',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint64',['UR_TYPE_A_UINT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aaf863c8abca426e263925a0c28f965ca',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint8',['UR_TYPE_A_UINT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a70a968786786d21a6a660a13fe3223fe',1,'unirec.h']]], + ['ur_5ftype_5fbytes',['UR_TYPE_BYTES',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030af3d7332fe3d00598405e5ce4cb70d0b3',1,'unirec.h']]], + ['ur_5ftype_5fchar',['UR_TYPE_CHAR',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a6cd2b8018fd5edf0c17780084682ef07',1,'unirec.h']]], + ['ur_5ftype_5fdouble',['UR_TYPE_DOUBLE',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a83881000b9637c4905af7a052238cb40',1,'unirec.h']]], + ['ur_5ftype_5fend_5fdir_5fbit_5ffield',['UR_TYPE_END_DIR_BIT_FIELD',['../ur__values_8h.html#adf9713757eee4d6986602fb9625a5f3b',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fdirection_5fflags',['UR_TYPE_END_DIRECTION_FLAGS',['../ur__values_8h.html#a23168199374c45571ba080f5cce464a1',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fevent_5ftype',['UR_TYPE_END_EVENT_TYPE',['../ur__values_8h.html#a3fea119e9a4825038636c666772a666b',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5falert_5ftype_5ffield',['UR_TYPE_END_HB_ALERT_TYPE_FIELD',['../ur__values_8h.html#add4532e95d569594f6ce4968e44f145e',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5fdir',['UR_TYPE_END_HB_DIR',['../ur__values_8h.html#aa1da1d7e3b05ace9c251c3206489ad4e',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5ftype',['UR_TYPE_END_HB_TYPE',['../ur__values_8h.html#ab8284cec451b02733848b3063312027c',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhttp_5fsdm_5frequest_5fmethod_5fid',['UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID',['../ur__values_8h.html#aa408e76a1aac26343e59a4e6f1584269',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fipv6_5ftun_5ftype',['UR_TYPE_END_IPV6_TUN_TYPE',['../ur__values_8h.html#ad1c988a2e7e442330e2f36f4cad96a44',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fspoof_5ftype',['UR_TYPE_END_SPOOF_TYPE',['../ur__values_8h.html#a5a89cf14233078e088044bd1ff091d46',1,'ur_values.h']]], + ['ur_5ftype_5fend_5ftcp_5fflags',['UR_TYPE_END_TCP_FLAGS',['../ur__values_8h.html#ad2ac8b707fc5f1499f6d099db6932142',1,'ur_values.h']]], + ['ur_5ftype_5fend_5ftunnel_5ftype',['UR_TYPE_END_TUNNEL_TYPE',['../ur__values_8h.html#a58351ae27edebd9145d2532c530cedc5',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fwarden_5ftype',['UR_TYPE_END_WARDEN_TYPE',['../ur__values_8h.html#a7a5dfd0a987d943819ed75ebbdc7602c',1,'ur_values.h']]], + ['ur_5ftype_5ffloat',['UR_TYPE_FLOAT',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030afb83f3adb194febb9ff35c0650592dcd',1,'unirec.h']]], + ['ur_5ftype_5fint16',['UR_TYPE_INT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a241c7cd7de2f7f29fcc55a929c277baa',1,'unirec.h']]], + ['ur_5ftype_5fint32',['UR_TYPE_INT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad8f38cf9c041be729dfcdcd6f7f0ee78',1,'unirec.h']]], + ['ur_5ftype_5fint64',['UR_TYPE_INT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aca579767cf337a5ac6c7974144eca6f7',1,'unirec.h']]], + ['ur_5ftype_5fint8',['UR_TYPE_INT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a6b28189bd4b43d8f83afb712899b5f5a',1,'unirec.h']]], + ['ur_5ftype_5fip',['UR_TYPE_IP',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a69882977753a49d1458e07f809aeb6c9',1,'unirec.h']]], + ['ur_5ftype_5fmac',['UR_TYPE_MAC',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ae3546993ce8e00ca138c5c0f9c1a04bb',1,'unirec.h']]], + ['ur_5ftype_5fstart_5fdir_5fbit_5ffield',['UR_TYPE_START_DIR_BIT_FIELD',['../ur__values_8h.html#a5955ae4b6f7abd20c42d7e01829d7342',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fdirection_5fflags',['UR_TYPE_START_DIRECTION_FLAGS',['../ur__values_8h.html#ad5d36284406ceae1190073f96c4d9356',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fevent_5ftype',['UR_TYPE_START_EVENT_TYPE',['../ur__values_8h.html#a3b49cf7fc8ef8096316ddf232d4ec9b0',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5falert_5ftype_5ffield',['UR_TYPE_START_HB_ALERT_TYPE_FIELD',['../ur__values_8h.html#a7f4652598ce94a909067bc5a66b915d2',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5fdir',['UR_TYPE_START_HB_DIR',['../ur__values_8h.html#a1448655fe0d72bfeffbf7c058b5f7df9',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5ftype',['UR_TYPE_START_HB_TYPE',['../ur__values_8h.html#a34dd652659ee19fdf65f3fe56129be0f',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhttp_5fsdm_5frequest_5fmethod_5fid',['UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID',['../ur__values_8h.html#a94eb5121ff89c7b2ade7566f2347cfda',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fipv6_5ftun_5ftype',['UR_TYPE_START_IPV6_TUN_TYPE',['../ur__values_8h.html#a8f0c2e871456dd0ab2b0ee4024da1cc5',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fspoof_5ftype',['UR_TYPE_START_SPOOF_TYPE',['../ur__values_8h.html#ae15647d2e2aedb13b47912b52cb7a772',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5ftcp_5fflags',['UR_TYPE_START_TCP_FLAGS',['../ur__values_8h.html#ad9436a94e0e58f4e15696465aade79d3',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5ftunnel_5ftype',['UR_TYPE_START_TUNNEL_TYPE',['../ur__values_8h.html#a61b3348f36d4d4aa95a3b413cf10d23d',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fwarden_5ftype',['UR_TYPE_START_WARDEN_TYPE',['../ur__values_8h.html#a6be4cdf0eac89e0df6051c6d1168b7ae',1,'ur_values.h']]], + ['ur_5ftype_5fstring',['UR_TYPE_STRING',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad004355d78cd66fc3b4ec2744bd02de2',1,'unirec.h']]], + ['ur_5ftype_5ftime',['UR_TYPE_TIME',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ac5e66194d71459394d2eff516ce2c2d1',1,'unirec.h']]], + ['ur_5ftype_5fuint16',['UR_TYPE_UINT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad974c6bd40a8908663192490be5e8bdd',1,'unirec.h']]], + ['ur_5ftype_5fuint32',['UR_TYPE_UINT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ade2ea64db377e3c5a4f3940af14a1399',1,'unirec.h']]], + ['ur_5ftype_5fuint64',['UR_TYPE_UINT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a02e71d920f238b5c0e66f3aa6e5a556b',1,'unirec.h']]], + ['ur_5ftype_5fuint8',['UR_TYPE_UINT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ac5e6afc0dcc62bf41b2f8ecaef4f2d46',1,'unirec.h']]], + ['ur_5fundefine_5ffield',['ur_undefine_field',['../group__urtemplate.html#ga3b7d40d098716943f035185d26aeff29',1,'ur_undefine_field(const char *name): unirec.c'],['../group__urtemplate.html#ga3b7d40d098716943f035185d26aeff29',1,'ur_undefine_field(const char *name): unirec.c']]], + ['ur_5fundefine_5ffield_5fby_5fid',['ur_undefine_field_by_id',['../group__urtemplate.html#ga0d8940c1aab20e50ab84da99715322fc',1,'ur_undefine_field_by_id(ur_field_id_t field_id): unirec.c'],['../group__urtemplate.html#ga0d8940c1aab20e50ab84da99715322fc',1,'ur_undefine_field_by_id(ur_field_id_t field_id): unirec.c']]], + ['ur_5fundefine_5ffields',['ur_undefine_fields',['../unirec_8h.html#a217c15792290530a3e08fa5973c8ca5a',1,'ur_field_specs_t']]], + ['ur_5funinitialized',['UR_UNINITIALIZED',['../unirec_8h.html#a09399c945b0bccbf812eac654e23ca3b',1,'unirec.h']]], + ['ur_5fvalues',['ur_values',['../ur__values_8c.html#a5ab2cb7867f37f99a594b83837e0f338',1,'ur_values.c']]], + ['ur_5fvalues_2ec',['ur_values.c',['../ur__values_8c.html',1,'']]], + ['ur_5fvalues_2eh',['ur_values.h',['../ur__values_8h.html',1,'']]], + ['ur_5fvalues_5fget_5fdescription',['ur_values_get_description',['../group__urtemplate.html#ga6fcad5741243fc75e5222294552b461d',1,'unirec.h']]], + ['ur_5fvalues_5fget_5fdescription_5fstart_5fend',['ur_values_get_description_start_end',['../group__urtemplate.html#ga2a2e25e5cdee3544c54e4abf4782dfb5',1,'ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c'],['../group__urtemplate.html#ga2a2e25e5cdee3544c54e4abf4782dfb5',1,'ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c']]], + ['ur_5fvalues_5fget_5fname',['ur_values_get_name',['../group__urtemplate.html#gae2625facded0124c7982c9fd3498c5e3',1,'unirec.h']]], + ['ur_5fvalues_5fget_5fname_5fstart_5fend',['ur_values_get_name_start_end',['../group__urtemplate.html#gadad09e518520d1791d94b29ee7af2487',1,'ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c'],['../group__urtemplate.html#gadad09e518520d1791d94b29ee7af2487',1,'ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c']]], + ['ur_5fvalues_5ft',['ur_values_t',['../ur__values_8h.html#structur__values__t',1,'']]], + ['ur_5fvar_5fchange_5fsize',['ur_var_change_size',['../unirec_8c.html#a6c1aeacaf5107408c58188e63406bcd1',1,'unirec.c']]], + ['urcsv_5ffield',['urcsv_field',['../group__unirec2csv.html#gabcdfcecd5e7d7e8ee6eb522268e012b0',1,'urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt): unirec2csv.c'],['../group__unirec2csv.html#gabcdfcecd5e7d7e8ee6eb522268e012b0',1,'urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt): unirec2csv.c']]], + ['urcsv_5ffree',['urcsv_free',['../group__unirec2csv.html#ga6fccedb3672666709144fd4d1738cbab',1,'urcsv_free(urcsv_t **urcsv): unirec2csv.c'],['../group__unirec2csv.html#ga6fccedb3672666709144fd4d1738cbab',1,'urcsv_free(urcsv_t **urcsv): unirec2csv.c']]], + ['urcsv_5fheader',['urcsv_header',['../group__unirec2csv.html#ga15f9289cc80c70398b5195eafda0530c',1,'urcsv_header(urcsv_t *urcsv): unirec2csv.c'],['../group__unirec2csv.html#ga15f9289cc80c70398b5195eafda0530c',1,'urcsv_header(urcsv_t *urcsv): unirec2csv.c']]], + ['urcsv_5finit',['urcsv_init',['../group__unirec2csv.html#gacb3ee2746f750f01c8ce61f28264fefa',1,'urcsv_init(ur_template_t *tmplt, char delimiter): unirec2csv.c'],['../group__unirec2csv.html#gacb3ee2746f750f01c8ce61f28264fefa',1,'urcsv_init(ur_template_t *tmplt, char delimiter): unirec2csv.c']]], + ['urcsv_5frecord',['urcsv_record',['../group__unirec2csv.html#ga8589709b8f1b83556596f749e34fe334',1,'urcsv_record(urcsv_t *urcsv, const void *rec): unirec2csv.c'],['../group__unirec2csv.html#ga8589709b8f1b83556596f749e34fe334',1,'urcsv_record(urcsv_t *urcsv, const void *rec): unirec2csv.c']]], + ['urcsv_5ft',['urcsv_t',['../group__unirec2csv.html#structurcsv__t',1,'']]], + ['urcsv_5fvalue',['urcsv_value',['../unirec2csv_8c.html#a98e710a5bbaab856b05f7edbfa3b1f82',1,'unirec2csv.c']]], + ['unirec_20templates_20and_20fields',['UniRec templates and fields',['../group__urtemplate.html',1,'']]] +]; diff --git a/doc/unirec/search/all_12.html b/doc/unirec/search/all_12.html new file mode 100644 index 00000000..fd265245 --- /dev/null +++ b/doc/unirec/search/all_12.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_12.js b/doc/unirec/search/all_12.js new file mode 100644 index 00000000..fb72fa0c --- /dev/null +++ b/doc/unirec/search/all_12.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['v4_5fcount',['v4_count',['../ip__prefix__search_8h.html#a9c14d5bd160b69a18925418fd5458e9d',1,'ipps_context_t']]], + ['v4_5fprefix_5fintervals',['v4_prefix_intervals',['../ip__prefix__search_8h.html#a44092bb5524e01b875ded3d3382519ef',1,'ipps_context_t']]], + ['v6_5fcount',['v6_count',['../ip__prefix__search_8h.html#a5df4b833e1a43548fc336f86e14165ec',1,'ipps_context_t']]], + ['v6_5fprefix_5fintervals',['v6_prefix_intervals',['../ip__prefix__search_8h.html#a5b7a2546ac751e45bf7124a49e3af065',1,'ipps_context_t']]], + ['value',['value',['../ur__values_8h.html#a1cd20f78c9177f52cf003183ce9faa8d',1,'ur_values_t']]], + ['version',['VERSION',['../config_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'config.h']]] +]; diff --git a/doc/unirec/search/all_13.html b/doc/unirec/search/all_13.html new file mode 100644 index 00000000..b4a8bca6 --- /dev/null +++ b/doc/unirec/search/all_13.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_13.js b/doc/unirec/search/all_13.js new file mode 100644 index 00000000..7d4f75e1 --- /dev/null +++ b/doc/unirec/search/all_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_7eipaddr_5fcpp',['~IPaddr_cpp',['../classIPaddr__cpp.html#ae4af8442dd70b4143b7acbc10baf83e0',1,'IPaddr_cpp']]] +]; diff --git a/doc/unirec/search/all_2.html b/doc/unirec/search/all_2.html new file mode 100644 index 00000000..2f17735e --- /dev/null +++ b/doc/unirec/search/all_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_2.js b/doc/unirec/search/all_2.js new file mode 100644 index 00000000..cf12f8ab --- /dev/null +++ b/doc/unirec/search/all_2.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['bit_5fendian_5fswap',['bit_endian_swap',['../ip__prefix__search_8c.html#a636e50285646afa428b8de1e1f424351',1,'ip_prefix_search.c']]], + ['buffer',['buffer',['../group__unirec2csv.html#affdffcb83cacbc414c7b1a754516ff63',1,'urcsv_t::buffer()'],['../example__unirec_8c.html#a38acb51b2a63fccbafac9c0afca0c1b9',1,'buffer(): example_unirec.c']]], + ['buffer2',['buffer2',['../example__unirec_8c.html#a344c6b17444befb2f894d0428cd3d147',1,'example_unirec.c']]], + ['buffer_5fsize',['buffer_size',['../group__unirec2csv.html#a0577c3f07444dc671a4b2de85b5f7805',1,'urcsv_t']]], + ['bytes',['bytes',['../group__uripaddr.html#abd3962df43e4446ff33e8ff98c8951d3',1,'ip_addr_t']]] +]; diff --git a/doc/unirec/search/all_3.html b/doc/unirec/search/all_3.html new file mode 100644 index 00000000..a3e6f7db --- /dev/null +++ b/doc/unirec/search/all_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_3.js b/doc/unirec/search/all_3.js new file mode 100644 index 00000000..fb0c2a00 --- /dev/null +++ b/doc/unirec/search/all_3.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['cmp_5fnet_5fv4',['cmp_net_v4',['../ip__prefix__search_8c.html#ab9fb00293a26a1779ce49dfe4bb84c45',1,'cmp_net_v4(const void *v1, const void *v2): ip_prefix_search.c'],['../ipps__internal_8h.html#ab9fb00293a26a1779ce49dfe4bb84c45',1,'cmp_net_v4(const void *v1, const void *v2): ip_prefix_search.c']]], + ['cmp_5fnet_5fv6',['cmp_net_v6',['../ip__prefix__search_8c.html#a7a0abc9eb4ad56650b71dbc3cf06c664',1,'cmp_net_v6(const void *v1, const void *v2): ip_prefix_search.c'],['../ipps__internal_8h.html#a7a0abc9eb4ad56650b71dbc3cf06c664',1,'cmp_net_v6(const void *v1, const void *v2): ip_prefix_search.c']]], + ['collectorslots',['COLLECTORSLOTS',['../ip__prefix__search_8h.html#a6ce90aefb31e61070f25d25b89b5c928',1,'ip_prefix_search.h']]], + ['compare_5ffields',['compare_fields',['../group__urtemplate.html#gaf893df4c0a8d17cae3f8999e9bcce312',1,'compare_fields(const void *field1, const void *field2): unirec.c'],['../group__urtemplate.html#gaf893df4c0a8d17cae3f8999e9bcce312',1,'compare_fields(const void *field1, const void *field2): unirec.c']]], + ['config_2eh',['config.h',['../config_8h.html',1,'']]], + ['copy_5fall_5fdata',['copy_all_data',['../ip__prefix__search_8c.html#aaf3b029f323c47d9cd423ec682fd236c',1,'copy_all_data(ipps_interval_t *dest, ipps_interval_t *src): ip_prefix_search.c'],['../ipps__internal_8h.html#aaf3b029f323c47d9cd423ec682fd236c',1,'copy_all_data(ipps_interval_t *dest, ipps_interval_t *src): ip_prefix_search.c']]], + ['count',['count',['../unirec_8h.html#a3331d5fc7eeda55fbbb33543da5db0d9',1,'ur_template_t']]], + ['create_5fip_5fv6_5fnet_5fmask_5farray',['create_ip_v6_net_mask_array',['../ip__prefix__search_8c.html#ad0ef62cbddcc87741ceb82ee551a6071',1,'create_ip_v6_net_mask_array(): ip_prefix_search.c'],['../ipps__internal_8h.html#a6c63e0f0cfb556a21bf8f72c339514e1',1,'create_ip_v6_net_mask_array(void): ip_prefix_search.c']]], + ['curpos',['curpos',['../group__unirec2csv.html#af20abdad0be1405f8186d6d18915416b',1,'urcsv_t']]], + ['csv_20representation',['CSV representation',['../group__unirec2csv.html',1,'']]] +]; diff --git a/doc/unirec/search/all_4.html b/doc/unirec/search/all_4.html new file mode 100644 index 00000000..6452295d --- /dev/null +++ b/doc/unirec/search/all_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_4.js b/doc/unirec/search/all_4.js new file mode 100644 index 00000000..a14367c4 --- /dev/null +++ b/doc/unirec/search/all_4.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['data',['data',['../ip__prefix__search_8h.html#a7f8128509b76517a88db446dd1bcb3f6',1,'ipps_network_t']]], + ['data_5farray',['data_array',['../ip__prefix__search_8h.html#aeb0b22258e55f7d45d4a07fbc30764c6',1,'ipps_interval_t']]], + ['data_5fcnt',['data_cnt',['../ip__prefix__search_8h.html#a69705a7d1c605fa29a0e6d305183ebd5',1,'ipps_interval_t']]], + ['data_5flen',['data_len',['../ip__prefix__search_8h.html#a9308e7d33d03176329e1042737edcd8f',1,'ipps_network_t']]], + ['dataslots',['DATASLOTS',['../ip__prefix__search_8h.html#a8f2be007f687fb542db09afe84207d65',1,'ip_prefix_search.h']]], + ['delimiter',['delimiter',['../group__unirec2csv.html#a4e10948588efc4d08f4c7621f2481f9f',1,'urcsv_t']]], + ['description',['description',['../ur__values_8h.html#a82a1958b9adfed06531d08ddd1d94951',1,'ur_values_t']]], + ['destroy_5fip_5fv6_5fnet_5fmask_5farray',['destroy_ip_v6_net_mask_array',['../ip__prefix__search_8c.html#a55368584ae361d0b49b5753540471e81',1,'destroy_ip_v6_net_mask_array(uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#a55368584ae361d0b49b5753540471e81',1,'destroy_ip_v6_net_mask_array(uint32_t **net_mask_array): ip_prefix_search.c']]], + ['destroy_5flist',['destroy_list',['../ip__prefix__search_8c.html#a955c75360f590649ac87c24fe87a74dd',1,'destroy_list(ipps_interval_node_t *interval_list): ip_prefix_search.c'],['../ipps__internal_8h.html#a955c75360f590649ac87c24fe87a74dd',1,'destroy_list(ipps_interval_node_t *interval_list): ip_prefix_search.c']]], + ['direction',['direction',['../unirec_8h.html#a099d176cd55c8e16d01a3e9eb6f8c6d4',1,'ur_template_t']]] +]; diff --git a/doc/unirec/search/all_5.html b/doc/unirec/search/all_5.html new file mode 100644 index 00000000..e59e1d53 --- /dev/null +++ b/doc/unirec/search/all_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_5.js b/doc/unirec/search/all_5.js new file mode 100644 index 00000000..a9245cdb --- /dev/null +++ b/doc/unirec/search/all_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['example_5funirec_2ec',['example_unirec.c',['../example__unirec_8c.html',1,'']]] +]; diff --git a/doc/unirec/search/all_6.html b/doc/unirec/search/all_6.html new file mode 100644 index 00000000..f75a754e --- /dev/null +++ b/doc/unirec/search/all_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_6.js b/doc/unirec/search/all_6.js new file mode 100644 index 00000000..b2a7038a --- /dev/null +++ b/doc/unirec/search/all_6.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['field_5fspec_5ft',['field_spec_t',['../unirec_8h.html#structfield__spec__t',1,'']]], + ['fill_5finterval_5fby_5fnetwork',['fill_interval_by_network',['../ip__prefix__search_8c.html#ab60e5f425bab960a725ad058c77cc1c0',1,'fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#ab60e5f425bab960a725ad058c77cc1c0',1,'fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['first_5fdynamic',['first_dynamic',['../unirec_8h.html#a3ff58f0882adb970deec7c6f7faa7f7c',1,'ur_template_t']]], + ['free',['free',['../example__unirec_8c.html#a898b07decc0a177549f9d553ac416305',1,'free(rec): example_unirec.c'],['../example__unirec_8c.html#a6b20b2a7a795cdf91c302c878ef96d38',1,'free(buffer): example_unirec.c'],['../example__unirec_8c.html#abaeaa1b48eaffb3552d3dc783ab366c1',1,'free(buffer2): example_unirec.c']]], + ['free_5fdata',['free_data',['../ip__prefix__search_8c.html#a6b062bf9730a752b166cb1501c660f7a',1,'free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt): ip_prefix_search.c'],['../ipps__internal_8h.html#a6b062bf9730a752b166cb1501c660f7a',1,'free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt): ip_prefix_search.c']]], + ['free_5fspace',['free_space',['../group__unirec2csv.html#a3ba96d1ed5c6671a6bfc257a0fbedd73',1,'urcsv_t']]] +]; diff --git a/doc/unirec/search/all_7.html b/doc/unirec/search/all_7.html new file mode 100644 index 00000000..88acd946 --- /dev/null +++ b/doc/unirec/search/all_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_7.js b/doc/unirec/search/all_7.js new file mode 100644 index 00000000..0110c5e7 --- /dev/null +++ b/doc/unirec/search/all_7.js @@ -0,0 +1,26 @@ +var searchData= +[ + ['have_5f_5fbool',['HAVE__BOOL',['../config_8h.html#a862ffdbac7ac8323712310a418b7d9a3',1,'config.h']]], + ['have_5falarm',['HAVE_ALARM',['../config_8h.html#a777e1baef81548a6bd84c0da28443435',1,'config.h']]], + ['have_5farpa_5finet_5fh',['HAVE_ARPA_INET_H',['../config_8h.html#a7d1a71461e07569d0c9003da24c30a59',1,'config.h']]], + ['have_5fdlfcn_5fh',['HAVE_DLFCN_H',['../config_8h.html#a0ee1617ff2f6885ef384a3dd46f9b9d7',1,'config.h']]], + ['have_5finttypes_5fh',['HAVE_INTTYPES_H',['../config_8h.html#ab90a030ff2790ebdc176660a6dd2a478',1,'config.h']]], + ['have_5fmalloc',['HAVE_MALLOC',['../config_8h.html#a14503280ca0cb757db915eea09282bfc',1,'config.h']]], + ['have_5fmemmove',['HAVE_MEMMOVE',['../config_8h.html#a7b300f836d3d79d0d9b0039a6b842ded',1,'config.h']]], + ['have_5fmemory_5fh',['HAVE_MEMORY_H',['../config_8h.html#ae93a78f9d076138897af441c9f86f285',1,'config.h']]], + ['have_5fmemset',['HAVE_MEMSET',['../config_8h.html#a3df52e9809253860c385be6f3a160607',1,'config.h']]], + ['have_5frealloc',['HAVE_REALLOC',['../config_8h.html#a0302094a0ee567c610a36c63104ebda5',1,'config.h']]], + ['have_5fstdbool_5fh',['HAVE_STDBOOL_H',['../config_8h.html#a8c3fa1b2f1be8c6f6929548c548cf50a',1,'config.h']]], + ['have_5fstdint_5fh',['HAVE_STDINT_H',['../config_8h.html#ab6cd6d1c63c1e26ea2d4537b77148354',1,'config.h']]], + ['have_5fstdlib_5fh',['HAVE_STDLIB_H',['../config_8h.html#a9e0e434ec1a6ddbd97db12b5a32905e0',1,'config.h']]], + ['have_5fstrchr',['HAVE_STRCHR',['../config_8h.html#a37eb0020e42f0ebb6cba24c2888cc48b',1,'config.h']]], + ['have_5fstring_5fh',['HAVE_STRING_H',['../config_8h.html#ad4c234dd1625255dc626a15886306e7d',1,'config.h']]], + ['have_5fstrings_5fh',['HAVE_STRINGS_H',['../config_8h.html#a405d10d46190bcb0320524c54eafc850',1,'config.h']]], + ['have_5fsys_5fsocket_5fh',['HAVE_SYS_SOCKET_H',['../config_8h.html#afb96c2bc08ebf33cca68c714f624a58d',1,'config.h']]], + ['have_5fsys_5fstat_5fh',['HAVE_SYS_STAT_H',['../config_8h.html#ace156430ba007d19b4348a950d0c692b',1,'config.h']]], + ['have_5fsys_5ftime_5fh',['HAVE_SYS_TIME_H',['../config_8h.html#a2aae46056558e9d6fef6380f9678ffe3',1,'config.h']]], + ['have_5fsys_5ftypes_5fh',['HAVE_SYS_TYPES_H',['../config_8h.html#a69dc70bea5d1f8bd2be9740e974fa666',1,'config.h']]], + ['have_5funistd_5fh',['HAVE_UNISTD_H',['../config_8h.html#a219b06937831d0da94d801ab13987639',1,'config.h']]], + ['high_5fip',['high_ip',['../ip__prefix__search_8h.html#a3bfe6c237387f3757609230c3593b813',1,'ipps_interval_t']]], + ['helpers_20for_20libtrap',['Helpers for libtrap',['../group__libtraphelpers.html',1,'']]] +]; diff --git a/doc/unirec/search/all_8.html b/doc/unirec/search/all_8.html new file mode 100644 index 00000000..b74d5fd8 --- /dev/null +++ b/doc/unirec/search/all_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_8.js b/doc/unirec/search/all_8.js new file mode 100644 index 00000000..fedd5892 --- /dev/null +++ b/doc/unirec/search/all_8.js @@ -0,0 +1,46 @@ +var searchData= +[ + ['id',['id',['../unirec_8h.html#aac5a570f858914e91700d1d69f8fdace',1,'ur_field_id_linked_list_s::id()'],['../unirec_8h.html#a7d8bca7d65ccb7dfeaad247f43100789',1,'field_spec_t::id()']]], + ['ids',['ids',['../unirec_8h.html#acf8005fa9976d0fbe61c40aefeea199c',1,'ur_template_t']]], + ['if',['if',['../example__unirec_8c.html#afed200b0ec3ad3a8783e01d8eea873ee',1,'example_unirec.c']]], + ['ifc_5fout',['ifc_out',['../unirec_8h.html#a547b0de3d97d62b5415ebcc371e87a19',1,'ur_template_t']]], + ['index_2etxt',['index.txt',['../index_8txt.html',1,'']]], + ['init_5fcontext',['init_context',['../ip__prefix__search_8c.html#a37a9905881da7bd6abc14df2535553c6',1,'init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#a37a9905881da7bd6abc14df2535553c6',1,'init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['inline',['INLINE',['../inline_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116',1,'inline.h']]], + ['inline_2eh',['inline.h',['../inline_8h.html',1,'']]], + ['inline_5fimpl',['INLINE_IMPL',['../inline_8h.html#a7dfafbc306b738bfc7977fa6e24f5bbf',1,'inline.h']]], + ['insert_5fnew_5finterval',['insert_new_interval',['../ip__prefix__search_8c.html#a746826e7686e2c869208adbdf9b44e8f',1,'insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c'],['../ipps__internal_8h.html#a746826e7686e2c869208adbdf9b44e8f',1,'insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c']]], + ['interval',['interval',['../ipps__internal_8h.html#a5ade3c87f5b143b1a499ec073122abe8',1,'ipps_interval_node_t']]], + ['intialized',['intialized',['../unirec_8h.html#a2049527f65320075c1e5e3bb9c9aff15',1,'ur_field_specs_t']]], + ['intro_2emd',['intro.md',['../intro_8md.html',1,'']]], + ['ip_5faddr_5ft',['ip_addr_t',['../group__uripaddr.html#unionip__addr__t',1,'']]], + ['ip_5fcmp',['ip_cmp',['../group__uripaddr.html#ga6b852d36a8e8b8932058fba40570a24a',1,'ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2): ipaddr.h'],['../group__uripaddr.html#ga6b852d36a8e8b8932058fba40570a24a',1,'ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2): ipaddr.h']]], + ['ip_5fdec',['ip_dec',['../ip__prefix__search_8c.html#a9ff06c46077dabe3c896df26333a4e5a',1,'ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec): ip_prefix_search.c'],['../ipps__internal_8h.html#a9ff06c46077dabe3c896df26333a4e5a',1,'ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec): ip_prefix_search.c']]], + ['ip_5ffrom_5f16_5fbytes_5fbe',['ip_from_16_bytes_be',['../group__uripaddr.html#ga61daf049c5a24cd2a331d916694a4fef',1,'ip_from_16_bytes_be(char b[16]): ipaddr.h'],['../group__uripaddr.html#ga61daf049c5a24cd2a331d916694a4fef',1,'ip_from_16_bytes_be(char b[16]): ipaddr.h']]], + ['ip_5ffrom_5f16_5fbytes_5fle',['ip_from_16_bytes_le',['../group__uripaddr.html#ga35a767afac198cabbbb7cf5ea70c9e33',1,'ip_from_16_bytes_le(char b[16]): ipaddr.h'],['../group__uripaddr.html#ga35a767afac198cabbbb7cf5ea70c9e33',1,'ip_from_16_bytes_le(char b[16]): ipaddr.h']]], + ['ip_5ffrom_5f4_5fbytes_5fbe',['ip_from_4_bytes_be',['../group__uripaddr.html#ga2c694d465f540e700d91a655f6d47ebd',1,'ip_from_4_bytes_be(char b[4]): ipaddr.h'],['../group__uripaddr.html#ga2c694d465f540e700d91a655f6d47ebd',1,'ip_from_4_bytes_be(char b[4]): ipaddr.h']]], + ['ip_5ffrom_5f4_5fbytes_5fle',['ip_from_4_bytes_le',['../group__uripaddr.html#ga34b4da3670a99958f7038c90da2b7152',1,'ip_from_4_bytes_le(char b[4]): ipaddr.h'],['../group__uripaddr.html#ga34b4da3670a99958f7038c90da2b7152',1,'ip_from_4_bytes_le(char b[4]): ipaddr.h']]], + ['ip_5ffrom_5fint',['ip_from_int',['../group__uripaddr.html#gad57ac58e8823c5197445e9035843a417',1,'ip_from_int(uint32_t i): ipaddr.h'],['../group__uripaddr.html#gad57ac58e8823c5197445e9035843a417',1,'ip_from_int(uint32_t i): ipaddr.h']]], + ['ip_5ffrom_5fstr',['ip_from_str',['../group__uripaddr.html#gae01409ca18c16d2b28292ff94802b51b',1,'ip_from_str(const char *str, ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gae01409ca18c16d2b28292ff94802b51b',1,'ip_from_str(const char *str, ip_addr_t *addr): ipaddr.h']]], + ['ip_5fget_5fv4_5fas_5fbytes',['ip_get_v4_as_bytes',['../group__uripaddr.html#gac2c790297e16730292696c44306dd1a6',1,'ip_get_v4_as_bytes(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gac2c790297e16730292696c44306dd1a6',1,'ip_get_v4_as_bytes(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fget_5fv4_5fas_5fint',['ip_get_v4_as_int',['../group__uripaddr.html#gae6ab3a77cab8533289729b25c9438689',1,'ip_get_v4_as_int(ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gae6ab3a77cab8533289729b25c9438689',1,'ip_get_v4_as_int(ip_addr_t *addr): ipaddr.h']]], + ['ip_5finc',['ip_inc',['../ip__prefix__search_8c.html#a4b87bac7d680ace8e244d951e2d643f3',1,'ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc): ip_prefix_search.c'],['../ipps__internal_8h.html#a4b87bac7d680ace8e244d951e2d643f3',1,'ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc): ip_prefix_search.c']]], + ['ip_5fis4',['ip_is4',['../group__uripaddr.html#gabf382d0ceec2ca2d62cb94ecf000ecd4',1,'ip_is4(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gabf382d0ceec2ca2d62cb94ecf000ecd4',1,'ip_is4(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fis6',['ip_is6',['../group__uripaddr.html#gaeaa8f3d94315e53ebf8c43c7dde8f6cb',1,'ip_is6(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gaeaa8f3d94315e53ebf8c43c7dde8f6cb',1,'ip_is6(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fis_5fnull',['ip_is_null',['../group__uripaddr.html#ga43a7b7ceb95df7a142c5da17fa778cd0',1,'ipaddr.h']]], + ['ip_5fprefix_5fsearch_2ec',['ip_prefix_search.c',['../ip__prefix__search_8c.html',1,'']]], + ['ip_5fprefix_5fsearch_2eh',['ip_prefix_search.h',['../ip__prefix__search_8h.html',1,'']]], + ['ip_5fto_5fstr',['ip_to_str',['../group__uripaddr.html#ga4aa063dc904a602c2ee1f46bf50315e7',1,'ip_to_str(const ip_addr_t *addr, char *str): ipaddr.h'],['../group__uripaddr.html#ga4aa063dc904a602c2ee1f46bf50315e7',1,'ip_to_str(const ip_addr_t *addr, char *str): ipaddr.h']]], + ['ipaddr_2eh',['ipaddr.h',['../ipaddr_8h.html',1,'']]], + ['ipps_5fcontext_5ft',['ipps_context_t',['../ip__prefix__search_8h.html#structipps__context__t',1,'']]], + ['ipps_5fdestroy',['ipps_destroy',['../ip__prefix__search_8c.html#a03c39a2163d96fe9694ae39255f17e3e',1,'ipps_destroy(ipps_context_t *prefix_context): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a03c39a2163d96fe9694ae39255f17e3e',1,'ipps_destroy(ipps_context_t *prefix_context): ip_prefix_search.c']]], + ['ipps_5finit',['ipps_init',['../ip__prefix__search_8c.html#af6d245a01b1d56b1969ff5b05ef9c8db',1,'ipps_init(ipps_network_list_t *network_list): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a9adf0fc051a365b28576bed806e748f4',1,'ipps_init(ipps_network_list_t *networks): ip_prefix_search.c']]], + ['ipps_5finternal_2eh',['ipps_internal.h',['../ipps__internal_8h.html',1,'']]], + ['ipps_5finterval_5fnode_5ft',['ipps_interval_node_t',['../ipps__internal_8h.html#structipps__interval__node__t',1,'']]], + ['ipps_5finterval_5ft',['ipps_interval_t',['../ip__prefix__search_8h.html#structipps__interval__t',1,'']]], + ['ipps_5fnetwork_5flist_5ft',['ipps_network_list_t',['../ip__prefix__search_8h.html#structipps__network__list__t',1,'']]], + ['ipps_5fnetwork_5ft',['ipps_network_t',['../ip__prefix__search_8h.html#structipps__network__t',1,'']]], + ['ipps_5fsearch',['ipps_search',['../ip__prefix__search_8c.html#a8565d4f3b5945285e6318356fbb69477',1,'ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a8565d4f3b5945285e6318356fbb69477',1,'ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data): ip_prefix_search.c']]], + ['ip_20prefix_20binary_20search',['IP prefix binary search',['../md_README-ip_prefix_search.html',1,'']]], + ['ip_20addresses_20api',['IP addresses API',['../group__uripaddr.html',1,'']]] +]; diff --git a/doc/unirec/search/all_9.html b/doc/unirec/search/all_9.html new file mode 100644 index 00000000..95e88dd2 --- /dev/null +++ b/doc/unirec/search/all_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_9.js b/doc/unirec/search/all_9.js new file mode 100644 index 00000000..b7cb2047 --- /dev/null +++ b/doc/unirec/search/all_9.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['link_5fcount',['link_count',['../group__urlinks.html#a4c9bf894635e57dbd1101cdd4210b4d1',1,'ur_links_t']]], + ['link_5findexes',['link_indexes',['../group__urlinks.html#a6d882bfc96e7c43de4e9dcc0f6e9f628',1,'ur_links_t']]], + ['link_5fmask',['link_mask',['../group__urlinks.html#abf9e1b6345f9757c679df5633313ee75',1,'ur_links_t']]], + ['links_2eh',['links.h',['../links_8h.html',1,'']]], + ['low_5fip',['low_ip',['../ip__prefix__search_8h.html#ad587d90b3aa4f17c210564d3366aba02',1,'ipps_interval_t']]], + ['lt_5fobjdir',['LT_OBJDIR',['../config_8h.html#ac2d5925d76379847dd9fc4747b061659',1,'config.h']]], + ['links_20api',['Links API',['../group__urlinks.html',1,'']]] +]; diff --git a/doc/unirec/search/all_a.html b/doc/unirec/search/all_a.html new file mode 100644 index 00000000..3148a8e5 --- /dev/null +++ b/doc/unirec/search/all_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_a.js b/doc/unirec/search/all_a.js new file mode 100644 index 00000000..21567e96 --- /dev/null +++ b/doc/unirec/search/all_a.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['mac_5fadd_5fformat_5fpri',['MAC_ADD_FORMAT_PRI',['../macaddr_8h.html#a99418c30c5572f728f2c9765f8f1a810',1,'macaddr.h']]], + ['mac_5fadd_5fformat_5fscn',['MAC_ADD_FORMAT_SCN',['../macaddr_8h.html#a9d95aa03c8fa958373947e95cda10132',1,'macaddr.h']]], + ['mac_5faddr_5ft',['mac_addr_t',['../macaddr_8h.html#a5cb542bc605d9e6641afdd9dd6a6314e',1,'macaddr.h']]], + ['mac_5fcmp',['mac_cmp',['../macaddr_8h.html#a7b9c47ab25ee243ad50551b0fd07d08f',1,'mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2): macaddr.h'],['../unirec_8c.html#a36505bbf562889210af7a858dc891fa5',1,'mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2): macaddr.h']]], + ['mac_5ffrom_5fbytes',['mac_from_bytes',['../macaddr_8h.html#a4ce39d5c8d045217044e101a8abb82aa',1,'mac_from_bytes(uint8_t *array): macaddr.h'],['../unirec_8c.html#a167db66d59cbead9f8f83e6c538e0737',1,'mac_from_bytes(uint8_t *array): macaddr.h']]], + ['mac_5ffrom_5fstr',['mac_from_str',['../macaddr_8h.html#a14bfaa27ab4c93f33fec11f76c652d63',1,'mac_from_str(const char *str, mac_addr_t *addr): macaddr.h'],['../unirec_8c.html#a7b3f651fa0b6a4eac840c6c2233c4460',1,'mac_from_str(const char *str, mac_addr_t *addr): macaddr.h']]], + ['mac_5fstr_5flen',['MAC_STR_LEN',['../macaddr_8h.html#a60867f758ccbfd1d74983d5fc87bf99a',1,'macaddr.h']]], + ['mac_5fto_5fbytes',['mac_to_bytes',['../macaddr_8h.html#a7c15ef96c0c46c6e1eef3c2b1cb40c16',1,'mac_to_bytes(const mac_addr_t *addr, uint8_t *array): macaddr.h'],['../unirec_8c.html#a355872267716d5fae37d42eadf4d90d3',1,'mac_to_bytes(const mac_addr_t *addr, uint8_t *array): macaddr.h']]], + ['mac_5fto_5fstr',['mac_to_str',['../macaddr_8h.html#aa890d45520bbabc0f9a6247d092f323b',1,'mac_to_str(const mac_addr_t *addr, char *str): macaddr.h'],['../unirec_8c.html#a295b3ad0387685d62fab829eb2c5c5cb',1,'mac_to_str(const mac_addr_t *addr, char *str): macaddr.h']]], + ['macaddr_2eh',['macaddr.h',['../macaddr_8h.html',1,'']]], + ['mask',['mask',['../ip__prefix__search_8h.html#ae3ae852da1c3c9a0ef2e595ab9109735',1,'ipps_network_t']]], + ['mask_5fipv6',['mask_ipv6',['../ip__prefix__search_8c.html#add2c6d5383885cbd3e7ce4a9fd5acb67',1,'mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#add2c6d5383885cbd3e7ce4a9fd5acb67',1,'mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['max_5flink_5fcount',['MAX_LINK_COUNT',['../group__urlinks.html#gabd556824006b81cd58ddb67907d86ca8',1,'links.h']]], + ['memcpy',['memcpy',['../example__unirec_8c.html#a48d17eb4cf188b1138d1d0836e3e8cd8',1,'example_unirec.c']]] +]; diff --git a/doc/unirec/search/all_b.html b/doc/unirec/search/all_b.html new file mode 100644 index 00000000..f2a3c8d0 --- /dev/null +++ b/doc/unirec/search/all_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_b.js b/doc/unirec/search/all_b.js new file mode 100644 index 00000000..b2bb1d3a --- /dev/null +++ b/doc/unirec/search/all_b.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['name',['name',['../unirec_8h.html#a3b5886d926b0a4ae0959eaf4aba18201',1,'field_spec_t::name()'],['../ur__values_8h.html#a16d9f01f7fa1c2fcee79c4b7d04eecb0',1,'ur_values_t::name()']]], + ['net_5fcount',['net_count',['../ip__prefix__search_8h.html#aaeb26d8764f865e37ec6836b2982f8f4',1,'ipps_network_list_t']]], + ['networks',['networks',['../ip__prefix__search_8h.html#ac85d78674943d10b2f4429244165498c',1,'ipps_network_list_t']]], + ['networkslots',['NETWORKSLOTS',['../ip__prefix__search_8h.html#ab14a1d9e2dd472d1580b2e0dd5903fd2',1,'ip_prefix_search.h']]], + ['new_5fcontext',['new_context',['../ip__prefix__search_8c.html#a12597c99cee9d48dc7e104e6fe23dd91',1,'new_context(): ip_prefix_search.c'],['../ipps__internal_8h.html#a7f4303c276b23497ff35fa5e1a80ef7b',1,'new_context(void): ip_prefix_search.c']]], + ['new_5fid',['new_id',['../example__unirec_8c.html#a14c622b14dcd4a0b0db6cd5cdd948cee',1,'example_unirec.c']]], + ['new_5finterval',['new_interval',['../ip__prefix__search_8c.html#ad4f65683e77379a91b1d7822d73305c2',1,'new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c'],['../ipps__internal_8h.html#ad4f65683e77379a91b1d7822d73305c2',1,'new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c']]], + ['next',['next',['../ipps__internal_8h.html#aeff18751a64927832d26c854406717cb',1,'ipps_interval_node_t::next()'],['../unirec_8h.html#a0ee1b233f020b9f8bd5236fceb501cb9',1,'ur_field_id_linked_list_s::next()']]] +]; diff --git a/doc/unirec/search/all_c.html b/doc/unirec/search/all_c.html new file mode 100644 index 00000000..63768107 --- /dev/null +++ b/doc/unirec/search/all_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_c.js b/doc/unirec/search/all_c.js new file mode 100644 index 00000000..3fa504bd --- /dev/null +++ b/doc/unirec/search/all_c.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['offset',['offset',['../unirec_8h.html#a4aedfaa872d40f452909dc395a0fbc4a',1,'ur_template_t']]], + ['offset_5fsize',['offset_size',['../unirec_8h.html#ae3458bcec0d7af5a00cfdb528f4f36b7',1,'ur_template_t']]] +]; diff --git a/doc/unirec/search/all_d.html b/doc/unirec/search/all_d.html new file mode 100644 index 00000000..cc52c79f --- /dev/null +++ b/doc/unirec/search/all_d.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_d.js b/doc/unirec/search/all_d.js new file mode 100644 index 00000000..0ef85e3a --- /dev/null +++ b/doc/unirec/search/all_d.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['package',['PACKAGE',['../config_8h.html#aca8570fb706c81df371b7f9bc454ae03',1,'config.h']]], + ['package_5fbugreport',['PACKAGE_BUGREPORT',['../config_8h.html#a1d1d2d7f8d2f95b376954d649ab03233',1,'config.h']]], + ['package_5fname',['PACKAGE_NAME',['../config_8h.html#a1c0439e4355794c09b64274849eb0279',1,'config.h']]], + ['package_5fstring',['PACKAGE_STRING',['../config_8h.html#ac73e6f903c16eca7710f92e36e1c6fbf',1,'config.h']]], + ['package_5ftarname',['PACKAGE_TARNAME',['../config_8h.html#af415af6bfede0e8d5453708afe68651c',1,'config.h']]], + ['package_5furl',['PACKAGE_URL',['../config_8h.html#a5c93853116d5a50307b6744f147840aa',1,'config.h']]], + ['package_5fversion',['PACKAGE_VERSION',['../config_8h.html#aa326a05d5e30f9e9a4bb0b4469d5d0c0',1,'config.h']]], + ['printf',['printf',['../example__unirec_8c.html#a31c673502d2deeb8064d17eeab267f87',1,'printf("%u %u %u %s\, ur_get(tmplt, buffer, F_FOO), ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), ur_get_var_len(tmplt, buffer, F_STR1), ur_get_ptr(tmplt, buffer, F_STR1)): example_unirec.c'],['../example__unirec_8c.html#a3611124c0bc459a33ea819c7dbc4a339',1,'printf(" new field %d\, new_id): example_unirec.c'],['../example__unirec_8c.html#a6740088f3eb98704a218ab6f951c5eb4',1,'printf("%u %u %s %u %s %u\, ur_get(tmplt, buffer2, F_BAR), ur_get_var_len(tmplt, buffer2, F_STR1), ur_get_ptr(tmplt, buffer2, F_STR1), ur_get_var_len(tmplt, buffer2, F_STR2), ur_get_ptr(tmplt, buffer2, F_STR2), *(uint16_t *) ur_get_ptr_by_id(tmplt, buffer2, new_id)): example_unirec.c']]], + ['prix8',['PRIx8',['../macaddr_8h.html#adac1acc1d24060aeee7791a99d1a3a8c',1,'macaddr.h']]] +]; diff --git a/doc/unirec/search/all_e.html b/doc/unirec/search/all_e.html new file mode 100644 index 00000000..85b39bd4 --- /dev/null +++ b/doc/unirec/search/all_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_e.js b/doc/unirec/search/all_e.js new file mode 100644 index 00000000..209f4e35 --- /dev/null +++ b/doc/unirec/search/all_e.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['readme_2dip_5fprefix_5fsearch_2emd',['README-ip_prefix_search.md',['../README-ip__prefix__search_8md.html',1,'']]], + ['readme_2emd',['README.md',['../README_8md.html',1,'']]], + ['rec',['rec',['../example__unirec_8c.html#ac37164e80df5f86d98247768effab54d',1,'example_unirec.c']]], + ['return',['return',['../example__unirec_8c.html#a9717e7bbecb906637e86cef6da3d83c2',1,'example_unirec.c']]] +]; diff --git a/doc/unirec/search/all_f.html b/doc/unirec/search/all_f.html new file mode 100644 index 00000000..89fa15a6 --- /dev/null +++ b/doc/unirec/search/all_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/all_f.js b/doc/unirec/search/all_f.js new file mode 100644 index 00000000..c3bc7e83 --- /dev/null +++ b/doc/unirec/search/all_f.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['scnx8',['SCNx8',['../macaddr_8h.html#a79b1f201c12273510e1fdebfb3a66e9d',1,'macaddr.h']]], + ['size',['size',['../unirec_8h.html#a20d9d5eb643e04cdb13a84195993ef92',1,'field_spec_t']]], + ['static_5fsize',['static_size',['../unirec_8h.html#a5ec4e8fb6f0bacae7cda7af77f8ef1e2',1,'ur_template_t']]], + ['stdc_5fheaders',['STDC_HEADERS',['../config_8h.html#a550e5c272cc3cf3814651721167dcd23',1,'config.h']]] +]; diff --git a/doc/unirec/search/classes_0.html b/doc/unirec/search/classes_0.html new file mode 100644 index 00000000..e935fdf7 --- /dev/null +++ b/doc/unirec/search/classes_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/classes_0.js b/doc/unirec/search/classes_0.js new file mode 100644 index 00000000..101b2753 --- /dev/null +++ b/doc/unirec/search/classes_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['field_5fspec_5ft',['field_spec_t',['../unirec_8h.html#structfield__spec__t',1,'']]] +]; diff --git a/doc/unirec/search/classes_1.html b/doc/unirec/search/classes_1.html new file mode 100644 index 00000000..3df6e80a --- /dev/null +++ b/doc/unirec/search/classes_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/classes_1.js b/doc/unirec/search/classes_1.js new file mode 100644 index 00000000..6baf667c --- /dev/null +++ b/doc/unirec/search/classes_1.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['ip_5faddr_5ft',['ip_addr_t',['../group__uripaddr.html#unionip__addr__t',1,'']]], + ['ipps_5fcontext_5ft',['ipps_context_t',['../ip__prefix__search_8h.html#structipps__context__t',1,'']]], + ['ipps_5finterval_5fnode_5ft',['ipps_interval_node_t',['../ipps__internal_8h.html#structipps__interval__node__t',1,'']]], + ['ipps_5finterval_5ft',['ipps_interval_t',['../ip__prefix__search_8h.html#structipps__interval__t',1,'']]], + ['ipps_5fnetwork_5flist_5ft',['ipps_network_list_t',['../ip__prefix__search_8h.html#structipps__network__list__t',1,'']]], + ['ipps_5fnetwork_5ft',['ipps_network_t',['../ip__prefix__search_8h.html#structipps__network__t',1,'']]] +]; diff --git a/doc/unirec/search/classes_2.html b/doc/unirec/search/classes_2.html new file mode 100644 index 00000000..028694ff --- /dev/null +++ b/doc/unirec/search/classes_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/classes_2.js b/doc/unirec/search/classes_2.js new file mode 100644 index 00000000..7896d2ed --- /dev/null +++ b/doc/unirec/search/classes_2.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['ur_5ffield_5fid_5flinked_5flist_5fs',['ur_field_id_linked_list_s',['../unirec_8h.html#structur__field__id__linked__list__s',1,'']]], + ['ur_5ffield_5fspecs_5ft',['ur_field_specs_t',['../unirec_8h.html#structur__field__specs__t',1,'']]], + ['ur_5flinks_5ft',['ur_links_t',['../group__urlinks.html#structur__links__t',1,'']]], + ['ur_5fstatic_5ffield_5fspecs_5ft',['ur_static_field_specs_t',['../unirec_8h.html#structur__static__field__specs__t',1,'']]], + ['ur_5ftemplate_5ft',['ur_template_t',['../unirec_8h.html#structur__template__t',1,'']]], + ['ur_5fvalues_5ft',['ur_values_t',['../ur__values_8h.html#structur__values__t',1,'']]], + ['urcsv_5ft',['urcsv_t',['../group__unirec2csv.html#structurcsv__t',1,'']]] +]; diff --git a/doc/unirec/search/close.png b/doc/unirec/search/close.png new file mode 100644 index 00000000..9342d3df Binary files /dev/null and b/doc/unirec/search/close.png differ diff --git a/doc/unirec/search/defines_0.html b/doc/unirec/search/defines_0.html new file mode 100644 index 00000000..3bffafa9 --- /dev/null +++ b/doc/unirec/search/defines_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_0.js b/doc/unirec/search/defines_0.js new file mode 100644 index 00000000..9e893187 --- /dev/null +++ b/doc/unirec/search/defines_0.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['_5f_5fstdc_5flimit_5fmacros',['__STDC_LIMIT_MACROS',['../unirec_8h.html#aeb7e7a856ab7a794b05b6b63ef36ea3e',1,'unirec.h']]], + ['_5f_5fuse_5fxopen',['__USE_XOPEN',['../unirec_8c.html#a8773045a81f883f2ab00761f45e8642c',1,'unirec.c']]], + ['_5fbsd_5fsource',['_BSD_SOURCE',['../unirec_8c.html#ad3d8a3bd0c0b677acef144f2c2ef6d73',1,'unirec.c']]], + ['_5fdefault_5fsource',['_DEFAULT_SOURCE',['../unirec_8c.html#a8fb447618db946a9e2a596d9ea18763f',1,'unirec.c']]], + ['_5fxopen_5fsource',['_XOPEN_SOURCE',['../unirec_8c.html#a78c99ffd76a7bb3c8c74db76207e9ab4',1,'unirec.c']]] +]; diff --git a/doc/unirec/search/defines_1.html b/doc/unirec/search/defines_1.html new file mode 100644 index 00000000..ca5bb94e --- /dev/null +++ b/doc/unirec/search/defines_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_1.js b/doc/unirec/search/defines_1.js new file mode 100644 index 00000000..3e208d02 --- /dev/null +++ b/doc/unirec/search/defines_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['collectorslots',['COLLECTORSLOTS',['../ip__prefix__search_8h.html#a6ce90aefb31e61070f25d25b89b5c928',1,'ip_prefix_search.h']]] +]; diff --git a/doc/unirec/search/defines_2.html b/doc/unirec/search/defines_2.html new file mode 100644 index 00000000..7cc1a74c --- /dev/null +++ b/doc/unirec/search/defines_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_2.js b/doc/unirec/search/defines_2.js new file mode 100644 index 00000000..d950f7c1 --- /dev/null +++ b/doc/unirec/search/defines_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['dataslots',['DATASLOTS',['../ip__prefix__search_8h.html#a8f2be007f687fb542db09afe84207d65',1,'ip_prefix_search.h']]] +]; diff --git a/doc/unirec/search/defines_3.html b/doc/unirec/search/defines_3.html new file mode 100644 index 00000000..3d0ac123 --- /dev/null +++ b/doc/unirec/search/defines_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_3.js b/doc/unirec/search/defines_3.js new file mode 100644 index 00000000..f07ea21e --- /dev/null +++ b/doc/unirec/search/defines_3.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['have_5f_5fbool',['HAVE__BOOL',['../config_8h.html#a862ffdbac7ac8323712310a418b7d9a3',1,'config.h']]], + ['have_5falarm',['HAVE_ALARM',['../config_8h.html#a777e1baef81548a6bd84c0da28443435',1,'config.h']]], + ['have_5farpa_5finet_5fh',['HAVE_ARPA_INET_H',['../config_8h.html#a7d1a71461e07569d0c9003da24c30a59',1,'config.h']]], + ['have_5fdlfcn_5fh',['HAVE_DLFCN_H',['../config_8h.html#a0ee1617ff2f6885ef384a3dd46f9b9d7',1,'config.h']]], + ['have_5finttypes_5fh',['HAVE_INTTYPES_H',['../config_8h.html#ab90a030ff2790ebdc176660a6dd2a478',1,'config.h']]], + ['have_5fmalloc',['HAVE_MALLOC',['../config_8h.html#a14503280ca0cb757db915eea09282bfc',1,'config.h']]], + ['have_5fmemmove',['HAVE_MEMMOVE',['../config_8h.html#a7b300f836d3d79d0d9b0039a6b842ded',1,'config.h']]], + ['have_5fmemory_5fh',['HAVE_MEMORY_H',['../config_8h.html#ae93a78f9d076138897af441c9f86f285',1,'config.h']]], + ['have_5fmemset',['HAVE_MEMSET',['../config_8h.html#a3df52e9809253860c385be6f3a160607',1,'config.h']]], + ['have_5frealloc',['HAVE_REALLOC',['../config_8h.html#a0302094a0ee567c610a36c63104ebda5',1,'config.h']]], + ['have_5fstdbool_5fh',['HAVE_STDBOOL_H',['../config_8h.html#a8c3fa1b2f1be8c6f6929548c548cf50a',1,'config.h']]], + ['have_5fstdint_5fh',['HAVE_STDINT_H',['../config_8h.html#ab6cd6d1c63c1e26ea2d4537b77148354',1,'config.h']]], + ['have_5fstdlib_5fh',['HAVE_STDLIB_H',['../config_8h.html#a9e0e434ec1a6ddbd97db12b5a32905e0',1,'config.h']]], + ['have_5fstrchr',['HAVE_STRCHR',['../config_8h.html#a37eb0020e42f0ebb6cba24c2888cc48b',1,'config.h']]], + ['have_5fstring_5fh',['HAVE_STRING_H',['../config_8h.html#ad4c234dd1625255dc626a15886306e7d',1,'config.h']]], + ['have_5fstrings_5fh',['HAVE_STRINGS_H',['../config_8h.html#a405d10d46190bcb0320524c54eafc850',1,'config.h']]], + ['have_5fsys_5fsocket_5fh',['HAVE_SYS_SOCKET_H',['../config_8h.html#afb96c2bc08ebf33cca68c714f624a58d',1,'config.h']]], + ['have_5fsys_5fstat_5fh',['HAVE_SYS_STAT_H',['../config_8h.html#ace156430ba007d19b4348a950d0c692b',1,'config.h']]], + ['have_5fsys_5ftime_5fh',['HAVE_SYS_TIME_H',['../config_8h.html#a2aae46056558e9d6fef6380f9678ffe3',1,'config.h']]], + ['have_5fsys_5ftypes_5fh',['HAVE_SYS_TYPES_H',['../config_8h.html#a69dc70bea5d1f8bd2be9740e974fa666',1,'config.h']]], + ['have_5funistd_5fh',['HAVE_UNISTD_H',['../config_8h.html#a219b06937831d0da94d801ab13987639',1,'config.h']]] +]; diff --git a/doc/unirec/search/defines_4.html b/doc/unirec/search/defines_4.html new file mode 100644 index 00000000..201f927f --- /dev/null +++ b/doc/unirec/search/defines_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_4.js b/doc/unirec/search/defines_4.js new file mode 100644 index 00000000..93ed59ed --- /dev/null +++ b/doc/unirec/search/defines_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['inline',['INLINE',['../inline_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116',1,'inline.h']]], + ['inline_5fimpl',['INLINE_IMPL',['../inline_8h.html#a7dfafbc306b738bfc7977fa6e24f5bbf',1,'inline.h']]] +]; diff --git a/doc/unirec/search/defines_5.html b/doc/unirec/search/defines_5.html new file mode 100644 index 00000000..92d51a58 --- /dev/null +++ b/doc/unirec/search/defines_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_5.js b/doc/unirec/search/defines_5.js new file mode 100644 index 00000000..5b16803f --- /dev/null +++ b/doc/unirec/search/defines_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['lt_5fobjdir',['LT_OBJDIR',['../config_8h.html#ac2d5925d76379847dd9fc4747b061659',1,'config.h']]] +]; diff --git a/doc/unirec/search/defines_6.html b/doc/unirec/search/defines_6.html new file mode 100644 index 00000000..fa5d74ce --- /dev/null +++ b/doc/unirec/search/defines_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_6.js b/doc/unirec/search/defines_6.js new file mode 100644 index 00000000..12d1dfe0 --- /dev/null +++ b/doc/unirec/search/defines_6.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['mac_5fadd_5fformat_5fpri',['MAC_ADD_FORMAT_PRI',['../macaddr_8h.html#a99418c30c5572f728f2c9765f8f1a810',1,'macaddr.h']]], + ['mac_5fadd_5fformat_5fscn',['MAC_ADD_FORMAT_SCN',['../macaddr_8h.html#a9d95aa03c8fa958373947e95cda10132',1,'macaddr.h']]], + ['mac_5fstr_5flen',['MAC_STR_LEN',['../macaddr_8h.html#a60867f758ccbfd1d74983d5fc87bf99a',1,'macaddr.h']]] +]; diff --git a/doc/unirec/search/defines_7.html b/doc/unirec/search/defines_7.html new file mode 100644 index 00000000..99054085 --- /dev/null +++ b/doc/unirec/search/defines_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_7.js b/doc/unirec/search/defines_7.js new file mode 100644 index 00000000..6e679b95 --- /dev/null +++ b/doc/unirec/search/defines_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['networkslots',['NETWORKSLOTS',['../ip__prefix__search_8h.html#ab14a1d9e2dd472d1580b2e0dd5903fd2',1,'ip_prefix_search.h']]] +]; diff --git a/doc/unirec/search/defines_8.html b/doc/unirec/search/defines_8.html new file mode 100644 index 00000000..9098e183 --- /dev/null +++ b/doc/unirec/search/defines_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_8.js b/doc/unirec/search/defines_8.js new file mode 100644 index 00000000..3a833dea --- /dev/null +++ b/doc/unirec/search/defines_8.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['package',['PACKAGE',['../config_8h.html#aca8570fb706c81df371b7f9bc454ae03',1,'config.h']]], + ['package_5fbugreport',['PACKAGE_BUGREPORT',['../config_8h.html#a1d1d2d7f8d2f95b376954d649ab03233',1,'config.h']]], + ['package_5fname',['PACKAGE_NAME',['../config_8h.html#a1c0439e4355794c09b64274849eb0279',1,'config.h']]], + ['package_5fstring',['PACKAGE_STRING',['../config_8h.html#ac73e6f903c16eca7710f92e36e1c6fbf',1,'config.h']]], + ['package_5ftarname',['PACKAGE_TARNAME',['../config_8h.html#af415af6bfede0e8d5453708afe68651c',1,'config.h']]], + ['package_5furl',['PACKAGE_URL',['../config_8h.html#a5c93853116d5a50307b6744f147840aa',1,'config.h']]], + ['package_5fversion',['PACKAGE_VERSION',['../config_8h.html#aa326a05d5e30f9e9a4bb0b4469d5d0c0',1,'config.h']]], + ['prix8',['PRIx8',['../macaddr_8h.html#adac1acc1d24060aeee7791a99d1a3a8c',1,'macaddr.h']]] +]; diff --git a/doc/unirec/search/defines_9.html b/doc/unirec/search/defines_9.html new file mode 100644 index 00000000..bdebe602 --- /dev/null +++ b/doc/unirec/search/defines_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_9.js b/doc/unirec/search/defines_9.js new file mode 100644 index 00000000..4319f965 --- /dev/null +++ b/doc/unirec/search/defines_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['scnx8',['SCNx8',['../macaddr_8h.html#a79b1f201c12273510e1fdebfb3a66e9d',1,'macaddr.h']]], + ['stdc_5fheaders',['STDC_HEADERS',['../config_8h.html#a550e5c272cc3cf3814651721167dcd23',1,'config.h']]] +]; diff --git a/doc/unirec/search/defines_a.html b/doc/unirec/search/defines_a.html new file mode 100644 index 00000000..d6b491aa --- /dev/null +++ b/doc/unirec/search/defines_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_a.js b/doc/unirec/search/defines_a.js new file mode 100644 index 00000000..82b1cac5 --- /dev/null +++ b/doc/unirec/search/defines_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['time_5fwith_5fsys_5ftime',['TIME_WITH_SYS_TIME',['../config_8h.html#a2b44ef64cf38e064ef11e11f35271380',1,'config.h']]] +]; diff --git a/doc/unirec/search/defines_b.html b/doc/unirec/search/defines_b.html new file mode 100644 index 00000000..48f6b2b3 --- /dev/null +++ b/doc/unirec/search/defines_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_b.js b/doc/unirec/search/defines_b.js new file mode 100644 index 00000000..c1d2cae1 --- /dev/null +++ b/doc/unirec/search/defines_b.js @@ -0,0 +1,50 @@ +var searchData= +[ + ['ur_5farray_5falloc',['UR_ARRAY_ALLOC',['../unirec_8h.html#a6ed30dfa27fa7805e7331d11b6c32e06',1,'unirec.h']]], + ['ur_5farray_5fdelimiter',['UR_ARRAY_DELIMITER',['../unirec_8h.html#a243a2fc72cac677ccc100e8a853b965a',1,'unirec.h']]], + ['ur_5fcount_5fof_5ftypes',['UR_COUNT_OF_TYPES',['../unirec_8h.html#a9d12294a70c27484f1f273d14c2231a1',1,'unirec.h']]], + ['ur_5fdefault_5flength_5fof_5ffield_5fname',['UR_DEFAULT_LENGTH_OF_FIELD_NAME',['../unirec_8h.html#a4821db36ecbefac234e93423e1572d8b',1,'unirec.h']]], + ['ur_5fdefault_5flength_5fof_5ffield_5ftype',['UR_DEFAULT_LENGTH_OF_FIELD_TYPE',['../unirec_8h.html#a19c4a8e87b02d9f08120d80ee99d377d',1,'unirec.h']]], + ['ur_5fdefault_5flength_5fof_5ftemplate',['UR_DEFAULT_LENGTH_OF_TEMPLATE',['../unirec_8h.html#a6d4be6c0e3ab412dad7052b6b92cf064',1,'unirec.h']]], + ['ur_5fe_5finvalid_5ffield_5fid',['UR_E_INVALID_FIELD_ID',['../unirec_8h.html#ae983554dcd55068c660732abb7cc29a9',1,'unirec.h']]], + ['ur_5fe_5finvalid_5fname',['UR_E_INVALID_NAME',['../unirec_8h.html#a3286791b4d19706d580fb5dbf07ed5f4',1,'unirec.h']]], + ['ur_5fe_5finvalid_5fparameter',['UR_E_INVALID_PARAMETER',['../unirec_8h.html#ab5f672a177d78e7c11abe1922c424b92',1,'unirec.h']]], + ['ur_5fe_5finvalid_5ftype',['UR_E_INVALID_TYPE',['../unirec_8h.html#ab7dca2db4854ed9db6ffff65d4d9d10a',1,'unirec.h']]], + ['ur_5fe_5fmemory',['UR_E_MEMORY',['../unirec_8h.html#a0e9b91b96ad7672de1171b543e5d68f6',1,'unirec.h']]], + ['ur_5fe_5ftype_5fmismatch',['UR_E_TYPE_MISMATCH',['../unirec_8h.html#a272389ab0926da72541efdaf1bf9377c',1,'unirec.h']]], + ['ur_5ffield_5fid_5fmax',['UR_FIELD_ID_MAX',['../unirec_8h.html#aac640f7c39c04cb3b3ca150da6e46454',1,'unirec.h']]], + ['ur_5ffields',['UR_FIELDS',['../unirec_8h.html#ab0c059e36cea5fa00b0180248543a123',1,'unirec.h']]], + ['ur_5finitial_5fsize_5ffields_5ftable',['UR_INITIAL_SIZE_FIELDS_TABLE',['../unirec_8h.html#aa5d7494a2e5265dce181ecdcfaeaaaea',1,'unirec.h']]], + ['ur_5finitialized',['UR_INITIALIZED',['../unirec_8h.html#a1c3c1c127c05a89b0e87197d022e7107',1,'unirec.h']]], + ['ur_5finvalid_5ffield',['UR_INVALID_FIELD',['../unirec_8h.html#a378cb4e4ce3b8c02b30690e8857c3875',1,'unirec.h']]], + ['ur_5finvalid_5foffset',['UR_INVALID_OFFSET',['../unirec_8h.html#a82342fa356ae9d09be33db986f6d2df2',1,'unirec.h']]], + ['ur_5fiter_5fbegin',['UR_ITER_BEGIN',['../unirec_8h.html#a193dc30952d6b8be7caeba1e6e5f2671',1,'unirec.h']]], + ['ur_5fiter_5fend',['UR_ITER_END',['../unirec_8h.html#accf8d970c42f19c249ece4959a7f38b6',1,'unirec.h']]], + ['ur_5fno_5fdynamic_5fvalues',['UR_NO_DYNAMIC_VALUES',['../unirec_8h.html#a8b797b7bc9ad2159ef020009f031542a',1,'unirec.h']]], + ['ur_5fok',['UR_OK',['../unirec_8h.html#a1a0440dd1b14a93428a69a10581fe8b9',1,'unirec.h']]], + ['ur_5ftype_5fend_5fdir_5fbit_5ffield',['UR_TYPE_END_DIR_BIT_FIELD',['../ur__values_8h.html#adf9713757eee4d6986602fb9625a5f3b',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fdirection_5fflags',['UR_TYPE_END_DIRECTION_FLAGS',['../ur__values_8h.html#a23168199374c45571ba080f5cce464a1',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fevent_5ftype',['UR_TYPE_END_EVENT_TYPE',['../ur__values_8h.html#a3fea119e9a4825038636c666772a666b',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5falert_5ftype_5ffield',['UR_TYPE_END_HB_ALERT_TYPE_FIELD',['../ur__values_8h.html#add4532e95d569594f6ce4968e44f145e',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5fdir',['UR_TYPE_END_HB_DIR',['../ur__values_8h.html#aa1da1d7e3b05ace9c251c3206489ad4e',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhb_5ftype',['UR_TYPE_END_HB_TYPE',['../ur__values_8h.html#ab8284cec451b02733848b3063312027c',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fhttp_5fsdm_5frequest_5fmethod_5fid',['UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID',['../ur__values_8h.html#aa408e76a1aac26343e59a4e6f1584269',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fipv6_5ftun_5ftype',['UR_TYPE_END_IPV6_TUN_TYPE',['../ur__values_8h.html#ad1c988a2e7e442330e2f36f4cad96a44',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fspoof_5ftype',['UR_TYPE_END_SPOOF_TYPE',['../ur__values_8h.html#a5a89cf14233078e088044bd1ff091d46',1,'ur_values.h']]], + ['ur_5ftype_5fend_5ftcp_5fflags',['UR_TYPE_END_TCP_FLAGS',['../ur__values_8h.html#ad2ac8b707fc5f1499f6d099db6932142',1,'ur_values.h']]], + ['ur_5ftype_5fend_5ftunnel_5ftype',['UR_TYPE_END_TUNNEL_TYPE',['../ur__values_8h.html#a58351ae27edebd9145d2532c530cedc5',1,'ur_values.h']]], + ['ur_5ftype_5fend_5fwarden_5ftype',['UR_TYPE_END_WARDEN_TYPE',['../ur__values_8h.html#a7a5dfd0a987d943819ed75ebbdc7602c',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fdir_5fbit_5ffield',['UR_TYPE_START_DIR_BIT_FIELD',['../ur__values_8h.html#a5955ae4b6f7abd20c42d7e01829d7342',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fdirection_5fflags',['UR_TYPE_START_DIRECTION_FLAGS',['../ur__values_8h.html#ad5d36284406ceae1190073f96c4d9356',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fevent_5ftype',['UR_TYPE_START_EVENT_TYPE',['../ur__values_8h.html#a3b49cf7fc8ef8096316ddf232d4ec9b0',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5falert_5ftype_5ffield',['UR_TYPE_START_HB_ALERT_TYPE_FIELD',['../ur__values_8h.html#a7f4652598ce94a909067bc5a66b915d2',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5fdir',['UR_TYPE_START_HB_DIR',['../ur__values_8h.html#a1448655fe0d72bfeffbf7c058b5f7df9',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhb_5ftype',['UR_TYPE_START_HB_TYPE',['../ur__values_8h.html#a34dd652659ee19fdf65f3fe56129be0f',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fhttp_5fsdm_5frequest_5fmethod_5fid',['UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID',['../ur__values_8h.html#a94eb5121ff89c7b2ade7566f2347cfda',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fipv6_5ftun_5ftype',['UR_TYPE_START_IPV6_TUN_TYPE',['../ur__values_8h.html#a8f0c2e871456dd0ab2b0ee4024da1cc5',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fspoof_5ftype',['UR_TYPE_START_SPOOF_TYPE',['../ur__values_8h.html#ae15647d2e2aedb13b47912b52cb7a772',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5ftcp_5fflags',['UR_TYPE_START_TCP_FLAGS',['../ur__values_8h.html#ad9436a94e0e58f4e15696465aade79d3',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5ftunnel_5ftype',['UR_TYPE_START_TUNNEL_TYPE',['../ur__values_8h.html#a61b3348f36d4d4aa95a3b413cf10d23d',1,'ur_values.h']]], + ['ur_5ftype_5fstart_5fwarden_5ftype',['UR_TYPE_START_WARDEN_TYPE',['../ur__values_8h.html#a6be4cdf0eac89e0df6051c6d1168b7ae',1,'ur_values.h']]], + ['ur_5funinitialized',['UR_UNINITIALIZED',['../unirec_8h.html#a09399c945b0bccbf812eac654e23ca3b',1,'unirec.h']]] +]; diff --git a/doc/unirec/search/defines_c.html b/doc/unirec/search/defines_c.html new file mode 100644 index 00000000..920a9478 --- /dev/null +++ b/doc/unirec/search/defines_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/defines_c.js b/doc/unirec/search/defines_c.js new file mode 100644 index 00000000..50b0aa83 --- /dev/null +++ b/doc/unirec/search/defines_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['version',['VERSION',['../config_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'config.h']]] +]; diff --git a/doc/unirec/search/enums_0.html b/doc/unirec/search/enums_0.html new file mode 100644 index 00000000..9efcd1b7 --- /dev/null +++ b/doc/unirec/search/enums_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/enums_0.js b/doc/unirec/search/enums_0.js new file mode 100644 index 00000000..0f5f08f8 --- /dev/null +++ b/doc/unirec/search/enums_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ur_5ffield_5ftype_5ft',['ur_field_type_t',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection',['ur_tmplt_direction',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4ae',1,'unirec.h']]] +]; diff --git a/doc/unirec/search/enumvalues_0.html b/doc/unirec/search/enumvalues_0.html new file mode 100644 index 00000000..03fdfad9 --- /dev/null +++ b/doc/unirec/search/enumvalues_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/enumvalues_0.js b/doc/unirec/search/enumvalues_0.js new file mode 100644 index 00000000..ff7187c0 --- /dev/null +++ b/doc/unirec/search/enumvalues_0.js @@ -0,0 +1,36 @@ +var searchData= +[ + ['ur_5ftmplt_5fdirection_5fbi',['UR_TMPLT_DIRECTION_BI',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aead92326143d975004bacb08640930fead',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fin',['UR_TMPLT_DIRECTION_IN',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aea3c0e3d8b88bb1a4e7bbe44878ee16840',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fno',['UR_TMPLT_DIRECTION_NO',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aea9807b1695bbfc8402e79d493d37ca434',1,'unirec.h']]], + ['ur_5ftmplt_5fdirection_5fout',['UR_TMPLT_DIRECTION_OUT',['../unirec_8h.html#a85bbc4f5be324da3382d0b587e9ae4aeac22b0048de587bc9d53bf5f4bf3dade6',1,'unirec.h']]], + ['ur_5ftype_5fa_5fdouble',['UR_TYPE_A_DOUBLE',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0c1842f638c23e9c7a2bb0713e61c77d',1,'unirec.h']]], + ['ur_5ftype_5fa_5ffloat',['UR_TYPE_A_FLOAT',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aa5ca4aa48c327c055fe123af7e378f0d',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint16',['UR_TYPE_A_INT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a55a41f0046863f726ca928d4f1f0ff9b',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint32',['UR_TYPE_A_INT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a29ab493b2740a556d98711af608dae7b',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint64',['UR_TYPE_A_INT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0bae68cb3e9261cd3701d4e4ae6e5b95',1,'unirec.h']]], + ['ur_5ftype_5fa_5fint8',['UR_TYPE_A_INT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a4df09d1f670ddf5d9c9dbcb673363644',1,'unirec.h']]], + ['ur_5ftype_5fa_5fip',['UR_TYPE_A_IP',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a1e45c640bb5f4ca8076a0376966dc2fb',1,'unirec.h']]], + ['ur_5ftype_5fa_5fmac',['UR_TYPE_A_MAC',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030abba7da5eebad49147205de8d9728597d',1,'unirec.h']]], + ['ur_5ftype_5fa_5ftime',['UR_TYPE_A_TIME',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad3bc3f2010aabdf48e1ecd2a37eec7f2',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint16',['UR_TYPE_A_UINT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0b5171d1d7a246b38f54432225643c88',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint32',['UR_TYPE_A_UINT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a0240abefd383c0b55f967dffbca5b120',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint64',['UR_TYPE_A_UINT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aaf863c8abca426e263925a0c28f965ca',1,'unirec.h']]], + ['ur_5ftype_5fa_5fuint8',['UR_TYPE_A_UINT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a70a968786786d21a6a660a13fe3223fe',1,'unirec.h']]], + ['ur_5ftype_5fbytes',['UR_TYPE_BYTES',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030af3d7332fe3d00598405e5ce4cb70d0b3',1,'unirec.h']]], + ['ur_5ftype_5fchar',['UR_TYPE_CHAR',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a6cd2b8018fd5edf0c17780084682ef07',1,'unirec.h']]], + ['ur_5ftype_5fdouble',['UR_TYPE_DOUBLE',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a83881000b9637c4905af7a052238cb40',1,'unirec.h']]], + ['ur_5ftype_5ffloat',['UR_TYPE_FLOAT',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030afb83f3adb194febb9ff35c0650592dcd',1,'unirec.h']]], + ['ur_5ftype_5fint16',['UR_TYPE_INT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a241c7cd7de2f7f29fcc55a929c277baa',1,'unirec.h']]], + ['ur_5ftype_5fint32',['UR_TYPE_INT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad8f38cf9c041be729dfcdcd6f7f0ee78',1,'unirec.h']]], + ['ur_5ftype_5fint64',['UR_TYPE_INT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030aca579767cf337a5ac6c7974144eca6f7',1,'unirec.h']]], + ['ur_5ftype_5fint8',['UR_TYPE_INT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a6b28189bd4b43d8f83afb712899b5f5a',1,'unirec.h']]], + ['ur_5ftype_5fip',['UR_TYPE_IP',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a69882977753a49d1458e07f809aeb6c9',1,'unirec.h']]], + ['ur_5ftype_5fmac',['UR_TYPE_MAC',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ae3546993ce8e00ca138c5c0f9c1a04bb',1,'unirec.h']]], + ['ur_5ftype_5fstring',['UR_TYPE_STRING',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad004355d78cd66fc3b4ec2744bd02de2',1,'unirec.h']]], + ['ur_5ftype_5ftime',['UR_TYPE_TIME',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ac5e66194d71459394d2eff516ce2c2d1',1,'unirec.h']]], + ['ur_5ftype_5fuint16',['UR_TYPE_UINT16',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ad974c6bd40a8908663192490be5e8bdd',1,'unirec.h']]], + ['ur_5ftype_5fuint32',['UR_TYPE_UINT32',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ade2ea64db377e3c5a4f3940af14a1399',1,'unirec.h']]], + ['ur_5ftype_5fuint64',['UR_TYPE_UINT64',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030a02e71d920f238b5c0e66f3aa6e5a556b',1,'unirec.h']]], + ['ur_5ftype_5fuint8',['UR_TYPE_UINT8',['../unirec_8h.html#a05c900af0773d6801f191b14f29c6030ac5e6afc0dcc62bf41b2f8ecaef4f2d46',1,'unirec.h']]] +]; diff --git a/doc/unirec/search/files_0.html b/doc/unirec/search/files_0.html new file mode 100644 index 00000000..49606c82 --- /dev/null +++ b/doc/unirec/search/files_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_0.js b/doc/unirec/search/files_0.js new file mode 100644 index 00000000..341df008 --- /dev/null +++ b/doc/unirec/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['config_2eh',['config.h',['../config_8h.html',1,'']]] +]; diff --git a/doc/unirec/search/files_1.html b/doc/unirec/search/files_1.html new file mode 100644 index 00000000..c8871748 --- /dev/null +++ b/doc/unirec/search/files_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_1.js b/doc/unirec/search/files_1.js new file mode 100644 index 00000000..a9245cdb --- /dev/null +++ b/doc/unirec/search/files_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['example_5funirec_2ec',['example_unirec.c',['../example__unirec_8c.html',1,'']]] +]; diff --git a/doc/unirec/search/files_2.html b/doc/unirec/search/files_2.html new file mode 100644 index 00000000..99bdf21c --- /dev/null +++ b/doc/unirec/search/files_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_2.js b/doc/unirec/search/files_2.js new file mode 100644 index 00000000..867e6320 --- /dev/null +++ b/doc/unirec/search/files_2.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['index_2etxt',['index.txt',['../index_8txt.html',1,'']]], + ['inline_2eh',['inline.h',['../inline_8h.html',1,'']]], + ['intro_2emd',['intro.md',['../intro_8md.html',1,'']]], + ['ip_5fprefix_5fsearch_2ec',['ip_prefix_search.c',['../ip__prefix__search_8c.html',1,'']]], + ['ip_5fprefix_5fsearch_2eh',['ip_prefix_search.h',['../ip__prefix__search_8h.html',1,'']]], + ['ipaddr_2eh',['ipaddr.h',['../ipaddr_8h.html',1,'']]], + ['ipps_5finternal_2eh',['ipps_internal.h',['../ipps__internal_8h.html',1,'']]] +]; diff --git a/doc/unirec/search/files_3.html b/doc/unirec/search/files_3.html new file mode 100644 index 00000000..f8e543a8 --- /dev/null +++ b/doc/unirec/search/files_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_3.js b/doc/unirec/search/files_3.js new file mode 100644 index 00000000..a62e2333 --- /dev/null +++ b/doc/unirec/search/files_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['links_2eh',['links.h',['../links_8h.html',1,'']]] +]; diff --git a/doc/unirec/search/files_4.html b/doc/unirec/search/files_4.html new file mode 100644 index 00000000..2ebb46c7 --- /dev/null +++ b/doc/unirec/search/files_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_4.js b/doc/unirec/search/files_4.js new file mode 100644 index 00000000..93f19cba --- /dev/null +++ b/doc/unirec/search/files_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['macaddr_2eh',['macaddr.h',['../macaddr_8h.html',1,'']]] +]; diff --git a/doc/unirec/search/files_5.html b/doc/unirec/search/files_5.html new file mode 100644 index 00000000..268b7eb5 --- /dev/null +++ b/doc/unirec/search/files_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_5.js b/doc/unirec/search/files_5.js new file mode 100644 index 00000000..297fa4b5 --- /dev/null +++ b/doc/unirec/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['readme_2dip_5fprefix_5fsearch_2emd',['README-ip_prefix_search.md',['../README-ip__prefix__search_8md.html',1,'']]], + ['readme_2emd',['README.md',['../README_8md.html',1,'']]] +]; diff --git a/doc/unirec/search/files_6.html b/doc/unirec/search/files_6.html new file mode 100644 index 00000000..98fc6666 --- /dev/null +++ b/doc/unirec/search/files_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/files_6.js b/doc/unirec/search/files_6.js new file mode 100644 index 00000000..80f91bc1 --- /dev/null +++ b/doc/unirec/search/files_6.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['unirec_2ec',['unirec.c',['../unirec_8c.html',1,'']]], + ['unirec_2eh',['unirec.h',['../unirec_8h.html',1,'']]], + ['unirec2csv_2ec',['unirec2csv.c',['../unirec2csv_8c.html',1,'']]], + ['unirec2csv_2eh',['unirec2csv.h',['../unirec2csv_8h.html',1,'']]], + ['ur_5ftime_2eh',['ur_time.h',['../ur__time_8h.html',1,'']]], + ['ur_5fvalues_2ec',['ur_values.c',['../ur__values_8c.html',1,'']]], + ['ur_5fvalues_2eh',['ur_values.h',['../ur__values_8h.html',1,'']]] +]; diff --git a/doc/unirec/search/functions_0.html b/doc/unirec/search/functions_0.html new file mode 100644 index 00000000..0539c8ce --- /dev/null +++ b/doc/unirec/search/functions_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_0.js b/doc/unirec/search/functions_0.js new file mode 100644 index 00000000..21a65aea --- /dev/null +++ b/doc/unirec/search/functions_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_5f_5fattribute_5f_5f',['__attribute__',['../macaddr_8h.html#a202b86560da53b16227e10045265cefa',1,'macaddr.h']]] +]; diff --git a/doc/unirec/search/functions_1.html b/doc/unirec/search/functions_1.html new file mode 100644 index 00000000..4878b3d1 --- /dev/null +++ b/doc/unirec/search/functions_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_1.js b/doc/unirec/search/functions_1.js new file mode 100644 index 00000000..f3e3b5c0 --- /dev/null +++ b/doc/unirec/search/functions_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['add_5fdata',['add_data',['../ip__prefix__search_8c.html#a9864b24744feaad0462a326e434a8f9b',1,'add_data(ipps_interval_t *interval, void *data, size_t data_len): ip_prefix_search.c'],['../ipps__internal_8h.html#a9864b24744feaad0462a326e434a8f9b',1,'add_data(ipps_interval_t *interval, void *data, size_t data_len): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_2.html b/doc/unirec/search/functions_2.html new file mode 100644 index 00000000..67d2a392 --- /dev/null +++ b/doc/unirec/search/functions_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_2.js b/doc/unirec/search/functions_2.js new file mode 100644 index 00000000..596d118c --- /dev/null +++ b/doc/unirec/search/functions_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bit_5fendian_5fswap',['bit_endian_swap',['../ip__prefix__search_8c.html#a636e50285646afa428b8de1e1f424351',1,'ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_3.html b/doc/unirec/search/functions_3.html new file mode 100644 index 00000000..1f0eedb3 --- /dev/null +++ b/doc/unirec/search/functions_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_3.js b/doc/unirec/search/functions_3.js new file mode 100644 index 00000000..ec15d3e8 --- /dev/null +++ b/doc/unirec/search/functions_3.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['cmp_5fnet_5fv4',['cmp_net_v4',['../ip__prefix__search_8c.html#ab9fb00293a26a1779ce49dfe4bb84c45',1,'cmp_net_v4(const void *v1, const void *v2): ip_prefix_search.c'],['../ipps__internal_8h.html#ab9fb00293a26a1779ce49dfe4bb84c45',1,'cmp_net_v4(const void *v1, const void *v2): ip_prefix_search.c']]], + ['cmp_5fnet_5fv6',['cmp_net_v6',['../ip__prefix__search_8c.html#a7a0abc9eb4ad56650b71dbc3cf06c664',1,'cmp_net_v6(const void *v1, const void *v2): ip_prefix_search.c'],['../ipps__internal_8h.html#a7a0abc9eb4ad56650b71dbc3cf06c664',1,'cmp_net_v6(const void *v1, const void *v2): ip_prefix_search.c']]], + ['compare_5ffields',['compare_fields',['../group__urtemplate.html#gaf893df4c0a8d17cae3f8999e9bcce312',1,'compare_fields(const void *field1, const void *field2): unirec.c'],['../group__urtemplate.html#gaf893df4c0a8d17cae3f8999e9bcce312',1,'compare_fields(const void *field1, const void *field2): unirec.c']]], + ['copy_5fall_5fdata',['copy_all_data',['../ip__prefix__search_8c.html#aaf3b029f323c47d9cd423ec682fd236c',1,'copy_all_data(ipps_interval_t *dest, ipps_interval_t *src): ip_prefix_search.c'],['../ipps__internal_8h.html#aaf3b029f323c47d9cd423ec682fd236c',1,'copy_all_data(ipps_interval_t *dest, ipps_interval_t *src): ip_prefix_search.c']]], + ['create_5fip_5fv6_5fnet_5fmask_5farray',['create_ip_v6_net_mask_array',['../ip__prefix__search_8c.html#ad0ef62cbddcc87741ceb82ee551a6071',1,'create_ip_v6_net_mask_array(): ip_prefix_search.c'],['../ipps__internal_8h.html#a6c63e0f0cfb556a21bf8f72c339514e1',1,'create_ip_v6_net_mask_array(void): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_4.html b/doc/unirec/search/functions_4.html new file mode 100644 index 00000000..c5bf87a4 --- /dev/null +++ b/doc/unirec/search/functions_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_4.js b/doc/unirec/search/functions_4.js new file mode 100644 index 00000000..d050023f --- /dev/null +++ b/doc/unirec/search/functions_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['destroy_5fip_5fv6_5fnet_5fmask_5farray',['destroy_ip_v6_net_mask_array',['../ip__prefix__search_8c.html#a55368584ae361d0b49b5753540471e81',1,'destroy_ip_v6_net_mask_array(uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#a55368584ae361d0b49b5753540471e81',1,'destroy_ip_v6_net_mask_array(uint32_t **net_mask_array): ip_prefix_search.c']]], + ['destroy_5flist',['destroy_list',['../ip__prefix__search_8c.html#a955c75360f590649ac87c24fe87a74dd',1,'destroy_list(ipps_interval_node_t *interval_list): ip_prefix_search.c'],['../ipps__internal_8h.html#a955c75360f590649ac87c24fe87a74dd',1,'destroy_list(ipps_interval_node_t *interval_list): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_5.html b/doc/unirec/search/functions_5.html new file mode 100644 index 00000000..a34446ce --- /dev/null +++ b/doc/unirec/search/functions_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_5.js b/doc/unirec/search/functions_5.js new file mode 100644 index 00000000..3c3b8656 --- /dev/null +++ b/doc/unirec/search/functions_5.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['fill_5finterval_5fby_5fnetwork',['fill_interval_by_network',['../ip__prefix__search_8c.html#ab60e5f425bab960a725ad058c77cc1c0',1,'fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#ab60e5f425bab960a725ad058c77cc1c0',1,'fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['free',['free',['../example__unirec_8c.html#a898b07decc0a177549f9d553ac416305',1,'free(rec): example_unirec.c'],['../example__unirec_8c.html#a6b20b2a7a795cdf91c302c878ef96d38',1,'free(buffer): example_unirec.c'],['../example__unirec_8c.html#abaeaa1b48eaffb3552d3dc783ab366c1',1,'free(buffer2): example_unirec.c']]], + ['free_5fdata',['free_data',['../ip__prefix__search_8c.html#a6b062bf9730a752b166cb1501c660f7a',1,'free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt): ip_prefix_search.c'],['../ipps__internal_8h.html#a6b062bf9730a752b166cb1501c660f7a',1,'free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_6.html b/doc/unirec/search/functions_6.html new file mode 100644 index 00000000..6fd4b1f3 --- /dev/null +++ b/doc/unirec/search/functions_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_6.js b/doc/unirec/search/functions_6.js new file mode 100644 index 00000000..6ff40062 --- /dev/null +++ b/doc/unirec/search/functions_6.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['if',['if',['../example__unirec_8c.html#afed200b0ec3ad3a8783e01d8eea873ee',1,'example_unirec.c']]], + ['init_5fcontext',['init_context',['../ip__prefix__search_8c.html#a37a9905881da7bd6abc14df2535553c6',1,'init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#a37a9905881da7bd6abc14df2535553c6',1,'init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['insert_5fnew_5finterval',['insert_new_interval',['../ip__prefix__search_8c.html#a746826e7686e2c869208adbdf9b44e8f',1,'insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c'],['../ipps__internal_8h.html#a746826e7686e2c869208adbdf9b44e8f',1,'insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c']]], + ['ip_5fcmp',['ip_cmp',['../group__uripaddr.html#ga6b852d36a8e8b8932058fba40570a24a',1,'ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2): ipaddr.h'],['../group__uripaddr.html#ga6b852d36a8e8b8932058fba40570a24a',1,'ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2): ipaddr.h']]], + ['ip_5fdec',['ip_dec',['../ip__prefix__search_8c.html#a9ff06c46077dabe3c896df26333a4e5a',1,'ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec): ip_prefix_search.c'],['../ipps__internal_8h.html#a9ff06c46077dabe3c896df26333a4e5a',1,'ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec): ip_prefix_search.c']]], + ['ip_5ffrom_5f16_5fbytes_5fbe',['ip_from_16_bytes_be',['../group__uripaddr.html#ga61daf049c5a24cd2a331d916694a4fef',1,'ip_from_16_bytes_be(char b[16]): ipaddr.h'],['../group__uripaddr.html#ga61daf049c5a24cd2a331d916694a4fef',1,'ip_from_16_bytes_be(char b[16]): ipaddr.h']]], + ['ip_5ffrom_5f16_5fbytes_5fle',['ip_from_16_bytes_le',['../group__uripaddr.html#ga35a767afac198cabbbb7cf5ea70c9e33',1,'ip_from_16_bytes_le(char b[16]): ipaddr.h'],['../group__uripaddr.html#ga35a767afac198cabbbb7cf5ea70c9e33',1,'ip_from_16_bytes_le(char b[16]): ipaddr.h']]], + ['ip_5ffrom_5f4_5fbytes_5fbe',['ip_from_4_bytes_be',['../group__uripaddr.html#ga2c694d465f540e700d91a655f6d47ebd',1,'ip_from_4_bytes_be(char b[4]): ipaddr.h'],['../group__uripaddr.html#ga2c694d465f540e700d91a655f6d47ebd',1,'ip_from_4_bytes_be(char b[4]): ipaddr.h']]], + ['ip_5ffrom_5f4_5fbytes_5fle',['ip_from_4_bytes_le',['../group__uripaddr.html#ga34b4da3670a99958f7038c90da2b7152',1,'ip_from_4_bytes_le(char b[4]): ipaddr.h'],['../group__uripaddr.html#ga34b4da3670a99958f7038c90da2b7152',1,'ip_from_4_bytes_le(char b[4]): ipaddr.h']]], + ['ip_5ffrom_5fint',['ip_from_int',['../group__uripaddr.html#gad57ac58e8823c5197445e9035843a417',1,'ip_from_int(uint32_t i): ipaddr.h'],['../group__uripaddr.html#gad57ac58e8823c5197445e9035843a417',1,'ip_from_int(uint32_t i): ipaddr.h']]], + ['ip_5ffrom_5fstr',['ip_from_str',['../group__uripaddr.html#gae01409ca18c16d2b28292ff94802b51b',1,'ip_from_str(const char *str, ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gae01409ca18c16d2b28292ff94802b51b',1,'ip_from_str(const char *str, ip_addr_t *addr): ipaddr.h']]], + ['ip_5fget_5fv4_5fas_5fbytes',['ip_get_v4_as_bytes',['../group__uripaddr.html#gac2c790297e16730292696c44306dd1a6',1,'ip_get_v4_as_bytes(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gac2c790297e16730292696c44306dd1a6',1,'ip_get_v4_as_bytes(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fget_5fv4_5fas_5fint',['ip_get_v4_as_int',['../group__uripaddr.html#gae6ab3a77cab8533289729b25c9438689',1,'ip_get_v4_as_int(ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gae6ab3a77cab8533289729b25c9438689',1,'ip_get_v4_as_int(ip_addr_t *addr): ipaddr.h']]], + ['ip_5finc',['ip_inc',['../ip__prefix__search_8c.html#a4b87bac7d680ace8e244d951e2d643f3',1,'ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc): ip_prefix_search.c'],['../ipps__internal_8h.html#a4b87bac7d680ace8e244d951e2d643f3',1,'ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc): ip_prefix_search.c']]], + ['ip_5fis4',['ip_is4',['../group__uripaddr.html#gabf382d0ceec2ca2d62cb94ecf000ecd4',1,'ip_is4(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gabf382d0ceec2ca2d62cb94ecf000ecd4',1,'ip_is4(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fis6',['ip_is6',['../group__uripaddr.html#gaeaa8f3d94315e53ebf8c43c7dde8f6cb',1,'ip_is6(const ip_addr_t *addr): ipaddr.h'],['../group__uripaddr.html#gaeaa8f3d94315e53ebf8c43c7dde8f6cb',1,'ip_is6(const ip_addr_t *addr): ipaddr.h']]], + ['ip_5fis_5fnull',['ip_is_null',['../group__uripaddr.html#ga43a7b7ceb95df7a142c5da17fa778cd0',1,'ipaddr.h']]], + ['ip_5fto_5fstr',['ip_to_str',['../group__uripaddr.html#ga4aa063dc904a602c2ee1f46bf50315e7',1,'ip_to_str(const ip_addr_t *addr, char *str): ipaddr.h'],['../group__uripaddr.html#ga4aa063dc904a602c2ee1f46bf50315e7',1,'ip_to_str(const ip_addr_t *addr, char *str): ipaddr.h']]], + ['ipps_5fdestroy',['ipps_destroy',['../ip__prefix__search_8c.html#a03c39a2163d96fe9694ae39255f17e3e',1,'ipps_destroy(ipps_context_t *prefix_context): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a03c39a2163d96fe9694ae39255f17e3e',1,'ipps_destroy(ipps_context_t *prefix_context): ip_prefix_search.c']]], + ['ipps_5finit',['ipps_init',['../ip__prefix__search_8c.html#af6d245a01b1d56b1969ff5b05ef9c8db',1,'ipps_init(ipps_network_list_t *network_list): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a9adf0fc051a365b28576bed806e748f4',1,'ipps_init(ipps_network_list_t *networks): ip_prefix_search.c']]], + ['ipps_5fsearch',['ipps_search',['../ip__prefix__search_8c.html#a8565d4f3b5945285e6318356fbb69477',1,'ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data): ip_prefix_search.c'],['../ip__prefix__search_8h.html#a8565d4f3b5945285e6318356fbb69477',1,'ipps_search(ip_addr_t *ip, ipps_context_t *prefix_context, void ***data): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_7.html b/doc/unirec/search/functions_7.html new file mode 100644 index 00000000..6e09abf1 --- /dev/null +++ b/doc/unirec/search/functions_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_7.js b/doc/unirec/search/functions_7.js new file mode 100644 index 00000000..9fd0f9df --- /dev/null +++ b/doc/unirec/search/functions_7.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['mac_5fcmp',['mac_cmp',['../macaddr_8h.html#a7b9c47ab25ee243ad50551b0fd07d08f',1,'mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2): macaddr.h'],['../unirec_8c.html#a36505bbf562889210af7a858dc891fa5',1,'mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2): macaddr.h']]], + ['mac_5ffrom_5fbytes',['mac_from_bytes',['../macaddr_8h.html#a4ce39d5c8d045217044e101a8abb82aa',1,'mac_from_bytes(uint8_t *array): macaddr.h'],['../unirec_8c.html#a167db66d59cbead9f8f83e6c538e0737',1,'mac_from_bytes(uint8_t *array): macaddr.h']]], + ['mac_5ffrom_5fstr',['mac_from_str',['../macaddr_8h.html#a14bfaa27ab4c93f33fec11f76c652d63',1,'mac_from_str(const char *str, mac_addr_t *addr): macaddr.h'],['../unirec_8c.html#a7b3f651fa0b6a4eac840c6c2233c4460',1,'mac_from_str(const char *str, mac_addr_t *addr): macaddr.h']]], + ['mac_5fto_5fbytes',['mac_to_bytes',['../macaddr_8h.html#a7c15ef96c0c46c6e1eef3c2b1cb40c16',1,'mac_to_bytes(const mac_addr_t *addr, uint8_t *array): macaddr.h'],['../unirec_8c.html#a355872267716d5fae37d42eadf4d90d3',1,'mac_to_bytes(const mac_addr_t *addr, uint8_t *array): macaddr.h']]], + ['mac_5fto_5fstr',['mac_to_str',['../macaddr_8h.html#aa890d45520bbabc0f9a6247d092f323b',1,'mac_to_str(const mac_addr_t *addr, char *str): macaddr.h'],['../unirec_8c.html#a295b3ad0387685d62fab829eb2c5c5cb',1,'mac_to_str(const mac_addr_t *addr, char *str): macaddr.h']]], + ['mask_5fipv6',['mask_ipv6',['../ip__prefix__search_8c.html#add2c6d5383885cbd3e7ce4a9fd5acb67',1,'mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array): ip_prefix_search.c'],['../ipps__internal_8h.html#add2c6d5383885cbd3e7ce4a9fd5acb67',1,'mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array): ip_prefix_search.c']]], + ['memcpy',['memcpy',['../example__unirec_8c.html#a48d17eb4cf188b1138d1d0836e3e8cd8',1,'example_unirec.c']]] +]; diff --git a/doc/unirec/search/functions_8.html b/doc/unirec/search/functions_8.html new file mode 100644 index 00000000..d59ea971 --- /dev/null +++ b/doc/unirec/search/functions_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_8.js b/doc/unirec/search/functions_8.js new file mode 100644 index 00000000..67f91ac4 --- /dev/null +++ b/doc/unirec/search/functions_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['new_5fcontext',['new_context',['../ip__prefix__search_8c.html#a12597c99cee9d48dc7e104e6fe23dd91',1,'new_context(): ip_prefix_search.c'],['../ipps__internal_8h.html#a7f4303c276b23497ff35fa5e1a80ef7b',1,'new_context(void): ip_prefix_search.c']]], + ['new_5finterval',['new_interval',['../ip__prefix__search_8c.html#ad4f65683e77379a91b1d7822d73305c2',1,'new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c'],['../ipps__internal_8h.html#ad4f65683e77379a91b1d7822d73305c2',1,'new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip): ip_prefix_search.c']]] +]; diff --git a/doc/unirec/search/functions_9.html b/doc/unirec/search/functions_9.html new file mode 100644 index 00000000..5ccec429 --- /dev/null +++ b/doc/unirec/search/functions_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_9.js b/doc/unirec/search/functions_9.js new file mode 100644 index 00000000..5f0103ad --- /dev/null +++ b/doc/unirec/search/functions_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['printf',['printf',['../example__unirec_8c.html#a31c673502d2deeb8064d17eeab267f87',1,'printf("%u %u %u %s\, ur_get(tmplt, buffer, F_FOO), ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), ur_get_var_len(tmplt, buffer, F_STR1), ur_get_ptr(tmplt, buffer, F_STR1)): example_unirec.c'],['../example__unirec_8c.html#a3611124c0bc459a33ea819c7dbc4a339',1,'printf(" new field %d\, new_id): example_unirec.c'],['../example__unirec_8c.html#a6740088f3eb98704a218ab6f951c5eb4',1,'printf("%u %u %s %u %s %u\, ur_get(tmplt, buffer2, F_BAR), ur_get_var_len(tmplt, buffer2, F_STR1), ur_get_ptr(tmplt, buffer2, F_STR1), ur_get_var_len(tmplt, buffer2, F_STR2), ur_get_ptr(tmplt, buffer2, F_STR2), *(uint16_t *) ur_get_ptr_by_id(tmplt, buffer2, new_id)): example_unirec.c']]] +]; diff --git a/doc/unirec/search/functions_a.html b/doc/unirec/search/functions_a.html new file mode 100644 index 00000000..3958eb7b --- /dev/null +++ b/doc/unirec/search/functions_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/functions_a.js b/doc/unirec/search/functions_a.js new file mode 100644 index 00000000..c6a58b01 --- /dev/null +++ b/doc/unirec/search/functions_a.js @@ -0,0 +1,65 @@ +var searchData= +[ + ['ur_5farray_5fappend_5fget_5fptr',['ur_array_append_get_ptr',['../group__urtemplate.html#ga75d85b3a23dbd6c4c82d21747d4506b0',1,'ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id): unirec.c'],['../group__urtemplate.html#ga75d85b3a23dbd6c4c82d21747d4506b0',1,'ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id): unirec.c']]], + ['ur_5farray_5fresize',['ur_array_resize',['../group__urtemplate.html#ga61e624b3e32c5c6e79dcab1ebcc6d31f',1,'ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len): unirec.c'],['../group__urtemplate.html#ga61e624b3e32c5c6e79dcab1ebcc6d31f',1,'ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len): unirec.c']]], + ['ur_5fclear_5fvarlen',['ur_clear_varlen',['../group__urtemplate.html#ga1a1a56a89c745a13823db8ef01fcb07b',1,'ur_clear_varlen(const ur_template_t *tmplt, void *rec): unirec.c'],['../group__urtemplate.html#ga1a1a56a89c745a13823db8ef01fcb07b',1,'ur_clear_varlen(const ur_template_t *tmplt, void *rec): unirec.c']]], + ['ur_5fclone_5frecord',['ur_clone_record',['../group__urtemplate.html#gab57dab204aa7abf9f0dbde89f0ee408d',1,'ur_clone_record(const ur_template_t *tmplt, const void *src): unirec.c'],['../group__urtemplate.html#gab57dab204aa7abf9f0dbde89f0ee408d',1,'ur_clone_record(const ur_template_t *tmplt, const void *src): unirec.c']]], + ['ur_5fcopy_5ffields',['ur_copy_fields',['../example__unirec_8c.html#ae337d496c308d0b4350a7a0ad8fa5e52',1,'ur_copy_fields(tmplt2, buffer2, tmplt1, buffer): example_unirec.c'],['../group__urtemplate.html#gade89057b16556ff28d540a1f0473ab81',1,'ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src): unirec.c'],['../group__urtemplate.html#gade89057b16556ff28d540a1f0473ab81',1,'ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src): unirec.c']]], + ['ur_5fcpy_5fstring',['ur_cpy_string',['../group__urtemplate.html#ga11693505eb5de52b6b2b021aeaf1a7e1',1,'ur_cpy_string(const char *str): unirec.c'],['../group__urtemplate.html#ga11693505eb5de52b6b2b021aeaf1a7e1',1,'ur_cpy_string(const char *str): unirec.c']]], + ['ur_5fcreate_5flinks',['ur_create_links',['../group__urlinks.html#ga79615b30cdec474a94bb5ce5f3eeb34f',1,'ur_create_links(const char *mask): unirec.c'],['../group__urlinks.html#ga79615b30cdec474a94bb5ce5f3eeb34f',1,'ur_create_links(const char *mask): unirec.c']]], + ['ur_5fcreate_5frecord',['ur_create_record',['../group__urtemplate.html#ga7e2d113dfd7629182d2b18c29c408707',1,'ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size): unirec.c'],['../group__urtemplate.html#ga7e2d113dfd7629182d2b18c29c408707',1,'ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size): unirec.c']]], + ['ur_5fcreate_5ftemplate',['ur_create_template',['../group__urtemplate.html#gaec94dfdd45a6af36f412cc06f9b0106d',1,'ur_create_template(const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gaec94dfdd45a6af36f412cc06f9b0106d',1,'ur_create_template(const char *fields, char **errstr): unirec.c']]], + ['ur_5fcreate_5ftemplate_5ffrom_5fifc_5fspec',['ur_create_template_from_ifc_spec',['../group__urtemplate.html#gae1a76a48d18a09ee2f32ed638bbcbcf7',1,'ur_create_template_from_ifc_spec(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#gae1a76a48d18a09ee2f32ed638bbcbcf7',1,'ur_create_template_from_ifc_spec(const char *ifc_data_fmt): unirec.c']]], + ['ur_5fctx_5fcreate_5fbidirectional_5ftemplate',['ur_ctx_create_bidirectional_template',['../group__urtemplate.html#ga5ac83d4ba9ab47e065f7847272beac67',1,'ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#ga5ac83d4ba9ab47e065f7847272beac67',1,'ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fcreate_5finput_5ftemplate',['ur_ctx_create_input_template',['../group__urtemplate.html#gabc843c9ffe0367e0e2d40bbf4f3c6053',1,'ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gabc843c9ffe0367e0e2d40bbf4f3c6053',1,'ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fcreate_5foutput_5ftemplate',['ur_ctx_create_output_template',['../group__urtemplate.html#gab80b3d4a916e0657f57062c9477d5bd0',1,'ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c'],['../group__urtemplate.html#gab80b3d4a916e0657f57062c9477d5bd0',1,'ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr): unirec.c']]], + ['ur_5fctx_5fset_5finput_5ftemplate',['ur_ctx_set_input_template',['../group__urtemplate.html#gaa21b5e95ade1d2d6993fcf9f9a6c4548',1,'ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gaa21b5e95ade1d2d6993fcf9f9a6c4548',1,'ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c']]], + ['ur_5fctx_5fset_5foutput_5ftemplate',['ur_ctx_set_output_template',['../group__urtemplate.html#gaa27853144707572d1e6a5e0f0a37edae',1,'ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gaa27853144707572d1e6a5e0f0a37edae',1,'ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt): unirec.c']]], + ['ur_5fdefine_5ffield',['ur_define_field',['../group__urtemplate.html#gae9296343268e2117e4f53705c0cdf3a5',1,'ur_define_field(const char *name, ur_field_type_t type): unirec.c'],['../group__urtemplate.html#gae9296343268e2117e4f53705c0cdf3a5',1,'ur_define_field(const char *name, ur_field_type_t type): unirec.c']]], + ['ur_5fdefine_5ffields_5fand_5fupdate_5ftemplate',['ur_define_fields_and_update_template',['../group__urtemplate.html#ga4b090390e3e2728d2d59168eb532633a',1,'ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga4b090390e3e2728d2d59168eb532633a',1,'ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c']]], + ['ur_5fdefine_5fset_5fof_5ffields',['ur_define_set_of_fields',['../group__urtemplate.html#gadc5a6441796f8df8c63645298170f8f4',1,'ur_define_set_of_fields(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#gadc5a6441796f8df8c63645298170f8f4',1,'ur_define_set_of_fields(const char *ifc_data_fmt): unirec.c']]], + ['ur_5fexpand_5ftemplate',['ur_expand_template',['../group__urtemplate.html#gac2b52aaae2bd3aa7d38b119a95a275e9',1,'ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#gac2b52aaae2bd3aa7d38b119a95a275e9',1,'ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt): unirec.c']]], + ['ur_5ffields',['UR_FIELDS',['../example__unirec_8c.html#aa00785ea0941e5b770ae8d1fc33e6d1d',1,'example_unirec.c']]], + ['ur_5ffinalize',['ur_finalize',['../example__unirec_8c.html#a27c079b5e81042d3a6abe210afc17124',1,'ur_finalize(): unirec.c'],['../group__urtemplate.html#ga77bb16e4585117517a5d7aabebcb8a0a',1,'ur_finalize(): unirec.c'],['../group__urtemplate.html#ga77bb16e4585117517a5d7aabebcb8a0a',1,'ur_finalize(): unirec.c']]], + ['ur_5ffree_5flinks',['ur_free_links',['../group__urlinks.html#ga7e1802498fc99e49f98eada58ff0d883',1,'ur_free_links(ur_links_t *links): unirec.c'],['../group__urlinks.html#ga7e1802498fc99e49f98eada58ff0d883',1,'ur_free_links(ur_links_t *links): unirec.c']]], + ['ur_5ffree_5frecord',['ur_free_record',['../group__urtemplate.html#gaf622ee72f07d52a617a22be35088d77e',1,'ur_free_record(void *record): unirec.c'],['../group__urtemplate.html#gaf622ee72f07d52a617a22be35088d77e',1,'ur_free_record(void *record): unirec.c']]], + ['ur_5ffree_5ftemplate',['ur_free_template',['../example__unirec_8c.html#a37220cca7f0b15555963b48d2b1f5eb3',1,'ur_free_template(tmplt): example_unirec.c'],['../example__unirec_8c.html#a3a718a067ebd0d06ab0e6861737fb0cf',1,'ur_free_template(tmplt1): example_unirec.c'],['../example__unirec_8c.html#af2c2fdadf7f8dca4d5b0756d2dd8b9f3',1,'ur_free_template(tmplt2): example_unirec.c'],['../group__urtemplate.html#ga6bfac2d2161cf28551a467a382feda7e',1,'ur_free_template(ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga6bfac2d2161cf28551a467a382feda7e',1,'ur_free_template(ur_template_t *tmplt): unirec.c']]], + ['ur_5fget_5fempty_5fid',['ur_get_empty_id',['../group__urtemplate.html#ga98890a8d9702c533d4d1d1e7921f74e6',1,'ur_get_empty_id(): unirec.c'],['../group__urtemplate.html#ga98890a8d9702c533d4d1d1e7921f74e6',1,'ur_get_empty_id(): unirec.c']]], + ['ur_5fget_5ffield_5ftype_5ffrom_5fstr',['ur_get_field_type_from_str',['../group__urtemplate.html#gae511d9e52485818f2513fe5f2e1d564c',1,'ur_get_field_type_from_str(const char *type): unirec.c'],['../group__urtemplate.html#gae511d9e52485818f2513fe5f2e1d564c',1,'ur_get_field_type_from_str(const char *type): unirec.c']]], + ['ur_5fget_5fid_5fby_5fname',['ur_get_id_by_name',['../group__urtemplate.html#gae04af6d1916490e641f7640e440a8e7c',1,'ur_get_id_by_name(const char *name): unirec.c'],['../group__urtemplate.html#gae04af6d1916490e641f7640e440a8e7c',1,'ur_get_id_by_name(const char *name): unirec.c']]], + ['ur_5fget_5flink_5fbit_5ffield_5fposition',['ur_get_link_bit_field_position',['../group__urlinks.html#ga469c39d33966e8752fc53a4fba154d10',1,'ur_get_link_bit_field_position(ur_links_t *links, unsigned int index): links.h'],['../group__urlinks.html#ga469c39d33966e8752fc53a4fba154d10',1,'ur_get_link_bit_field_position(ur_links_t *links, unsigned int index): links.h']]], + ['ur_5fget_5flink_5fcount',['ur_get_link_count',['../group__urlinks.html#ga9ae62c9d1c388c62669aa5dfdeb97977',1,'ur_get_link_count(ur_links_t *links): links.h'],['../group__urlinks.html#ga9ae62c9d1c388c62669aa5dfdeb97977',1,'ur_get_link_count(ur_links_t *links): links.h']]], + ['ur_5fget_5flink_5findex',['ur_get_link_index',['../group__urlinks.html#ga20fe681784b2536ad4293ed1d2932da2',1,'ur_get_link_index(ur_links_t *links, uint64_t link_bit_field): links.h'],['../group__urlinks.html#ga20fe681784b2536ad4293ed1d2932da2',1,'ur_get_link_index(ur_links_t *links, uint64_t link_bit_field): links.h']]], + ['ur_5fget_5flink_5fmask',['ur_get_link_mask',['../group__urlinks.html#gab0da3a3f0c637c7f49640f74a262e6a0',1,'ur_get_link_mask(ur_links_t *links): links.h'],['../group__urlinks.html#gab0da3a3f0c637c7f49640f74a262e6a0',1,'ur_get_link_mask(ur_links_t *links): links.h']]], + ['ur_5fget_5fptr_5fby_5fid',['ur_get_ptr_by_id',['../example__unirec_8c.html#a1be5c783827bbb7c21da30485dbf4d6f',1,'example_unirec.c']]], + ['ur_5fget_5ftype_5fand_5fname_5ffrom_5fstring',['ur_get_type_and_name_from_string',['../unirec_8c.html#a1dad0e5a16c5828870041e64270e1943',1,'unirec.c']]], + ['ur_5fget_5fvar_5fas_5fstr',['ur_get_var_as_str',['../group__urtemplate.html#ga8b5745a7f8f493f0ccd9a2099e191efd',1,'ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id): unirec.c'],['../group__urtemplate.html#ga8b5745a7f8f493f0ccd9a2099e191efd',1,'ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id): unirec.c']]], + ['ur_5fifc_5fdata_5ffmt_5fto_5ffield_5fnames',['ur_ifc_data_fmt_to_field_names',['../group__urtemplate.html#ga31d468a710c302abfc212784c99ef889',1,'ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt): unirec.c'],['../group__urtemplate.html#ga31d468a710c302abfc212784c99ef889',1,'ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt): unirec.c']]], + ['ur_5finit',['ur_init',['../group__urtemplate.html#ga238d68dc4d1dc5b0369e907b0e2d9711',1,'ur_init(ur_static_field_specs_t field_specs_static): unirec.c'],['../group__urtemplate.html#ga238d68dc4d1dc5b0369e907b0e2d9711',1,'ur_init(ur_static_field_specs_t field_specs_static): unirec.c']]], + ['ur_5fiter_5ffields',['ur_iter_fields',['../group__urtemplate.html#gafb2182af09a35e3ba1bc868c311f3a80',1,'ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id): unirec.c'],['../group__urtemplate.html#gafb2182af09a35e3ba1bc868c311f3a80',1,'ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id): unirec.c']]], + ['ur_5fiter_5ffields_5frecord_5forder',['ur_iter_fields_record_order',['../group__urtemplate.html#ga8877cbc958a4943aaf720154f8338ae3',1,'ur_iter_fields_record_order(const ur_template_t *tmplt, int index): unirec.c'],['../group__urtemplate.html#ga8877cbc958a4943aaf720154f8338ae3',1,'ur_iter_fields_record_order(const ur_template_t *tmplt, int index): unirec.c']]], + ['ur_5fprint_5ftemplate',['ur_print_template',['../group__urtemplate.html#ga10c9d739b4b74b4547099b9095857dff',1,'ur_print_template(ur_template_t *tmplt): unirec.c'],['../group__urtemplate.html#ga10c9d739b4b74b4547099b9095857dff',1,'ur_print_template(ur_template_t *tmplt): unirec.c']]], + ['ur_5frec_5fvarlen_5fsize',['ur_rec_varlen_size',['../group__urtemplate.html#ga52dad8336d06db586dd23820263f5fc2',1,'ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec): unirec.c'],['../group__urtemplate.html#ga52dad8336d06db586dd23820263f5fc2',1,'ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec): unirec.c']]], + ['ur_5fset',['ur_set',['../example__unirec_8c.html#a44c9be2acf8f825c1a5f5b85cfa28416',1,'ur_set(tmplt, rec, F_FOO, 12345): example_unirec.c'],['../example__unirec_8c.html#af952cdb0251e5f01a680df18486f11fd',1,'ur_set(tmplt, rec, F_BAR, 54321): example_unirec.c'],['../example__unirec_8c.html#a472a257c163330eccae1d616f885c574',1,'ur_set(tmplt, rec, F_IP, ip_from_int(12345678)): example_unirec.c']]], + ['ur_5fset_5farray_5ffrom_5fstring',['ur_set_array_from_string',['../group__urtemplate.html#gae2f3f81ef535393f36ccf1ad49a4e510',1,'ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c'],['../group__urtemplate.html#gae2f3f81ef535393f36ccf1ad49a4e510',1,'ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c']]], + ['ur_5fset_5ffrom_5fstring',['ur_set_from_string',['../group__urtemplate.html#gae60aa0708ffef7cadd5a1d7663eb8083',1,'ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c'],['../group__urtemplate.html#gae60aa0708ffef7cadd5a1d7663eb8083',1,'ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v): unirec.c']]], + ['ur_5fset_5fstring',['ur_set_string',['../example__unirec_8c.html#af0a3ce43925405b52081928f5d9577a6',1,'ur_set_string(tmplt, rec, F_STR1, "Hello World!"): example_unirec.c'],['../example__unirec_8c.html#ae55f23c8dd2f392576f2a69a2205c507',1,'ur_set_string(tmplt2, buffer2, F_STR2, "The second string"): example_unirec.c']]], + ['ur_5fset_5fvar',['ur_set_var',['../group__urtemplate.html#gadc58a81c9f7eb5a1ec3ba36d97612068',1,'ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len): unirec.c'],['../group__urtemplate.html#gadc58a81c9f7eb5a1ec3ba36d97612068',1,'ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len): unirec.c']]], + ['ur_5ftemplate_5fcompare',['ur_template_compare',['../group__urtemplate.html#gaadde868d2fc5dd09710fddb8e629bb87',1,'ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB): unirec.c'],['../group__urtemplate.html#gaadde868d2fc5dd09710fddb8e629bb87',1,'ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB): unirec.c']]], + ['ur_5ftemplate_5fstring_5fdelimiter',['ur_template_string_delimiter',['../group__urtemplate.html#gabfbfcce0fe6729ceb692d09541336c33',1,'ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter): unirec.c'],['../group__urtemplate.html#gabfbfcce0fe6729ceb692d09541336c33',1,'ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter): unirec.c']]], + ['ur_5ftime_5ffrom_5fstring',['ur_time_from_string',['../group__urtime.html#gac3eefb5beaa508724b2ea4f452926096',1,'ur_time_from_string(ur_time_t *ur, const char *str): unirec.c'],['../group__urtime.html#gac3eefb5beaa508724b2ea4f452926096',1,'ur_time_from_string(ur_time_t *ur, const char *str): unirec.c']]], + ['ur_5ftimediff',['ur_timediff',['../group__urtime.html#ga2ae8aeccd3d51c898d627c5990e56640',1,'ur_time.h']]], + ['ur_5ftimediff_5fns',['ur_timediff_ns',['../group__urtime.html#gaae51ca7f8ebf8fc99e5d0fab05856e84',1,'ur_time.h']]], + ['ur_5ftimediff_5fus',['ur_timediff_us',['../group__urtime.html#gad153e75baab956f32bc8e8553e24b713',1,'ur_time.h']]], + ['ur_5fundefine_5ffield',['ur_undefine_field',['../group__urtemplate.html#ga3b7d40d098716943f035185d26aeff29',1,'ur_undefine_field(const char *name): unirec.c'],['../group__urtemplate.html#ga3b7d40d098716943f035185d26aeff29',1,'ur_undefine_field(const char *name): unirec.c']]], + ['ur_5fundefine_5ffield_5fby_5fid',['ur_undefine_field_by_id',['../group__urtemplate.html#ga0d8940c1aab20e50ab84da99715322fc',1,'ur_undefine_field_by_id(ur_field_id_t field_id): unirec.c'],['../group__urtemplate.html#ga0d8940c1aab20e50ab84da99715322fc',1,'ur_undefine_field_by_id(ur_field_id_t field_id): unirec.c']]], + ['ur_5fvalues_5fget_5fdescription_5fstart_5fend',['ur_values_get_description_start_end',['../group__urtemplate.html#ga2a2e25e5cdee3544c54e4abf4782dfb5',1,'ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c'],['../group__urtemplate.html#ga2a2e25e5cdee3544c54e4abf4782dfb5',1,'ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c']]], + ['ur_5fvalues_5fget_5fname_5fstart_5fend',['ur_values_get_name_start_end',['../group__urtemplate.html#gadad09e518520d1791d94b29ee7af2487',1,'ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c'],['../group__urtemplate.html#gadad09e518520d1791d94b29ee7af2487',1,'ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value): unirec.c']]], + ['ur_5fvar_5fchange_5fsize',['ur_var_change_size',['../unirec_8c.html#a6c1aeacaf5107408c58188e63406bcd1',1,'unirec.c']]], + ['urcsv_5ffield',['urcsv_field',['../group__unirec2csv.html#gabcdfcecd5e7d7e8ee6eb522268e012b0',1,'urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt): unirec2csv.c'],['../group__unirec2csv.html#gabcdfcecd5e7d7e8ee6eb522268e012b0',1,'urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt): unirec2csv.c']]], + ['urcsv_5ffree',['urcsv_free',['../group__unirec2csv.html#ga6fccedb3672666709144fd4d1738cbab',1,'urcsv_free(urcsv_t **urcsv): unirec2csv.c'],['../group__unirec2csv.html#ga6fccedb3672666709144fd4d1738cbab',1,'urcsv_free(urcsv_t **urcsv): unirec2csv.c']]], + ['urcsv_5fheader',['urcsv_header',['../group__unirec2csv.html#ga15f9289cc80c70398b5195eafda0530c',1,'urcsv_header(urcsv_t *urcsv): unirec2csv.c'],['../group__unirec2csv.html#ga15f9289cc80c70398b5195eafda0530c',1,'urcsv_header(urcsv_t *urcsv): unirec2csv.c']]], + ['urcsv_5finit',['urcsv_init',['../group__unirec2csv.html#gacb3ee2746f750f01c8ce61f28264fefa',1,'urcsv_init(ur_template_t *tmplt, char delimiter): unirec2csv.c'],['../group__unirec2csv.html#gacb3ee2746f750f01c8ce61f28264fefa',1,'urcsv_init(ur_template_t *tmplt, char delimiter): unirec2csv.c']]], + ['urcsv_5frecord',['urcsv_record',['../group__unirec2csv.html#ga8589709b8f1b83556596f749e34fe334',1,'urcsv_record(urcsv_t *urcsv, const void *rec): unirec2csv.c'],['../group__unirec2csv.html#ga8589709b8f1b83556596f749e34fe334',1,'urcsv_record(urcsv_t *urcsv, const void *rec): unirec2csv.c']]], + ['urcsv_5fvalue',['urcsv_value',['../unirec2csv_8c.html#a98e710a5bbaab856b05f7edbfa3b1f82',1,'unirec2csv.c']]] +]; diff --git a/doc/unirec/search/groups_0.html b/doc/unirec/search/groups_0.html new file mode 100644 index 00000000..f4895cb4 --- /dev/null +++ b/doc/unirec/search/groups_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_0.js b/doc/unirec/search/groups_0.js new file mode 100644 index 00000000..5c4bf0dc --- /dev/null +++ b/doc/unirec/search/groups_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['csv_20representation',['CSV representation',['../group__unirec2csv.html',1,'']]] +]; diff --git a/doc/unirec/search/groups_1.html b/doc/unirec/search/groups_1.html new file mode 100644 index 00000000..31952659 --- /dev/null +++ b/doc/unirec/search/groups_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_1.js b/doc/unirec/search/groups_1.js new file mode 100644 index 00000000..14e7573b --- /dev/null +++ b/doc/unirec/search/groups_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['helpers_20for_20libtrap',['Helpers for libtrap',['../group__libtraphelpers.html',1,'']]] +]; diff --git a/doc/unirec/search/groups_2.html b/doc/unirec/search/groups_2.html new file mode 100644 index 00000000..58824467 --- /dev/null +++ b/doc/unirec/search/groups_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_2.js b/doc/unirec/search/groups_2.js new file mode 100644 index 00000000..14af3209 --- /dev/null +++ b/doc/unirec/search/groups_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['ip_20addresses_20api',['IP addresses API',['../group__uripaddr.html',1,'']]] +]; diff --git a/doc/unirec/search/groups_3.html b/doc/unirec/search/groups_3.html new file mode 100644 index 00000000..bd23aa6e --- /dev/null +++ b/doc/unirec/search/groups_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_3.js b/doc/unirec/search/groups_3.js new file mode 100644 index 00000000..59a72cc1 --- /dev/null +++ b/doc/unirec/search/groups_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['links_20api',['Links API',['../group__urlinks.html',1,'']]] +]; diff --git a/doc/unirec/search/groups_4.html b/doc/unirec/search/groups_4.html new file mode 100644 index 00000000..34edffce --- /dev/null +++ b/doc/unirec/search/groups_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_4.js b/doc/unirec/search/groups_4.js new file mode 100644 index 00000000..20cb753d --- /dev/null +++ b/doc/unirec/search/groups_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['timestamps_20api',['Timestamps API',['../group__urtime.html',1,'']]] +]; diff --git a/doc/unirec/search/groups_5.html b/doc/unirec/search/groups_5.html new file mode 100644 index 00000000..6d9adbf8 --- /dev/null +++ b/doc/unirec/search/groups_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/groups_5.js b/doc/unirec/search/groups_5.js new file mode 100644 index 00000000..a06cf227 --- /dev/null +++ b/doc/unirec/search/groups_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['unirec_20templates_20and_20fields',['UniRec templates and fields',['../group__urtemplate.html',1,'']]] +]; diff --git a/doc/unirec/search/mag_sel.png b/doc/unirec/search/mag_sel.png new file mode 100644 index 00000000..81f6040a Binary files /dev/null and b/doc/unirec/search/mag_sel.png differ diff --git a/doc/unirec/search/nomatches.html b/doc/unirec/search/nomatches.html new file mode 100644 index 00000000..b1ded27e --- /dev/null +++ b/doc/unirec/search/nomatches.html @@ -0,0 +1,12 @@ + + + + + + + +
    +
    No Matches
    +
    + + diff --git a/doc/unirec/search/pages_0.html b/doc/unirec/search/pages_0.html new file mode 100644 index 00000000..d7528582 --- /dev/null +++ b/doc/unirec/search/pages_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/pages_0.js b/doc/unirec/search/pages_0.js new file mode 100644 index 00000000..ca3a613b --- /dev/null +++ b/doc/unirec/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['ip_20prefix_20binary_20search',['IP prefix binary search',['../md_README-ip_prefix_search.html',1,'']]] +]; diff --git a/doc/unirec/search/pages_1.html b/doc/unirec/search/pages_1.html new file mode 100644 index 00000000..924fb482 --- /dev/null +++ b/doc/unirec/search/pages_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/pages_1.js b/doc/unirec/search/pages_1.js new file mode 100644 index 00000000..eaaeca4d --- /dev/null +++ b/doc/unirec/search/pages_1.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['unirec_3a_20content_20of_20documentation',['UniRec: Content of documentation',['../index.html',1,'']]], + ['unirec',['UniRec',['../md_doc_intro.html',1,'']]], + ['unirec',['UniRec',['../md_README.html',1,'']]] +]; diff --git a/doc/unirec/search/search.css b/doc/unirec/search/search.css new file mode 100644 index 00000000..3cf9df94 --- /dev/null +++ b/doc/unirec/search/search.css @@ -0,0 +1,271 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#MSearchBox { + white-space : nowrap; + float: none; + margin-top: 8px; + right: 0px; + width: 170px; + height: 24px; + z-index: 102; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:115px; + margin-left:20px; + padding-left:4px; + color: #909090; + outline: none; + font: 9pt Arial, Verdana, sans-serif; + -webkit-border-radius: 0px; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + top:8px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; + z-index:10000; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/doc/unirec/search/search.js b/doc/unirec/search/search.js new file mode 100644 index 00000000..a554ab9c --- /dev/null +++ b/doc/unirec/search/search.js @@ -0,0 +1,814 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches.html'; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName == 'DIV' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName == 'DIV' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/typedefs_0.js b/doc/unirec/search/typedefs_0.js new file mode 100644 index 00000000..dadd8afd --- /dev/null +++ b/doc/unirec/search/typedefs_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['ur_5ffield_5fid_5ft',['ur_field_id_t',['../unirec_8h.html#a17cba425af74e590b73d23d4e0fda44a',1,'unirec.h']]], + ['ur_5fiter_5ft',['ur_iter_t',['../unirec_8h.html#a0d8bbc1307c342a3a83bc2f5193e5fdf',1,'unirec.h']]], + ['ur_5ftime_5ft',['ur_time_t',['../group__urtime.html#ga9d13a2ac3696e74a33a93aa0461a3899',1,'ur_time.h']]] +]; diff --git a/doc/unirec/search/typedefs_1.html b/doc/unirec/search/typedefs_1.html new file mode 100644 index 00000000..b77c5338 --- /dev/null +++ b/doc/unirec/search/typedefs_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/typedefs_1.js b/doc/unirec/search/typedefs_1.js new file mode 100644 index 00000000..c39a4bfc --- /dev/null +++ b/doc/unirec/search/typedefs_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['ur_5ftime_5ft',['ur_time_t',['../group__ur__time.html#ga9d13a2ac3696e74a33a93aa0461a3899',1,'ur_time.h']]] +]; diff --git a/doc/unirec/search/variables_0.html b/doc/unirec/search/variables_0.html new file mode 100644 index 00000000..51f7bd6b --- /dev/null +++ b/doc/unirec/search/variables_0.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_0.js b/doc/unirec/search/variables_0.js new file mode 100644 index 00000000..cdfa6f3c --- /dev/null +++ b/doc/unirec/search/variables_0.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['addr',['addr',['../ip__prefix__search_8h.html#af40b27d3ab53f236728bf696b85beaa4',1,'ipps_network_t']]], + ['argv',['argv',['../example__unirec_8c.html#af2efa898e9eed6fe6715279cb1ec35b0',1,'example_unirec.c']]], + ['array_5flen',['array_len',['../ip__prefix__search_8h.html#ad8134e855f83cab01e22e291cab33e46',1,'ipps_interval_t']]] +]; diff --git a/doc/unirec/search/variables_1.html b/doc/unirec/search/variables_1.html new file mode 100644 index 00000000..f46154d8 --- /dev/null +++ b/doc/unirec/search/variables_1.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_1.js b/doc/unirec/search/variables_1.js new file mode 100644 index 00000000..b0512f91 --- /dev/null +++ b/doc/unirec/search/variables_1.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['buffer',['buffer',['../group__unirec2csv.html#affdffcb83cacbc414c7b1a754516ff63',1,'urcsv_t::buffer()'],['../example__unirec_8c.html#a38acb51b2a63fccbafac9c0afca0c1b9',1,'buffer(): example_unirec.c']]], + ['buffer2',['buffer2',['../example__unirec_8c.html#a344c6b17444befb2f894d0428cd3d147',1,'example_unirec.c']]], + ['buffer_5fsize',['buffer_size',['../group__unirec2csv.html#a0577c3f07444dc671a4b2de85b5f7805',1,'urcsv_t']]], + ['bytes',['bytes',['../group__uripaddr.html#abd3962df43e4446ff33e8ff98c8951d3',1,'ip_addr_t']]] +]; diff --git a/doc/unirec/search/variables_2.html b/doc/unirec/search/variables_2.html new file mode 100644 index 00000000..15275b7a --- /dev/null +++ b/doc/unirec/search/variables_2.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_2.js b/doc/unirec/search/variables_2.js new file mode 100644 index 00000000..92011038 --- /dev/null +++ b/doc/unirec/search/variables_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['count',['count',['../unirec_8h.html#a3331d5fc7eeda55fbbb33543da5db0d9',1,'ur_template_t']]], + ['curpos',['curpos',['../group__unirec2csv.html#af20abdad0be1405f8186d6d18915416b',1,'urcsv_t']]] +]; diff --git a/doc/unirec/search/variables_3.html b/doc/unirec/search/variables_3.html new file mode 100644 index 00000000..fbc36712 --- /dev/null +++ b/doc/unirec/search/variables_3.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_3.js b/doc/unirec/search/variables_3.js new file mode 100644 index 00000000..bef08d0e --- /dev/null +++ b/doc/unirec/search/variables_3.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['data',['data',['../ip__prefix__search_8h.html#a7f8128509b76517a88db446dd1bcb3f6',1,'ipps_network_t']]], + ['data_5farray',['data_array',['../ip__prefix__search_8h.html#aeb0b22258e55f7d45d4a07fbc30764c6',1,'ipps_interval_t']]], + ['data_5fcnt',['data_cnt',['../ip__prefix__search_8h.html#a69705a7d1c605fa29a0e6d305183ebd5',1,'ipps_interval_t']]], + ['data_5flen',['data_len',['../ip__prefix__search_8h.html#a9308e7d33d03176329e1042737edcd8f',1,'ipps_network_t']]], + ['delimiter',['delimiter',['../group__unirec2csv.html#a4e10948588efc4d08f4c7621f2481f9f',1,'urcsv_t']]], + ['description',['description',['../ur__values_8h.html#a82a1958b9adfed06531d08ddd1d94951',1,'ur_values_t']]], + ['direction',['direction',['../unirec_8h.html#a099d176cd55c8e16d01a3e9eb6f8c6d4',1,'ur_template_t']]] +]; diff --git a/doc/unirec/search/variables_4.html b/doc/unirec/search/variables_4.html new file mode 100644 index 00000000..8067e67f --- /dev/null +++ b/doc/unirec/search/variables_4.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_4.js b/doc/unirec/search/variables_4.js new file mode 100644 index 00000000..4a92110a --- /dev/null +++ b/doc/unirec/search/variables_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['first_5fdynamic',['first_dynamic',['../unirec_8h.html#a3ff58f0882adb970deec7c6f7faa7f7c',1,'ur_template_t']]], + ['free_5fspace',['free_space',['../group__unirec2csv.html#a3ba96d1ed5c6671a6bfc257a0fbedd73',1,'urcsv_t']]] +]; diff --git a/doc/unirec/search/variables_5.html b/doc/unirec/search/variables_5.html new file mode 100644 index 00000000..7e95e946 --- /dev/null +++ b/doc/unirec/search/variables_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_5.js b/doc/unirec/search/variables_5.js new file mode 100644 index 00000000..bc724a10 --- /dev/null +++ b/doc/unirec/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['high_5fip',['high_ip',['../ip__prefix__search_8h.html#a3bfe6c237387f3757609230c3593b813',1,'ipps_interval_t']]] +]; diff --git a/doc/unirec/search/variables_6.html b/doc/unirec/search/variables_6.html new file mode 100644 index 00000000..3d398e62 --- /dev/null +++ b/doc/unirec/search/variables_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_6.js b/doc/unirec/search/variables_6.js new file mode 100644 index 00000000..0e7f9424 --- /dev/null +++ b/doc/unirec/search/variables_6.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['id',['id',['../unirec_8h.html#aac5a570f858914e91700d1d69f8fdace',1,'ur_field_id_linked_list_s::id()'],['../unirec_8h.html#a7d8bca7d65ccb7dfeaad247f43100789',1,'field_spec_t::id()']]], + ['ids',['ids',['../unirec_8h.html#acf8005fa9976d0fbe61c40aefeea199c',1,'ur_template_t']]], + ['ifc_5fout',['ifc_out',['../unirec_8h.html#a547b0de3d97d62b5415ebcc371e87a19',1,'ur_template_t']]], + ['interval',['interval',['../ipps__internal_8h.html#a5ade3c87f5b143b1a499ec073122abe8',1,'ipps_interval_node_t']]], + ['intialized',['intialized',['../unirec_8h.html#a2049527f65320075c1e5e3bb9c9aff15',1,'ur_field_specs_t']]] +]; diff --git a/doc/unirec/search/variables_7.html b/doc/unirec/search/variables_7.html new file mode 100644 index 00000000..7b791460 --- /dev/null +++ b/doc/unirec/search/variables_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_7.js b/doc/unirec/search/variables_7.js new file mode 100644 index 00000000..fc5f17d7 --- /dev/null +++ b/doc/unirec/search/variables_7.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['link_5fcount',['link_count',['../group__urlinks.html#a4c9bf894635e57dbd1101cdd4210b4d1',1,'ur_links_t']]], + ['link_5findexes',['link_indexes',['../group__urlinks.html#a6d882bfc96e7c43de4e9dcc0f6e9f628',1,'ur_links_t']]], + ['link_5fmask',['link_mask',['../group__urlinks.html#abf9e1b6345f9757c679df5633313ee75',1,'ur_links_t']]], + ['low_5fip',['low_ip',['../ip__prefix__search_8h.html#ad587d90b3aa4f17c210564d3366aba02',1,'ipps_interval_t']]] +]; diff --git a/doc/unirec/search/variables_8.html b/doc/unirec/search/variables_8.html new file mode 100644 index 00000000..8ebc5f6b --- /dev/null +++ b/doc/unirec/search/variables_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_8.js b/doc/unirec/search/variables_8.js new file mode 100644 index 00000000..5cbb8013 --- /dev/null +++ b/doc/unirec/search/variables_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['mac_5faddr_5ft',['mac_addr_t',['../macaddr_8h.html#a5cb542bc605d9e6641afdd9dd6a6314e',1,'macaddr.h']]], + ['mask',['mask',['../ip__prefix__search_8h.html#ae3ae852da1c3c9a0ef2e595ab9109735',1,'ipps_network_t']]] +]; diff --git a/doc/unirec/search/variables_9.html b/doc/unirec/search/variables_9.html new file mode 100644 index 00000000..12136613 --- /dev/null +++ b/doc/unirec/search/variables_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_9.js b/doc/unirec/search/variables_9.js new file mode 100644 index 00000000..fe7c6608 --- /dev/null +++ b/doc/unirec/search/variables_9.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['name',['name',['../unirec_8h.html#a3b5886d926b0a4ae0959eaf4aba18201',1,'field_spec_t::name()'],['../ur__values_8h.html#a16d9f01f7fa1c2fcee79c4b7d04eecb0',1,'ur_values_t::name()']]], + ['net_5fcount',['net_count',['../ip__prefix__search_8h.html#aaeb26d8764f865e37ec6836b2982f8f4',1,'ipps_network_list_t']]], + ['networks',['networks',['../ip__prefix__search_8h.html#ac85d78674943d10b2f4429244165498c',1,'ipps_network_list_t']]], + ['new_5fid',['new_id',['../example__unirec_8c.html#a14c622b14dcd4a0b0db6cd5cdd948cee',1,'example_unirec.c']]], + ['next',['next',['../ipps__internal_8h.html#aeff18751a64927832d26c854406717cb',1,'ipps_interval_node_t::next()'],['../unirec_8h.html#a0ee1b233f020b9f8bd5236fceb501cb9',1,'ur_field_id_linked_list_s::next()']]] +]; diff --git a/doc/unirec/search/variables_a.html b/doc/unirec/search/variables_a.html new file mode 100644 index 00000000..24819a37 --- /dev/null +++ b/doc/unirec/search/variables_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_a.js b/doc/unirec/search/variables_a.js new file mode 100644 index 00000000..3fa504bd --- /dev/null +++ b/doc/unirec/search/variables_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['offset',['offset',['../unirec_8h.html#a4aedfaa872d40f452909dc395a0fbc4a',1,'ur_template_t']]], + ['offset_5fsize',['offset_size',['../unirec_8h.html#ae3458bcec0d7af5a00cfdb528f4f36b7',1,'ur_template_t']]] +]; diff --git a/doc/unirec/search/variables_b.html b/doc/unirec/search/variables_b.html new file mode 100644 index 00000000..b306931e --- /dev/null +++ b/doc/unirec/search/variables_b.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_b.js b/doc/unirec/search/variables_b.js new file mode 100644 index 00000000..e3385e59 --- /dev/null +++ b/doc/unirec/search/variables_b.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['rec',['rec',['../example__unirec_8c.html#ac37164e80df5f86d98247768effab54d',1,'example_unirec.c']]], + ['return',['return',['../example__unirec_8c.html#a9717e7bbecb906637e86cef6da3d83c2',1,'example_unirec.c']]] +]; diff --git a/doc/unirec/search/variables_c.html b/doc/unirec/search/variables_c.html new file mode 100644 index 00000000..75709df8 --- /dev/null +++ b/doc/unirec/search/variables_c.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_c.js b/doc/unirec/search/variables_c.js new file mode 100644 index 00000000..23d1946c --- /dev/null +++ b/doc/unirec/search/variables_c.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['size',['size',['../unirec_8h.html#a20d9d5eb643e04cdb13a84195993ef92',1,'field_spec_t']]], + ['static_5fsize',['static_size',['../unirec_8h.html#a5ec4e8fb6f0bacae7cda7af77f8ef1e2',1,'ur_template_t']]] +]; diff --git a/doc/unirec/search/variables_d.html b/doc/unirec/search/variables_d.html new file mode 100644 index 00000000..34c80a48 --- /dev/null +++ b/doc/unirec/search/variables_d.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_d.js b/doc/unirec/search/variables_d.js new file mode 100644 index 00000000..1fbfab02 --- /dev/null +++ b/doc/unirec/search/variables_d.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['tmplt',['tmplt',['../group__unirec2csv.html#af9610db66cf3ffc3d6714ac6fea56c5a',1,'urcsv_t']]], + ['tmplt1',['tmplt1',['../example__unirec_8c.html#a593f6e2ec4c598e1fdee4cadf6b59bf6',1,'example_unirec.c']]], + ['tmplt2',['tmplt2',['../example__unirec_8c.html#a67205fb81bdf5e95cf28eb5ab0c8af67',1,'example_unirec.c']]] +]; diff --git a/doc/unirec/search/variables_e.html b/doc/unirec/search/variables_e.html new file mode 100644 index 00000000..4a1c8a61 --- /dev/null +++ b/doc/unirec/search/variables_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_e.js b/doc/unirec/search/variables_e.js new file mode 100644 index 00000000..c20df0a2 --- /dev/null +++ b/doc/unirec/search/variables_e.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['ui16',['ui16',['../group__uripaddr.html#a7037d9d99f039e7b067b7d6425d8d9d1',1,'ip_addr_t']]], + ['ui32',['ui32',['../group__uripaddr.html#a2305ae4c4f3a44cc13f4c7acc15fba40',1,'ip_addr_t']]], + ['ui64',['ui64',['../group__uripaddr.html#a2a293ee262feeb6206a9c0b4a1623575',1,'ip_addr_t']]], + ['ui8',['ui8',['../group__uripaddr.html#a1b4c6707d88d198cdf8fc2400c270b30',1,'ip_addr_t']]], + ['ur_5fallocated_5ffields',['ur_allocated_fields',['../unirec_8h.html#abe745769ca4dd67bf653de0687033da9',1,'ur_field_specs_t']]], + ['ur_5ffield_5farray_5felem_5ftype',['ur_field_array_elem_type',['../group__urtemplate.html#gab50744832dee040515e0723ac30c85b9',1,'ur_field_array_elem_type(): unirec.c'],['../group__urtemplate.html#gab50744832dee040515e0723ac30c85b9',1,'ur_field_array_elem_type(): unirec.c']]], + ['ur_5ffield_5fnames',['ur_field_names',['../unirec_8h.html#a98353be825cf3f1fb16c73e048ea0b74',1,'ur_static_field_specs_t::ur_field_names()'],['../unirec_8h.html#a9ef90bbaacc4b629a182cca2fe3f6ed3',1,'ur_field_specs_t::ur_field_names()']]], + ['ur_5ffield_5fsizes',['ur_field_sizes',['../unirec_8h.html#a802e8538253f5509acc14f2da2b225f6',1,'ur_static_field_specs_t::ur_field_sizes()'],['../unirec_8h.html#a91ce0528dfa853da3ca1dcd377a1ceeb',1,'ur_field_specs_t::ur_field_sizes()']]], + ['ur_5ffield_5fspecs',['ur_field_specs',['../group__urtemplate.html#ga8b963edd959e1d4bdd91d82807a384ba',1,'ur_field_specs(): unirec.c'],['../group__urtemplate.html#ga8b963edd959e1d4bdd91d82807a384ba',1,'ur_field_specs(): unirec.c']]], + ['ur_5ffield_5fspecs_5fstatic',['UR_FIELD_SPECS_STATIC',['../group__urtemplate.html#ga67e3a2f4dff881d18a6a3c8cc67b906b',1,'UR_FIELD_SPECS_STATIC(): unirec.c'],['../group__urtemplate.html#ga67e3a2f4dff881d18a6a3c8cc67b906b',1,'UR_FIELD_SPECS_STATIC(): unirec.c']]], + ['ur_5ffield_5ftype_5fsize',['ur_field_type_size',['../group__urtemplate.html#ga81f8d7af996a01f4b6e4ac086d483eb0',1,'ur_field_type_size(): unirec.c'],['../group__urtemplate.html#ga81f8d7af996a01f4b6e4ac086d483eb0',1,'ur_field_type_size(): unirec.c']]], + ['ur_5ffield_5ftype_5fstr',['ur_field_type_str',['../group__urtemplate.html#ga2a84dc8eb5478757192b2df4004c148a',1,'ur_field_type_str(): unirec.c'],['../group__urtemplate.html#ga2a84dc8eb5478757192b2df4004c148a',1,'ur_field_type_str(): unirec.c']]], + ['ur_5ffield_5ftypes',['ur_field_types',['../unirec_8h.html#ad5306965acd4764b31d6634a0947e7a2',1,'ur_static_field_specs_t::ur_field_types()'],['../unirec_8h.html#a34d9bd7272e5f6d60ba60afef4d59e82',1,'ur_field_specs_t::ur_field_types()']]], + ['ur_5flast_5fid',['ur_last_id',['../unirec_8h.html#a8489cc7746e8177392cdd13465e96547',1,'ur_static_field_specs_t::ur_last_id()'],['../unirec_8h.html#a0876b58dc84e725e78e94f0081e25c67',1,'ur_field_specs_t::ur_last_id()']]], + ['ur_5flast_5fstatically_5fdefined_5fid',['ur_last_statically_defined_id',['../unirec_8h.html#a2e28bd09fc5056730e543d023cf0a2da',1,'ur_field_specs_t']]], + ['ur_5fmemory_5ferror',['UR_MEMORY_ERROR',['../unirec_8c.html#abd6a82288d5136644ea1e3f8c68f6192',1,'unirec.c']]], + ['ur_5fundefine_5ffields',['ur_undefine_fields',['../unirec_8h.html#a217c15792290530a3e08fa5973c8ca5a',1,'ur_field_specs_t']]], + ['ur_5fvalues',['ur_values',['../ur__values_8c.html#a5ab2cb7867f37f99a594b83837e0f338',1,'ur_values.c']]] +]; diff --git a/doc/unirec/search/variables_f.html b/doc/unirec/search/variables_f.html new file mode 100644 index 00000000..cc86fb59 --- /dev/null +++ b/doc/unirec/search/variables_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/unirec/search/variables_f.js b/doc/unirec/search/variables_f.js new file mode 100644 index 00000000..540c56b5 --- /dev/null +++ b/doc/unirec/search/variables_f.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['v4_5fcount',['v4_count',['../ip__prefix__search_8h.html#a9c14d5bd160b69a18925418fd5458e9d',1,'ipps_context_t']]], + ['v4_5fprefix_5fintervals',['v4_prefix_intervals',['../ip__prefix__search_8h.html#a44092bb5524e01b875ded3d3382519ef',1,'ipps_context_t']]], + ['v6_5fcount',['v6_count',['../ip__prefix__search_8h.html#a5df4b833e1a43548fc336f86e14165ec',1,'ipps_context_t']]], + ['v6_5fprefix_5fintervals',['v6_prefix_intervals',['../ip__prefix__search_8h.html#a5b7a2546ac751e45bf7124a49e3af065',1,'ipps_context_t']]], + ['value',['value',['../ur__values_8h.html#a1cd20f78c9177f52cf003183ce9faa8d',1,'ur_values_t']]] +]; diff --git a/doc/unirec/splitbar.png b/doc/unirec/splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/doc/unirec/splitbar.png differ diff --git a/doc/unirec/structfield__spec__s-members.html b/doc/unirec/structfield__spec__s-members.html new file mode 100644 index 00000000..1f639f5c --- /dev/null +++ b/doc/unirec/structfield__spec__s-members.html @@ -0,0 +1,80 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    field_spec_s Member List
    +
    +
    + +

    This is the complete list of members for field_spec_s, including all inherited members.

    + + + + +
    idfield_spec_s
    namefield_spec_s
    sizefield_spec_s
    + + + + diff --git a/doc/unirec/structfield__spec__s.html b/doc/unirec/structfield__spec__s.html new file mode 100644 index 00000000..9f88164a --- /dev/null +++ b/doc/unirec/structfield__spec__s.html @@ -0,0 +1,103 @@ + + + + + + + +unirec: field_spec_s Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    field_spec_s Struct Reference
    +
    +
    + +

    Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm. + More...

    + +

    #include <unirec.h>

    + + + + + + + + + + + +

    +Public Attributes

    +char * name
     Name of a field.
     
    +int size
     Size of a field.
     
    +ur_field_id_t id
     ID of a field.
     
    +

    Detailed Description

    +

    Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm.

    +

    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__field__id__linked__list__s-members.html b/doc/unirec/structur__field__id__linked__list__s-members.html new file mode 100644 index 00000000..159af076 --- /dev/null +++ b/doc/unirec/structur__field__id__linked__list__s-members.html @@ -0,0 +1,79 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_field_id_linked_list_s Member List
    +
    +
    + +

    This is the complete list of members for ur_field_id_linked_list_s, including all inherited members.

    + + + +
    idur_field_id_linked_list_s
    nextur_field_id_linked_list_s
    + + + + diff --git a/doc/unirec/structur__field__id__linked__list__s.html b/doc/unirec/structur__field__id__linked__list__s.html new file mode 100644 index 00000000..184751f2 --- /dev/null +++ b/doc/unirec/structur__field__id__linked__list__s.html @@ -0,0 +1,92 @@ + + + + + + + +unirec: ur_field_id_linked_list_s Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_field_id_linked_list_s Struct Reference
    +
    +
    + + + + + + + + +

    +Public Attributes

    +ur_field_id_t id
     free id
     
    +ur_field_id_linked_list_tnext
     Pointer to next item in the linked list.
     
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__field__specs__t-members.html b/doc/unirec/structur__field__specs__t-members.html new file mode 100644 index 00000000..33485290 --- /dev/null +++ b/doc/unirec/structur__field__specs__t-members.html @@ -0,0 +1,85 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_field_specs_t Member List
    +
    + + + + + diff --git a/doc/unirec/structur__field__specs__t.html b/doc/unirec/structur__field__specs__t.html new file mode 100644 index 00000000..6c5b9915 --- /dev/null +++ b/doc/unirec/structur__field__specs__t.html @@ -0,0 +1,137 @@ + + + + + + + +unirec: ur_field_specs_t Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_field_specs_t Struct Reference
    +
    +
    + +

    UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields. + More...

    + +

    #include <unirec.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    +char ** ur_field_names
     Array of names of fields.
     
    +short * ur_field_sizes
     Array of sizes of fields.
     
    +ur_field_type_t * ur_field_types
     Array of types of fields.
     
    +ur_field_id_t ur_last_statically_defined_id
     Last statically defined field by UR_FIELDS(...)
     
    +ur_field_id_t ur_last_id
     The highest ID of a field + 1.
     
    ur_field_id_t ur_allocated_fields
     
    +ur_field_id_linked_list_tur_undefine_fields
     linked list of free (undefined) IDs
     
    +uint8_t intialized
     If the UniRec is initialized by function ur_init variable is set to UR_INITIALIZED, otherwise 0.
     
    +

    Detailed Description

    +

    UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields.

    +

    Member Data Documentation

    + +

    ◆ ur_allocated_fields

    + +
    +
    + + + + +
    ur_field_id_t ur_field_specs_t::ur_allocated_fields
    +
    +

    Count of fields which is allocated (ur_allocated_fields - ur_last_id = remaining fields count)

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__links__t-members.html b/doc/unirec/structur__links__t-members.html new file mode 100644 index 00000000..8f9cc567 --- /dev/null +++ b/doc/unirec/structur__links__t-members.html @@ -0,0 +1,80 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_links_t Member List
    +
    +
    + +

    This is the complete list of members for ur_links_t, including all inherited members.

    + + + + +
    link_count (defined in ur_links_t)ur_links_t
    link_indexes (defined in ur_links_t)ur_links_t
    link_mask (defined in ur_links_t)ur_links_t
    + + + + diff --git a/doc/unirec/structur__links__t.html b/doc/unirec/structur__links__t.html new file mode 100644 index 00000000..5ae722c4 --- /dev/null +++ b/doc/unirec/structur__links__t.html @@ -0,0 +1,100 @@ + + + + + + + +unirec: ur_links_t Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_links_t Struct Reference
    +
    +
    + +

    Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n). + More...

    + +

    #include <links.h>

    + + + + + + + + +

    +Public Attributes

    +unsigned int link_count
     
    +uint64_t link_mask
     
    +uint64_t * link_indexes
     
    +

    Detailed Description

    +

    Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n).

    +

    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__static__field__specs__t-members.html b/doc/unirec/structur__static__field__specs__t-members.html new file mode 100644 index 00000000..b5d80dc8 --- /dev/null +++ b/doc/unirec/structur__static__field__specs__t-members.html @@ -0,0 +1,81 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_static_field_specs_t Member List
    +
    + + + + + diff --git a/doc/unirec/structur__static__field__specs__t.html b/doc/unirec/structur__static__field__specs__t.html new file mode 100644 index 00000000..49c1794e --- /dev/null +++ b/doc/unirec/structur__static__field__specs__t.html @@ -0,0 +1,107 @@ + + + + + + + +unirec: ur_static_field_specs_t Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_static_field_specs_t Struct Reference
    +
    +
    + +

    UniRec default field list It contains all fields which are specified statically in source code of a module. This structure is passed to ur_init() + More...

    + +

    #include <unirec.h>

    + + + + + + + + + + + + + + +

    +Public Attributes

    +char ** ur_field_names
     Array of names of fields.
     
    +short * ur_field_sizes
     Array of sizes of fields.
     
    +ur_field_type_t * ur_field_types
     Array of types of fields.
     
    +ur_field_id_t ur_last_id
     Last specified ID.
     
    +

    Detailed Description

    +

    UniRec default field list It contains all fields which are specified statically in source code of a module. This structure is passed to ur_init()

    +

    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__template__t-members.html b/doc/unirec/structur__template__t-members.html new file mode 100644 index 00000000..939c8047 --- /dev/null +++ b/doc/unirec/structur__template__t-members.html @@ -0,0 +1,85 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_template_t Member List
    +
    + + + + + diff --git a/doc/unirec/structur__template__t.html b/doc/unirec/structur__template__t.html new file mode 100644 index 00000000..3f171ea9 --- /dev/null +++ b/doc/unirec/structur__template__t.html @@ -0,0 +1,123 @@ + + + + + + + +unirec: ur_template_t Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_template_t Struct Reference
    +
    +
    + +

    UniRec template. It contains a table mapping a field to its position in an UniRec record. + More...

    + +

    #include <unirec.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    +uint16_t * offset
     Table of offsets.
     
    +uint16_t offset_size
     size of offset table.
     
    +int16_t * ids
     Array of ids in template.
     
    +uint16_t first_dynamic
     First dynamic (variable-length) field. Index to the ids array.
     
    +uint16_t count
     Count of fields in template.
     
    +uint16_t static_size
     Size of static part.
     
    +ur_tmplt_direction direction
     Direction of data input, output, bidirection, no direction.
     
    +uint32_t ifc_out
     output interface number (stored only if the direction == UR_TMPLT_DIRECTION_BI)
     
    +

    Detailed Description

    +

    UniRec template. It contains a table mapping a field to its position in an UniRec record.

    +

    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/structur__values__s-members.html b/doc/unirec/structur__values__s-members.html new file mode 100644 index 00000000..c9cafc62 --- /dev/null +++ b/doc/unirec/structur__values__s-members.html @@ -0,0 +1,104 @@ + + + + + + +unirec: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.3 +
    +
    +
    + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ur_values_s Member List
    +
    +
    + +

    This is the complete list of members for ur_values_s, including all inherited members.

    + + + + +
    descriptionur_values_s
    nameur_values_s
    valueur_values_s
    + + + + diff --git a/doc/unirec/structur__values__s.html b/doc/unirec/structur__values__s.html new file mode 100644 index 00000000..ea9e2da7 --- /dev/null +++ b/doc/unirec/structur__values__s.html @@ -0,0 +1,127 @@ + + + + + + +unirec: ur_values_s Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.3 +
    +
    +
    + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_values_s Struct Reference
    +
    +
    + +

    Values names and descriptions It contains a table mapping a value to name and description. + More...

    + +

    #include <ur_values.h>

    + + + + + + + + + + + +

    +Public Attributes

    +int32_t value
     Numeric Value.
     
    +char * name
     Name of Value.
     
    +char * description
     Description of Value.
     
    +

    Detailed Description

    +

    Values names and descriptions It contains a table mapping a value to name and description.

    +

    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/doc/unirec/sync_off.png b/doc/unirec/sync_off.png new file mode 100644 index 00000000..3b443fc6 Binary files /dev/null and b/doc/unirec/sync_off.png differ diff --git a/doc/unirec/sync_on.png b/doc/unirec/sync_on.png new file mode 100644 index 00000000..e08320fb Binary files /dev/null and b/doc/unirec/sync_on.png differ diff --git a/doc/unirec/tab_a.png b/doc/unirec/tab_a.png new file mode 100644 index 00000000..3b725c41 Binary files /dev/null and b/doc/unirec/tab_a.png differ diff --git a/doc/unirec/tab_b.png b/doc/unirec/tab_b.png new file mode 100644 index 00000000..e2b4a863 Binary files /dev/null and b/doc/unirec/tab_b.png differ diff --git a/doc/unirec/tab_h.png b/doc/unirec/tab_h.png new file mode 100644 index 00000000..fd5cb705 Binary files /dev/null and b/doc/unirec/tab_h.png differ diff --git a/doc/unirec/tab_s.png b/doc/unirec/tab_s.png new file mode 100644 index 00000000..ab478c95 Binary files /dev/null and b/doc/unirec/tab_s.png differ diff --git a/doc/unirec/tabs.css b/doc/unirec/tabs.css new file mode 100644 index 00000000..a28614b8 --- /dev/null +++ b/doc/unirec/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#doc-content{overflow:auto;display:block;padding:0;margin:0;-webkit-overflow-scrolling:touch}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file diff --git a/doc/unirec/unionip__addr__u-members.html b/doc/unirec/unionip__addr__u-members.html new file mode 100644 index 00000000..4bd5eedf --- /dev/null +++ b/doc/unirec/unionip__addr__u-members.html @@ -0,0 +1,82 @@ + + + + + + + +unirec: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    +
    ip_addr_u Member List
    +
    +
    + +

    This is the complete list of members for ip_addr_u, including all inherited members.

    + + + + + + +
    bytesip_addr_u
    ui16ip_addr_u
    ui32ip_addr_u
    ui64ip_addr_u
    ui8ip_addr_u
    + + + + diff --git a/doc/unirec/unionip__addr__u.html b/doc/unirec/unionip__addr__u.html new file mode 100644 index 00000000..614fae65 --- /dev/null +++ b/doc/unirec/unionip__addr__u.html @@ -0,0 +1,175 @@ + + + + + + + +unirec: ip_addr_u Union Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    unirec +  2.2.5 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ip_addr_u Union Reference
    +
    +
    + +

    #include <ipaddr.h>

    + + + + + + + + + + + + +

    +Public Attributes

    uint8_t bytes [16]
     
    uint8_t ui8 [16]
     
    uint16_t ui16 [8]
     
    uint32_t ui32 [4]
     
    uint64_t ui64 [2]
     
    +

    Detailed Description

    +

    IP address data type.

    +

    It is 128b data type. User can access to parts of the IP address in several ways.

    +

    Member Data Documentation

    + +

    ◆ bytes

    + +
    +
    + + + + +
    uint8_t ip_addr_u::bytes[16]
    +
    +

    16x 8b numbers

    + +
    +
    + +

    ◆ ui16

    + +
    +
    + + + + +
    uint16_t ip_addr_u::ui16[8]
    +
    +

    8x 16b numbers

    + +
    +
    + +

    ◆ ui32

    + +
    +
    + + + + +
    uint32_t ip_addr_u::ui32[4]
    +
    +

    4x 32b numbers

    + +
    +
    + +

    ◆ ui64

    + +
    +
    + + + + +
    uint64_t ip_addr_u::ui64[2]
    +
    +

    2x 64b numbers

    + +
    +
    + +

    ◆ ui8

    + +
    +
    + + + + +
    uint8_t ip_addr_u::ui8[16]
    +
    +

    same as bytes

    + +
    +
    +
    The documentation for this union was generated from the following file: +
    + + + + diff --git a/doc/unirec/unirec2csv_8c.html b/doc/unirec/unirec2csv_8c.html new file mode 100644 index 00000000..1befb4f9 --- /dev/null +++ b/doc/unirec/unirec2csv_8c.html @@ -0,0 +1,151 @@ + + + + + + + +UniRec: unirec2csv.c File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    unirec2csv.c File Reference
    +
    +
    +
    #include <stdint.h>
    +#include <inttypes.h>
    +#include <ctype.h>
    +#include <time.h>
    +#include "unirec2csv.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + +

    +Functions

    urcsv_turcsv_init (ur_template_t *tmplt, char delimiter)
     
    void urcsv_free (urcsv_t **urcsv)
     
    char * urcsv_header (urcsv_t *urcsv)
     
    int urcsv_value (char *dst, uint32_t size, void *ptr, int type, int field_len)
     
    int urcsv_field (char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
     
    char * urcsv_record (urcsv_t *urcsv, const void *rec)
     
    +

    Function Documentation

    + +

    ◆ urcsv_value()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int urcsv_value (char * dst,
    uint32_t size,
    void * ptr,
    int type,
    int field_len 
    )
    +
    + +

    Definition at line 45 of file unirec2csv.c.

    + +
    +
    +
    + + + + diff --git a/doc/unirec/unirec2csv_8c_source.html b/doc/unirec/unirec2csv_8c_source.html new file mode 100644 index 00000000..a6f0916e --- /dev/null +++ b/doc/unirec/unirec2csv_8c_source.html @@ -0,0 +1,132 @@ + + + + + + + +UniRec: unirec2csv.c Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    unirec2csv.c
    +
    +
    +Go to the documentation of this file.
    1 #include <stdint.h>
    2 #include <inttypes.h>
    3 #include <ctype.h>
    4 #include <time.h>
    5 #include "unirec2csv.h"
    6 
    7 urcsv_t *urcsv_init(ur_template_t *tmplt, char delimiter)
    8 {
    9  if (tmplt == NULL) {
    10  return NULL;
    11  }
    12  urcsv_t *s = malloc(sizeof(urcsv_t));
    13  if (s != NULL) {
    14  s->tmplt = tmplt;
    15  s->delimiter = delimiter;
    16  /* default size of buffer */
    17  s->buffer_size = 4096;
    18  s->free_space = s->buffer_size;
    19  s->buffer = calloc(s->buffer_size, sizeof(s->buffer[0]));
    20  if (s->buffer == NULL) {
    21  free(s);
    22  return NULL;
    23  }
    24  }
    25  return s;
    26 }
    27 
    28 void urcsv_free(urcsv_t **urcsv)
    29 {
    30  if (urcsv != NULL && *urcsv != NULL) {
    31  free((*urcsv)->buffer);
    32  free(*urcsv);
    33  (*urcsv) = NULL;
    34  }
    35 }
    36 
    37 char *urcsv_header(urcsv_t *urcsv)
    38 {
    39  if (urcsv == NULL) {
    40  return NULL;
    41  }
    42  return ur_template_string_delimiter(urcsv->tmplt, urcsv->delimiter);
    43 }
    44 
    45 int urcsv_value(char *dst, uint32_t size, void *ptr, int type, int field_len)
    46 {
    47  int written = 0;
    48  char *p = dst;
    49 
    50  // Static field - check what type is it and use appropriate format
    51  switch (type) {
    52  case UR_TYPE_UINT8:
    53  written = snprintf(p, size, "%" PRIu8, *(uint8_t*) ptr);
    54  break;
    55  case UR_TYPE_UINT16:
    56  written = snprintf(p, size, "%" PRIu16, *(uint16_t*) ptr);
    57  break;
    58  case UR_TYPE_UINT32:
    59  written = snprintf(p, size, "%" PRIu32, *(uint32_t*) ptr);
    60  break;
    61  case UR_TYPE_UINT64:
    62  written = snprintf(p, size, "%" PRIu64, *(uint64_t*) ptr);
    63  break;
    64  case UR_TYPE_INT8:
    65  written = snprintf(p, size, "%" PRIi8, *(int8_t*) ptr);
    66  break;
    67  case UR_TYPE_INT16:
    68  written = snprintf(p, size, "%" PRIi16, *(int16_t*) ptr);
    69  break;
    70  case UR_TYPE_INT32:
    71  written = snprintf(p, size, "%" PRIi32, *(int32_t*) ptr);
    72  break;
    73  case UR_TYPE_INT64:
    74  written = snprintf(p, size, "%" PRIi64, *(int64_t*) ptr);
    75  break;
    76  case UR_TYPE_CHAR:
    77  written = snprintf(p, size, "%c", *(char*) ptr);
    78  break;
    79  case UR_TYPE_FLOAT:
    80  written = snprintf(p, size, "%f", *(float*) ptr);
    81  break;
    82  case UR_TYPE_DOUBLE:
    83  written = snprintf(p, size, "%f", *(double*) ptr);
    84  break;
    85  case UR_TYPE_IP:
    86  {
    87  // IP address - convert to human-readable format and print
    88  char str[46];
    89  ip_to_str((ip_addr_t*) ptr, str);
    90  written = snprintf(p, size, "%s", str);
    91  }
    92  break;
    93  case UR_TYPE_MAC:
    94  {
    95  // MAC address - convert to human-readable format and print
    96  char str[MAC_STR_LEN];
    97  mac_to_str((mac_addr_t *) ptr, str);
    98  written = snprintf(p, size, "%s", str);
    99  }
    100  break;
    101  case UR_TYPE_TIME:
    102  {
    103  // Timestamp - convert to human-readable format and print
    104  time_t sec = ur_time_get_sec(*(ur_time_t*) ptr);
    105  int usec = ur_time_get_usec(*(ur_time_t*) ptr);
    106  char str[40];
    107  strftime(str, 39, "%FT%T", gmtime(&sec));
    108  written = snprintf(p, size, "%s.%06i", str, usec);
    109  }
    110  break;
    111  default:
    112  {
    113  // Unknown type - print the value in hex
    114  strncpy(p, "0x", size);
    115  written += 2;
    116  p += 2;
    117  for (int i = 0; i < field_len && written < size; i++) {
    118  int w = snprintf(p, size - written, "%02x", ((unsigned char *) ptr)[i]);
    119  written += w;
    120  p += w;
    121  }
    122  }
    123  break;
    124  } // case (field type)
    125 
    126  return written;
    127 }
    128 
    129 int urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
    130 {
    131  int written = 0;
    132  char *p = dst;
    133 
    134  // Get pointer to the field (valid for static fields only)
    135  void *ptr = ur_get_ptr_by_id(tmplt, rec, id);
    136  int type = ur_get_type(id);
    137 
    138  if (type == UR_TYPE_STRING) {
    139  // Printable string - print it as it is
    140  int fs = ur_get_var_len(tmplt, rec, id);
    141  char *data = ur_get_ptr_by_id(tmplt, rec, id);
    142  *(p++) = '"';
    143  written++;
    144 
    145  while (fs-- && (written < size)) {
    146  switch (*data) {
    147  case '\n': // Replace newline with space
    148  /* TODO / FIXME possible bug - info lost */
    149  *(p++) = ' ';
    150  written++;
    151  break;
    152  case '"' : // Double quotes in string
    153  *(p++) = '"';
    154  written++;
    155  *(p++) = '"';
    156  written++;
    157  break;
    158  default: // Check if character is printable
    159  if (isprint(*data)) {
    160  *(p++) = *data;
    161  written++;
    162  }
    163  }
    164  data++;
    165  }
    166  *(p++) = '"';
    167  written++;
    168  } else if (type == UR_TYPE_BYTES) {
    169  // Generic string of bytes - print each byte as two hex digits
    170  int fs = ur_get_var_len(tmplt, rec, id);
    171  unsigned char *data = ur_get_ptr_by_id(tmplt, rec, id);
    172  while (fs-- && (written < size)) {
    173  int w = snprintf(p, size, "%02x", *data++);
    174  written += w;
    175  p += w;
    176  }
    177  } else if (ur_is_varlen(id)) {
    178  int elem_type = ur_array_get_elem_type(id);
    179  int elem_size = ur_array_get_elem_size(id);
    180  int elem_cnt = ur_array_get_elem_cnt(tmplt, rec, id);
    181  int array_len = ur_get_len(tmplt, rec, id);
    182  int i;
    183 
    184  if (written + 2 < size) {
    185  written += 2;
    186  *(p++) = '[';
    187  for (i = 0; i < elem_cnt; i++) {
    188  int w = urcsv_value(p, size - written, ((char *) ptr) + i * elem_size, elem_type, array_len);
    189  written += w;
    190  p += w;
    191  if (written + 1 >= size) {
    192  /* not enough space */
    193  return 0;
    194  }
    195  if (i + 1 != elem_cnt) {
    196  *(p++) = '|';
    197  written++;
    198  }
    199  }
    200  *(p++) = ']';
    201  }
    202  } else {
    203  return urcsv_value(p, size, ptr, type, ur_get_len(tmplt, rec, id));
    204  }
    205 
    206  return written;
    207 }
    208 
    209 char *urcsv_record(urcsv_t *urcsv, const void *rec)
    210 {
    211  int delim = 0;
    212  int i = 0, written = 0;
    213  ur_field_id_t id = 0;
    214 
    215  if (urcsv == NULL || rec == NULL) {
    216  return NULL;
    217  }
    218 
    219  urcsv->curpos = urcsv->buffer;
    220  urcsv->free_space = urcsv->buffer_size;
    221 
    222  // Iterate over all output fields
    223  while ((id = ur_iter_fields_record_order(urcsv->tmplt, i++)) != UR_ITER_END) {
    224  if (delim != 0) {
    225  *(urcsv->curpos++) = urcsv->delimiter;
    226  urcsv->free_space -= 1;
    227  }
    228 
    229  delim = 1;
    230 reallocated:
    231  if (ur_is_present(urcsv->tmplt, id)) {
    232  // Static field - check what type is it and use appropriate format
    233  written = urcsv_field(urcsv->curpos, urcsv->free_space, rec, id, urcsv->tmplt);
    234 
    235  urcsv->free_space -= written;
    236  urcsv->curpos += written;
    237  } else {
    238  continue;
    239  }
    240 
    241  if (urcsv->free_space < 100 || (written == 0 && ur_get_var_len(urcsv->tmplt, rec, id) != 0)) {
    242  urcsv->free_space += urcsv->buffer_size / 2;
    243  urcsv->buffer_size += urcsv->buffer_size / 2;
    244  uint32_t offset = urcsv->curpos - urcsv->buffer;
    245  void *temp = realloc(urcsv->buffer, urcsv->buffer_size);
    246  if (temp != NULL) {
    247  urcsv->buffer = temp;
    248  urcsv->curpos = urcsv->buffer + offset;
    249  } else {
    250  return NULL;
    251  }
    252  if (written == 0) {
    253  goto reallocated;
    254  }
    255  }
    256  } // loop over fields
    257 
    258  *urcsv->curpos = 0;
    259  return strdup(urcsv->buffer);
    260 }
    261 
    Definition of UniRec API to create CSV-like representation of UniRec data.
    +
    var-len fields (string where only printable characters are expected; &#39;\0&#39; at the end should NOT be in...
    Definition: unirec.h:96
    +
    int (8b)
    Definition: unirec.h:102
    +
    float (32b)
    Definition: unirec.h:107
    +
    #define ur_get_type(field_id)
    Get type of UniRec field Get type of any UniRec defined field.
    Definition: unirec.h:388
    +
    int (64b)
    Definition: unirec.h:106
    +
    char * urcsv_record(urcsv_t *urcsv, const void *rec)
    Definition: unirec2csv.c:209
    +
    unsigned int (16b)
    Definition: unirec.h:101
    +
    ur_template_t * tmplt
    Definition: unirec2csv.h:51
    +
    *uint16_t * ur_get_ptr_by_id(tmplt2, buffer2, new_id))
    +
    MAC address (48b)
    Definition: unirec.h:110
    +
    uint32_t buffer_size
    Definition: unirec2csv.h:66
    +
    char * urcsv_header(urcsv_t *urcsv)
    Definition: unirec2csv.c:37
    +
    INLINE void mac_to_str(const mac_addr_t *addr, char *str)
    Definition: macaddr.h:129
    +
    uint64_t ur_time_t
    Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoc...
    Definition: ur_time.h:61
    +
    #define ur_time_get_sec(time)
    Get number of seconds from ur_time_t.
    Definition: ur_time.h:124
    +
    free(rec)
    +
    int (32b)
    Definition: unirec.h:104
    +
    #define ur_get_len(tmplt, rec, field)
    Get length of UniRec field Get actual length of fixed or variable-length UniRec field.
    Definition: unirec.h:506
    +
    IP address (128b)
    Definition: unirec.h:109
    +
    unsigned int (64b)
    Definition: unirec.h:105
    +
    void * rec
    +
    mac_addr_t
    Definition: macaddr.h:75
    +
    #define ur_array_get_elem_size(field_id)
    Get size of a single element of UniRec field.
    Definition: unirec.h:535
    +
    char * buffer
    Definition: unirec2csv.h:56
    +
    char delimiter
    Definition: unirec2csv.h:76
    +
    double (64b)
    Definition: unirec.h:108
    +
    #define ur_is_present(tmplt, field_id)
    Is given field present in given template? Return true (non-zero value) if given template contains fie...
    Definition: unirec.h:638
    + +
    #define UR_ITER_END
    Last value in iterating through the fields.
    Definition: unirec.h:76
    +
    uint32_t free_space
    Definition: unirec2csv.h:71
    +
    #define ur_get_var_len(tmplt, rec, field_id)
    Get size of a variable sized field in the record. Get size of a variable-length field in the record...
    Definition: unirec.h:474
    +
    int16_t ur_field_id_t
    Type of UniRec field identifiers.
    Definition: unirec.h:136
    +
    #define ur_is_varlen(field_id)
    Is given field variable-length? Return true (non-zero value) if given ID refers to a field with varia...
    Definition: unirec.h:646
    +
    #define ur_array_get_elem_cnt(tmplt, rec, field_id)
    Get number of elements stored in an UniRec array.
    Definition: unirec.h:546
    +
    var-len fields (generic string of bytes)
    Definition: unirec.h:97
    +
    unsigned int (32b)
    Definition: unirec.h:103
    +
    char * curpos
    Definition: unirec2csv.h:61
    +
    #define MAC_STR_LEN
    Definition: macaddr.h:57
    +
    ur_field_type_t
    Definition: unirec.h:95
    +
    INLINE void ip_to_str(const ip_addr_t *addr, char *str)
    Definition: ipaddr.h:325
    +
    char * ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter)
    Get UniRec specifier of the tmplt template with delimiter between fields.
    Definition: unirec.c:253
    +
    urcsv_t * urcsv_init(ur_template_t *tmplt, char delimiter)
    Definition: unirec2csv.c:7
    +
    time (64b)
    Definition: unirec.h:111
    +
    int urcsv_value(char *dst, uint32_t size, void *ptr, int type, int field_len)
    Definition: unirec2csv.c:45
    +
    char
    Definition: unirec.h:98
    +
    #define ur_time_get_usec(time)
    Get number of microeconds from ur_time_t.
    Definition: ur_time.h:139
    +
    unsigned int (8b)
    Definition: unirec.h:99
    +
    int urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
    Definition: unirec2csv.c:129
    +
    UniRec template. It contains a table mapping a field to its position in an UniRec record...
    Definition: unirec.h:191
    + +
    void urcsv_free(urcsv_t **urcsv)
    Definition: unirec2csv.c:28
    +
    int (8b)
    Definition: unirec.h:100
    +
    #define ur_array_get_elem_type(field_id)
    Get type of an element stored in an UniRec array.
    Definition: unirec.h:555
    +
    ur_iter_t ur_iter_fields_record_order(const ur_template_t *tmplt, int index)
    Iterate over fields of a template This function can be used to iterate over all fields of a given tem...
    Definition: unirec.c:1306
    +
    + + + + diff --git a/doc/unirec/unirec2csv_8h.html b/doc/unirec/unirec2csv_8h.html new file mode 100644 index 00000000..6f51e688 --- /dev/null +++ b/doc/unirec/unirec2csv_8h.html @@ -0,0 +1,111 @@ + + + + + + + +UniRec: unirec2csv.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    unirec2csv.h File Reference
    +
    +
    + +

    Definition of UniRec API to create CSV-like representation of UniRec data. +More...

    +
    #include "unirec.h"
    +
    +

    Go to the source code of this file.

    + + + + +

    +Data Structures

    struct  urcsv_t
     
    + + + + + + + + + + + +

    +Functions

    urcsv_turcsv_init (ur_template_t *tmplt, char delimiter)
     
    void urcsv_free (urcsv_t **urcsv)
     
    char * urcsv_header (urcsv_t *urcsv)
     
    char * urcsv_record (urcsv_t *urcsv, const void *rec)
     
    int urcsv_field (char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
     
    +

    Detailed Description

    +

    Definition of UniRec API to create CSV-like representation of UniRec data.

    +
    Author
    Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
    +
    Date
    2019
    + +

    Definition in file unirec2csv.h.

    +
    + + + + diff --git a/doc/unirec/unirec2csv_8h_source.html b/doc/unirec/unirec2csv_8h_source.html new file mode 100644 index 00000000..c7bc9e48 --- /dev/null +++ b/doc/unirec/unirec2csv_8h_source.html @@ -0,0 +1,93 @@ + + + + + + + +UniRec: unirec2csv.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    unirec2csv.h
    +
    +
    +Go to the documentation of this file.
    1 
    7 /*
    8  * Copyright (C) 2019 CESNET
    9  *
    10  * SPDX-License-Identifier: BSD-3-Clause
    11  *
    12  */
    13 
    14 #ifndef _UNIREC2CSV_H_
    15 #define _UNIREC2CSV_H_
    16 
    17 #include "unirec.h"
    18 
    19 #ifdef __cplusplus
    20 extern "C" {
    21 #endif
    22 
    47 typedef struct urcsv_s {
    52 
    56  char *buffer;
    57 
    61  char *curpos;
    62 
    66  uint32_t buffer_size;
    67 
    71  uint32_t free_space;
    72 
    76  char delimiter;
    77 } urcsv_t;
    78 
    88 urcsv_t *urcsv_init(ur_template_t *tmplt, char delimiter);
    89 
    96 void urcsv_free(urcsv_t **urcsv);
    97 
    105 char *urcsv_header(urcsv_t *urcsv);
    106 
    115 char *urcsv_record(urcsv_t *urcsv, const void *rec);
    116 
    128 int urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt);
    129 /* unirec2csv */
    133 
    134 #ifdef __cplusplus
    135 } // extern "C"
    136 #endif
    137 
    138 #endif
    139 
    char * urcsv_record(urcsv_t *urcsv, const void *rec)
    Definition: unirec2csv.c:209
    +
    ur_template_t * tmplt
    Definition: unirec2csv.h:51
    +
    uint32_t buffer_size
    Definition: unirec2csv.h:66
    +
    char * urcsv_header(urcsv_t *urcsv)
    Definition: unirec2csv.c:37
    +
    void * rec
    +
    char * buffer
    Definition: unirec2csv.h:56
    +
    char delimiter
    Definition: unirec2csv.h:76
    +
    uint32_t free_space
    Definition: unirec2csv.h:71
    +
    Definition of UniRec structures and functions.
    +
    char * curpos
    Definition: unirec2csv.h:61
    +
    ur_field_type_t
    Definition: unirec.h:95
    +
    urcsv_t * urcsv_init(ur_template_t *tmplt, char delimiter)
    Definition: unirec2csv.c:7
    +
    int urcsv_field(char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt)
    Definition: unirec2csv.c:129
    +
    UniRec template. It contains a table mapping a field to its position in an UniRec record...
    Definition: unirec.h:191
    + +
    void urcsv_free(urcsv_t **urcsv)
    Definition: unirec2csv.c:28
    +
    + + + + diff --git a/doc/unirec/unirec_8c.html b/doc/unirec/unirec_8c.html new file mode 100644 index 00000000..6bb2ea2f --- /dev/null +++ b/doc/unirec/unirec_8c.html @@ -0,0 +1,674 @@ + + + + + + + +UniRec: unirec.c File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    unirec.c File Reference
    +
    +
    + +

    Definition of UniRec structures and functions. +More...

    +
    #include <stdlib.h>
    +#include <stdio.h>
    +#include <inttypes.h>
    +#include <time.h>
    +#include <string.h>
    +#include <regex.h>
    +#include <assert.h>
    +#include <ctype.h>
    +#include "unirec.h"
    +#include <libtrap/trap.h>
    +#include "ur_values.c"
    +#include "inline.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + +

    +Macros

    #define _DEFAULT_SOURCE
     
    #define _BSD_SOURCE
     
    #define _XOPEN_SOURCE
     
    #define __USE_XOPEN
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    INLINE_IMPL int ip_is4 (const ip_addr_t *addr)
     
    INLINE_IMPL int ip_is6 (const ip_addr_t *addr)
     
    INLINE_IMPL uint32_t ip_get_v4_as_int (ip_addr_t *addr)
     
    INLINE_IMPL char * ip_get_v4_as_bytes (const ip_addr_t *addr)
     
    INLINE_IMPL ip_addr_t ip_from_int (uint32_t i)
     
    INLINE_IMPL ip_addr_t ip_from_4_bytes_be (char b[4])
     
    INLINE_IMPL ip_addr_t ip_from_4_bytes_le (char b[4])
     
    INLINE_IMPL ip_addr_t ip_from_16_bytes_be (char b[16])
     
    INLINE_IMPL ip_addr_t ip_from_16_bytes_le (char b[16])
     
    INLINE_IMPL int ip_cmp (const ip_addr_t *addr1, const ip_addr_t *addr2)
     
    INLINE_IMPL int ip_from_str (const char *str, ip_addr_t *addr)
     
    INLINE_IMPL void ip_to_str (const ip_addr_t *addr, char *str)
     
    INLINE_IMPL mac_addr_t mac_from_bytes (uint8_t *array)
     
    INLINE_IMPL int mac_from_str (const char *str, mac_addr_t *addr)
     
    INLINE_IMPL int mac_cmp (const mac_addr_t *addr1, const mac_addr_t *addr2)
     
    INLINE_IMPL void mac_to_str (const mac_addr_t *addr, char *str)
     
    INLINE_IMPL void mac_to_bytes (const mac_addr_t *addr, uint8_t *array)
     
    int ur_init (ur_static_field_specs_t field_specs_static)
     Initialize UniRec structures Initialize UniRec structures. Function is called during defining first own field. More...
     
    char * ur_template_string_delimiter (const ur_template_t *tmplt, int delimiter)
     Get UniRec specifier of the tmplt template with delimiter between fields. More...
     
    int ur_get_empty_id ()
     Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures. More...
     
    int ur_get_field_type_from_str (const char *type)
     
    const char * ur_get_type_and_name_from_string (const char *source, char **name, char **type, int *length_name, int *length_type)
     
    char * ur_ifc_data_fmt_to_field_names (const char *ifc_data_fmt)
     Parses field names from data format Function parses field names from data format and returns pointer to new allocated string. Example: "type1 name1,type2 name2" => "name1,name2" New string has to be freed by user. More...
     
    ur_template_tur_expand_template (const char *ifc_data_fmt, ur_template_t *tmplt)
     Expand UniRec template Expand existing UniRec template by a string containing types and names of its fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
     
    int ur_define_set_of_fields (const char *ifc_data_fmt)
     Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2". More...
     
    ur_template_tur_define_fields_and_update_template (const char *ifc_data_fmt, ur_template_t *tmplt)
     Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields) and create new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
     
    ur_template_tur_create_template_from_ifc_spec (const char *ifc_data_fmt)
     Create UniRec template from data format string. Creates new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent).. More...
     
    int ur_define_field (const char *name, ur_field_type_t type)
     Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structures. If the field already exists (name and type are equal) it only returns its ID. More...
     
    int ur_undefine_field_by_id (ur_field_id_t field_id)
     Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
     
    int ur_undefine_field (const char *name)
     Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
     
    void ur_finalize ()
     Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program's end. This function has to be called if some fields are defined during run-time, otherwise this function is needless. More...
     
    int ur_get_id_by_name (const char *name)
     Get ID of a field by its name Get ID of a field by its name. More...
     
    int compare_fields (const void *field1, const void *field2)
     Compare fields Compare two fields. This function is for sorting the fields in the right order. First by sizes (larger first) and then by names. More...
     
    ur_template_tur_ctx_create_input_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
     Create UniRec template and set it to input interface on specified context Creates UniRec template, same like ur_create_input_template, but context is specified. More...
     
    ur_template_tur_ctx_create_output_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
     Create UniRec template and set it to output interface on specified context Creates UniRec template, same like ur_create_output_template, but context is specified. More...
     
    int ur_ctx_set_output_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
     Set UniRec template to ouput interface on specified context. More...
     
    int ur_ctx_set_input_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
     Set UniRec template to input interface on specified context. More...
     
    ur_template_tur_ctx_create_bidirectional_template (trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
     Create UniRec template and set it to input and output interface on specified context Creates UniRec template, same like ur_create_bidirectional_template, but context is specified. More...
     
    ur_template_tur_create_template (const char *fields, char **errstr)
     Create UniRec template Create new UniRec template specified by a string containing names of its fields separated by commas. Example spec-string: "SRC_IP,DST_IP,SRC_PORT,DST_PORT,PROTOCOL,PACKETS" Order of fields is not important (templates with the same set of fields are equivalent). Template created by this function should be destroyed by ur_free_template. More...
     
    void ur_free_template (ur_template_t *tmplt)
     Destroy UniRec template Free all memory allocated for a template created previously by ur_create_template. More...
     
    int ur_template_compare (const ur_template_t *tmpltA, const ur_template_t *tmpltB)
     Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is not compared). More...
     
    void ur_print_template (ur_template_t *tmplt)
     Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging). If template does not contain any dynamic fields, print '-' instead. param[in] tmplt pointer to the template. More...
     
    void ur_var_change_size (const ur_template_t *tmplt, void *rec, int field_id, int new_val_len)
     
    int ur_set_var (const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
     Set content of variable-length UniRec field Copy given data into variable-length UniRec field, set its offset and length in a record and move data which are behind this field. For better performance use function ur_clear_varlen, before setting all variable fields in record. More...
     
    int ur_array_resize (const ur_template_t *tmplt, void *rec, int field_id, int len)
     Change length of a array field. More...
     
    char * ur_array_append_get_ptr (const ur_template_t *tmplt, void *rec, int field_id)
     Allocate new element at the end of array and return its pointer. More...
     
    void ur_clear_varlen (const ur_template_t *tmplt, void *rec)
     Clear variable-length part of a record. For better performance of setting content to variable-length fields, use this function before setting of all the variable-length fields. This function will clear all the variable-length fields, so they don't have to be moved in memory during setting of them. More...
     
    uint16_t ur_rec_varlen_size (const ur_template_t *tmplt, const void *rec)
     Get size of variable sized part of UniRec record Get total size of all variable-length fields in an UniRec record. More...
     
    void * ur_create_record (const ur_template_t *tmplt, uint16_t max_var_size)
     
    void ur_free_record (void *record)
     
    char * ur_get_var_as_str (const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
     Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()! More...
     
    void * ur_clone_record (const ur_template_t *tmplt, const void *src)
     Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it with the data given by parameter. More...
     
    void ur_copy_fields (const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
     Copy data from one UniRec record to another. Copies all fields present in both templates from src to dst. The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src. "dst" must point to a memory of enough size. More...
     
    ur_iter_t ur_iter_fields (const ur_template_t *tmplt, ur_iter_t id)
     Iterate over fields of a template in order of a record This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned. Example usage: ur_field_id_t id = UR_ITER_BEGIN while ((id = ur_iter_fields(&tmplt, id)) != UR_ITER_END) { ... } The order of fields is given by the order in which they are defined. More...
     
    ur_iter_t ur_iter_fields_record_order (const ur_template_t *tmplt, int index)
     Iterate over fields of a template This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template. Example usage: int i = 0; while ((id = ur_iter_fields(&tmplt, i++)) != UR_ITER_END) { ... } The order of fields is given by the order in the record. More...
     
    int ur_set_array_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
     Set value of a UniRec array field. More...
     
    int ur_set_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
     Set value of a UniRec field. More...
     
    uint8_t ur_time_from_string (ur_time_t *ur, const char *str)
     
    char * ur_cpy_string (const char *str)
     Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user. More...
     
    const char * ur_values_get_name_start_end (uint32_t start, uint32_t end, int32_t value)
     Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
     
    const char * ur_values_get_description_start_end (uint32_t start, uint32_t end, int32_t value)
     Returns description of specified value (Helper function) Helper function for ur_values_get_description. This function returns description of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
     
    ur_links_tur_create_links (const char *mask)
     Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links. More...
     
    void ur_free_links (ur_links_t *links)
     Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links. More...
     
    INLINE_IMPL int ur_get_link_index (ur_links_t *links, uint64_t link_bit_field)
     Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found. More...
     
    INLINE_IMPL uint64_t ur_get_link_bit_field_position (ur_links_t *links, unsigned int index)
     Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed. More...
     
    INLINE_IMPL uint64_t ur_get_link_mask (ur_links_t *links)
     Get link mask. More...
     
    INLINE_IMPL unsigned int ur_get_link_count (ur_links_t *links)
     Get link count. More...
     
    + + + + + + + + + + + + + + + + + + +

    +Variables

    const int ur_field_type_size []
     Sizes of UniRec data types. More...
     
    const char * ur_field_type_str []
     UniRec data types. More...
     
    int ur_field_array_elem_type []
     UniRec array element data types. More...
     
    ur_field_specs_t ur_field_specs
     Structure that lists UniRec field specifications such as names, types, id. More...
     
    ur_static_field_specs_t UR_FIELD_SPECS_STATIC
     Structure that lists staticaly defined UniRec field specifications such as names, types, id (using UR_FIELDS()). More...
     
    const char UR_MEMORY_ERROR [] = "Memory allocation error"
     
    +

    Detailed Description

    +

    Definition of UniRec structures and functions.

    +
    Author
    Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
    +
    +Zdenek Rosa rosaz.nosp@m.den@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
    +
    Date
    2015
    + +

    Definition in file unirec.c.

    +

    Macro Definition Documentation

    + +

    ◆ __USE_XOPEN

    + +
    +
    + + + + +
    #define __USE_XOPEN
    +
    + +

    Definition at line 49 of file unirec.c.

    + +
    +
    + +

    ◆ _BSD_SOURCE

    + +
    +
    + + + + +
    #define _BSD_SOURCE
    +
    + +

    Definition at line 47 of file unirec.c.

    + +
    +
    + +

    ◆ _DEFAULT_SOURCE

    + +
    +
    + + + + +
    #define _DEFAULT_SOURCE
    +
    + +

    Definition at line 46 of file unirec.c.

    + +
    +
    + +

    ◆ _XOPEN_SOURCE

    + +
    +
    + + + + +
    #define _XOPEN_SOURCE
    +
    + +

    Definition at line 48 of file unirec.c.

    + +
    +
    +

    Function Documentation

    + +

    ◆ mac_cmp()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    INLINE_IMPL int mac_cmp (const mac_addr_taddr1,
    const mac_addr_taddr2 
    )
    +
    +

    Compare two MAC addresses.

    +
    Parameters
    + + + +
    [in]addr1MAC address as mac_addr_t
    [in]addr2MAC address as mac_addr_t
    +
    +
    +
    Returns
    Positive number (>0) if addr1 > addr2, negative number (<0) if addr1 < addr2, and zero (=0) if addr1 == addr2.
    + +

    Definition at line 118 of file macaddr.h.

    + +
    +
    + +

    ◆ mac_from_bytes()

    + +
    +
    + + + + + + + + +
    INLINE_IMPL mac_addr_t mac_from_bytes (uint8_t * array)
    +
    +

    Convert 6B array into mac_addr_t.

    +
    Parameters
    + + +
    [in]array6B array containing MAC address bytes.
    +
    +
    +
    Returns
    MAC address stored as mac_addr_t.
    + +

    Definition at line 83 of file macaddr.h.

    + +
    +
    + +

    ◆ mac_from_str()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    INLINE_IMPL int mac_from_str (const char * str,
    mac_addr_taddr 
    )
    +
    +

    Convert string into mac_addr_t.

    +
    Parameters
    + + + +
    [in]strString for conversion.
    [out]addrPointer to memory where to store MAC address.
    +
    +
    +
    Returns
    1 on success, 0 on error i.e. string is not a valid MAC address.
    + +

    Definition at line 99 of file macaddr.h.

    + +
    +
    + +

    ◆ mac_to_bytes()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    INLINE_IMPL void mac_to_bytes (const mac_addr_taddr,
    uint8_t * array 
    )
    +
    +

    Convert mac_addr_t into bytes array.

    +
    Parameters
    + + + +
    [in]addrPointer to MAC address.
    [out]arrayPointer to memory where to store MAC address bytes. It must be of at least 6B size.
    +
    +
    + +

    Definition at line 144 of file macaddr.h.

    + +
    +
    + +

    ◆ mac_to_str()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    INLINE_IMPL void mac_to_str (const mac_addr_taddr,
    char * str 
    )
    +
    +

    Convert mac_addr_t into string.

    +
    Parameters
    + + + +
    [in]addrPointer to MAC address.
    [out]strPointer to memory where to store converted MAC address. It must be of at least MAC_STR_LEN size.
    +
    +
    + +

    Definition at line 129 of file macaddr.h.

    + +
    +
    + +

    ◆ ur_get_type_and_name_from_string()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    const char* ur_get_type_and_name_from_string (const char * source,
    char ** name,
    char ** type,
    int * length_name,
    int * length_type 
    )
    +
    + +

    Definition at line 368 of file unirec.c.

    + +
    +
    + +

    ◆ ur_var_change_size()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ur_var_change_size (const ur_template_ttmplt,
    void * rec,
    int field_id,
    int new_val_len 
    )
    +
    + +

    Definition at line 1126 of file unirec.c.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ UR_MEMORY_ERROR

    + +
    +
    + + + + +
    const char UR_MEMORY_ERROR[] = "Memory allocation error"
    +
    + +

    Definition at line 204 of file unirec.c.

    + +
    +
    +
    + + + + diff --git a/doc/unirec/unirec_8c_source.html b/doc/unirec/unirec_8c_source.html new file mode 100644 index 00000000..8a10dc63 --- /dev/null +++ b/doc/unirec/unirec_8c_source.html @@ -0,0 +1,276 @@ + + + + + + + +UniRec: unirec.c Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    unirec.c
    +
    +
    +Go to the documentation of this file.
    1 
    8 /*
    9  * Copyright (C) 2015 CESNET
    10 
    11  *
    12  * LICENSE TERMS
    13  *
    14  * Redistribution and use in source and binary forms, with or without
    15  * modification, are permitted provided that the following conditions
    16  * are met:
    17  * 1. Redistributions of source code must retain the above copyright
    18  * notice, this list of conditions and the following disclaimer.
    19  * 2. Redistributions in binary form must reproduce the above copyright
    20  * notice, this list of conditions and the following disclaimer in
    21  * the documentation and/or other materials provided with the
    22  * distribution.
    23  * 3. Neither the name of the Company nor the names of its contributors
    24  * may be used to endorse or promote products derived from this
    25  * software without specific prior written permission.
    26  *
    27  * ALTERNATIVELY, provided that this notice is retained in full, this
    28  * product may be distributed under the terms of the GNU General Public
    29  * License (GPL) version 2 or later, in which case the provisions
    30  * of the GPL apply INSTEAD OF those given above.
    31  *
    32  * This software is provided ``as is'', and any express or implied
    33  * warranties, including, but not limited to, the implied warranties of
    34  * merchantability and fitness for a particular purpose are disclaimed.
    35  * In no event shall the company or contributors be liable for any
    36  * direct, indirect, incidental, special, exemplary, or consequential
    37  * damages (including, but not limited to, procurement of substitute
    38  * goods or services; loss of use, data, or profits; or business
    39  * interruption) however caused and on any theory of liability, whether
    40  * in contract, strict liability, or tort (including negligence or
    41  * otherwise) arising in any way out of the use of this software, even
    42  * if advised of the possibility of such damage.
    43  *
    44  */
    45 
    46 #define _DEFAULT_SOURCE
    47 #define _BSD_SOURCE
    48 #define _XOPEN_SOURCE
    49 #define __USE_XOPEN
    50 #include <stdlib.h>
    51 #include <stdio.h>
    52 #include <inttypes.h>
    53 #include <time.h>
    54 #include <string.h>
    55 #include <regex.h>
    56 #include <assert.h>
    57 #include <ctype.h>
    58 #include "unirec.h"
    59 #include <libtrap/trap.h>
    60 #include <inttypes.h>
    61 #include "ur_values.c"
    62 #include "inline.h"
    63 
    64 // All inline functions from ipaddr.h must be declared again with "extern"
    65 // in exactly one translation unit (it generates externally linkable code of
    66 // these function)
    67 // See this for explanation (Nemo's answer):
    68 // http://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99
    69 INLINE_IMPL int ip_is4(const ip_addr_t *addr);
    70 INLINE_IMPL int ip_is6(const ip_addr_t *addr);
    71 INLINE_IMPL uint32_t ip_get_v4_as_int(ip_addr_t *addr);
    72 INLINE_IMPL char *ip_get_v4_as_bytes(const ip_addr_t *addr);
    78 INLINE_IMPL int ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2);
    79 INLINE_IMPL int ip_from_str(const char *str, ip_addr_t *addr);
    80 INLINE_IMPL void ip_to_str(const ip_addr_t *addr, char *str);
    81 
    82 INLINE_IMPL mac_addr_t mac_from_bytes(uint8_t *array);
    83 INLINE_IMPL int mac_from_str(const char *str, mac_addr_t *addr);
    84 INLINE_IMPL int mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2);
    85 INLINE_IMPL void mac_to_str(const mac_addr_t *addr, char *str);
    86 INLINE_IMPL void mac_to_bytes(const mac_addr_t *addr, uint8_t *array);
    87 
    88 
    94 const int ur_field_type_size[] = {
    95  -1, /*UR_TYPE_STRING*/
    96  -1, /*UR_TYPE_BYTES*/
    97  1, /*UR_TYPE_CHAR*/
    98  1, /*UR_TYPE_UINT8*/
    99  1, /*UR_TYPE_INT8*/
    100  2, /*UR_TYPE_UINT16*/
    101  2, /*UR_TYPE_INT16*/
    102  4, /*UR_TYPE_UINT32*/
    103  4, /*UR_TYPE_INT32*/
    104  8, /*UR_TYPE_UINT64*/
    105  8, /*UR_TYPE_INT64*/
    106  4, /*UR_TYPE_FLOAT*/
    107  8, /*UR_TYPE_DOUBLE*/
    108  16, /*UR_TYPE_IP*/
    109  6, /*UR_TYPE_MAC*/
    110  8, /*UR_TYPE_TIME*/
    111 
    112  // arrays
    113  -1, /*UR_TYPE_A_UINT8*/
    114  -1, /*UR_TYPE_A_INT8*/
    115  -2, /*UR_TYPE_A_UINT16*/
    116  -2, /*UR_TYPE_A_INT16*/
    117  -4, /*UR_TYPE_A_UINT32*/
    118  -4, /*UR_TYPE_A_INT32*/
    119  -8, /*UR_TYPE_A_UINT64*/
    120  -8, /*UR_TYPE_A_INT64*/
    121  -4, /*UR_TYPE_A_FLOAT*/
    122  -8, /*UR_TYPE_A_DOUBLE*/
    123  -16, /*UR_TYPE_A_IP*/
    124  -6, /*UR_TYPE_A_MAC*/
    125  -8, /*UR_TYPE_A_TIME*/
    126 };
    127 
    133 const char *ur_field_type_str[] = {
    134  "string", /*UR_TYPE_STRING*/
    135  "bytes", /*UR_TYPE_BYTES*/
    136  "char", /*UR_TYPE_CHAR*/
    137  "uint8", /*UR_TYPE_UINT8*/
    138  "int8", /*UR_TYPE_INT8*/
    139  "uint16", /*UR_TYPE_UINT16*/
    140  "int16", /*UR_TYPE_INT16*/
    141  "uint32", /*UR_TYPE_UINT32*/
    142  "int32", /*UR_TYPE_INT32*/
    143  "uint64", /*UR_TYPE_UINT64*/
    144  "int64", /*UR_TYPE_INT64*/
    145  "float", /*UR_TYPE_FLOAT*/
    146  "double", /*UR_TYPE_DOUBLE*/
    147  "ipaddr", /*UR_TYPE_IP*/
    148  "macaddr", /*UR_TYPE_MAC*/
    149  "time", /*UR_TYPE_TIME*/
    150  "uint8*", /*UR_TYPE_A_UINT8*/
    151  "int8*", /*UR_TYPE_A_INT8*/
    152  "uint16*", /*UR_TYPE_A_UINT16*/
    153  "int16*", /*UR_TYPE_A_INT16*/
    154  "uint32*", /*UR_TYPE_A_UINT32*/
    155  "int32*", /*UR_TYPE_A_INT32*/
    156  "uint64*", /*UR_TYPE_A_UINT64*/
    157  "int64*", /*UR_TYPE_A_INT64*/
    158  "float*", /*UR_TYPE_A_FLOAT*/
    159  "double*", /*UR_TYPE_A_DOUBLE*/
    160  "ipaddr*", /*UR_TYPE_A_IP*/
    161  "macaddr*", /*UR_TYPE_A_MAC*/
    162  "time*", /*UR_TYPE_A_TIME*/
    163 };
    164 
    169  UR_TYPE_STRING, /* UR_TYPE_STRING */
    170  UR_TYPE_BYTES, /* UR_TYPE_BYTES */
    171  UR_TYPE_CHAR, /* UR_TYPE_CHAR */
    172  UR_TYPE_UINT8, /* UR_TYPE_UINT8 */
    173  UR_TYPE_INT8, /* UR_TYPE_INT8 */
    174  UR_TYPE_UINT16, /* UR_TYPE_UINT16 */
    175  UR_TYPE_INT16, /* UR_TYPE_INT16 */
    176  UR_TYPE_UINT32, /* UR_TYPE_UINT32 */
    177  UR_TYPE_INT32, /* UR_TYPE_INT32 */
    178  UR_TYPE_UINT64, /* UR_TYPE_UINT64 */
    179  UR_TYPE_INT64, /* UR_TYPE_INT64 */
    180  UR_TYPE_FLOAT, /* UR_TYPE_FLOAT */
    181  UR_TYPE_DOUBLE, /* UR_TYPE_DOUBLE */
    182  UR_TYPE_IP, /* UR_TYPE_IP */
    183  UR_TYPE_MAC, /* UR_TYPE_MAC */
    184  UR_TYPE_TIME, /* UR_TYPE_TIME */
    185  UR_TYPE_UINT8, /* UR_TYPE_A_UINT8 */
    186  UR_TYPE_INT8, /* UR_TYPE_A_INT8 */
    187  UR_TYPE_UINT16, /* UR_TYPE_A_UINT16 */
    188  UR_TYPE_INT16, /* UR_TYPE_A_INT16 */
    189  UR_TYPE_UINT32, /* UR_TYPE_A_UINT32 */
    190  UR_TYPE_INT32, /* UR_TYPE_A_INT32 */
    191  UR_TYPE_UINT64, /* UR_TYPE_A_UINT64 */
    192  UR_TYPE_INT64, /* UR_TYPE_A_INT64 */
    193  UR_TYPE_FLOAT, /* UR_TYPE_A_FLOAT */
    194  UR_TYPE_DOUBLE, /* UR_TYPE_A_DOUBLE */
    195  UR_TYPE_IP, /* UR_TYPE_A_IP */
    196  UR_TYPE_MAC, /* UR_TYPE_A_MAC */
    197  UR_TYPE_TIME, /* UR_TYPE_A_TIME */
    198 };
    199 
    200 
    203 
    204 const char UR_MEMORY_ERROR[] = "Memory allocation error";
    205 
    206 int ur_init(ur_static_field_specs_t field_specs_static)
    207 {
    208  int i, j;
    210  return UR_OK;
    211  }
    212  //copy size
    214  ur_field_specs.ur_last_id = field_specs_static.ur_last_id;
    216  //copy field type
    218  if (ur_field_specs.ur_field_types == NULL) {
    219  return UR_E_MEMORY;
    220  }
    221  memcpy(ur_field_specs.ur_field_types, field_specs_static.ur_field_types, sizeof(ur_field_type_t) * field_specs_static.ur_last_id);
    222  //copy field sizes
    223  ur_field_specs.ur_field_sizes = (short *) calloc(sizeof(short), ur_field_specs.ur_allocated_fields);
    224  if (ur_field_specs.ur_field_sizes == NULL) {
    226  return UR_E_MEMORY;
    227  }
    228  memcpy(ur_field_specs.ur_field_sizes, field_specs_static.ur_field_sizes, sizeof(short) * field_specs_static.ur_last_id);
    229  //copy field names
    230  ur_field_specs.ur_field_names = (char **) calloc(sizeof(char *), ur_field_specs.ur_allocated_fields);
    231  if (ur_field_specs.ur_field_names == NULL) {
    234  return UR_E_MEMORY;
    235  }
    236  for (i = 0; i < field_specs_static.ur_last_id; i++) {
    237  ur_field_specs.ur_field_names[i] = (char *) calloc(sizeof(char), strlen(field_specs_static.ur_field_names[i]) + 1);
    238  if (ur_field_specs.ur_field_names[i] == NULL) {
    241  for (j = 0; j < i; j++) {
    243  }
    245  return UR_E_MEMORY;
    246  }
    247  strcpy(ur_field_specs.ur_field_names[i], field_specs_static.ur_field_names[i]);
    248  }
    250  return UR_OK;
    251 }
    252 
    253 char *ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter)
    254 {
    255  char *str = NULL, *strmove = NULL, *str_new = NULL;
    256  int len = UR_DEFAULT_LENGTH_OF_TEMPLATE, act_len = 0;
    257 
    258  if (tmplt == NULL) {
    259  return NULL;
    260  }
    261 
    262  str = (char *) calloc(sizeof(char), len);
    263  if (str == NULL) {
    264  return NULL;
    265  }
    266  strmove = str;
    267  for (int i = 0; i < tmplt->count; i++) {
    268  act_len += strlen(ur_field_type_str[ur_get_type(tmplt->ids[i])]) + strlen(ur_get_name(tmplt->ids[i])) + 2;
    269  if (act_len >= len) {
    270  len *= 2;
    271  str_new = (char *) realloc(str, sizeof(char) * len);
    272  if (str_new == NULL) {
    273  free(str);
    274  return NULL;
    275  }
    276  strmove = str_new + (strmove - str);
    277  str = str_new;
    278  }
    279  sprintf(strmove, "%s %s%c", ur_field_type_str[ur_get_type(tmplt->ids[i])], ur_get_name(tmplt->ids[i]), delimiter);
    280  strmove += strlen(strmove);
    281  }
    282  if (tmplt->count != 0) {
    283  strmove[-1] = '\0';
    284  }
    285  return str;
    286 }
    287 
    289 {
    290  ur_field_id_linked_list_t * first;
    291  //check if UniRec is initialized, if not initialize it
    293  int init_val = ur_init(UR_FIELD_SPECS_STATIC);
    294  if (init_val != UR_OK) {
    295  return init_val;
    296  }
    297  }
    298  //check undefined fields
    299  if (ur_field_specs.ur_undefine_fields != NULL) {
    300  //resuse old undefined fields
    301  int id;
    304  id = first->id;
    305  free(first);
    306  return id;
    307  } else {
    308  //take new id
    310  //take value from remaining space
    311  return ur_field_specs.ur_last_id++;
    313  //increase space for fields
    314  int new_size;
    315 
    316  char **ur_field_names_new;
    317  short *ur_field_sizes_new;
    318  ur_field_type_t *ur_field_types_new;
    319 
    321 
    322  //copy field type
    323  ur_field_types_new = (ur_field_type_t *) realloc(ur_field_specs.ur_field_types, sizeof(ur_field_type_t) * new_size);
    324  if (ur_field_types_new == NULL) {
    325  return UR_E_MEMORY;
    326  }
    327 
    328  //copy field sizes
    329  ur_field_sizes_new = (short *) realloc(ur_field_specs.ur_field_sizes, sizeof(short) * new_size);
    330  if (ur_field_sizes_new == NULL) {
    331  free(ur_field_types_new);
    332  return UR_E_MEMORY;
    333  }
    334 
    335  //copy field names
    336  ur_field_names_new = (char **) realloc(ur_field_specs.ur_field_names, sizeof(char *) * new_size);
    337  if (ur_field_names_new == NULL) {
    338  free(ur_field_types_new);
    339  free(ur_field_sizes_new);
    340  return UR_E_MEMORY;
    341  }
    342  //replace for new values
    343  ur_field_specs.ur_field_names = ur_field_names_new;
    344  ur_field_specs.ur_field_sizes = ur_field_sizes_new;
    345  ur_field_specs.ur_field_types = ur_field_types_new;
    347  return ur_field_specs.ur_last_id++;
    348  } else {
    349  //no more space for new fields
    350  return UR_E_MEMORY;
    351  }
    352  }
    353 }
    354 
    355 int ur_get_field_type_from_str(const char *type)
    356 {
    357  if (type == NULL) {
    358  return UR_E_INVALID_TYPE;
    359  }
    360  for (int i = 0; i < UR_COUNT_OF_TYPES; i++) {
    361  if (strcmp(type, ur_field_type_str[i]) == 0) {
    362  return i;
    363  }
    364  }
    365  return UR_E_INVALID_TYPE;
    366 }
    367 
    368 const char *ur_get_type_and_name_from_string(const char *source, char **name, char **type, int *length_name, int *length_type)
    369 {
    370  int length_type_2 = 0, length_name_2 = 0;
    371  const char *source_cpy;
    372  /* skip white spaces */
    373  while (*source != 0 && isspace(*source)) {
    374  source++;
    375  }
    376  /* start of type */
    377  source_cpy = source;
    378  while (*source != 0 && !isspace(*source)) {
    379  length_type_2++;
    380  source++;
    381  }
    382  /* end of type */
    383 
    384  /* copy "type" string (realloc destination if needed) */
    385  if (length_type_2 >= *length_type) {
    386  if (*type != NULL) {
    387  free(*type);
    388  }
    389  *type = (char *) malloc(sizeof(char) * (length_type_2 + 1));
    390  if (*type == NULL) {
    391  return NULL;
    392  }
    393  *length_type = length_type_2 + 1;
    394  }
    395  memcpy(*type, source_cpy, length_type_2);
    396  (*type)[length_type_2] = 0;
    397 
    398  /* skip white spaces */
    399  while (*source != 0 && isspace(*source)) {
    400  source++;
    401  }
    402  /* start of name */
    403  source_cpy = source;
    404  while (*source != 0 && !isspace(*source) && *source != ',') {
    405  length_name_2++;
    406  source++;
    407  }
    408  /* end of name */
    409 
    410  /* copy "name" string (realloc destination if needed) */
    411  if (length_name_2 >= *length_name) {
    412  if (*name != NULL) {
    413  free(*name);
    414  }
    415  *name = (char *) malloc(sizeof(char) * (length_name_2 + 1));
    416  if (*name == NULL) {
    417  return NULL;
    418  }
    419  *length_name = length_name_2 + 1;
    420  }
    421  memcpy(*name, source_cpy, length_name_2);
    422  (*name)[length_name_2] = 0;
    423  /* skip white spaces */
    424  while (*source != 0 && isspace(*source)) {
    425  source++;
    426  }
    427  /* skip comma */
    428  if (*source == ',') {
    429  source++;
    430  }
    431  return source;
    432 }
    433 
    434 char *ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt)
    435 {
    436  const char *source_cpy = NULL, *p = ifc_data_fmt;
    437  char *out_str;
    438  int name_len = 0, act_len = 0, str_len;
    439  str_len = strlen(ifc_data_fmt);
    440  out_str = (char *) calloc(str_len + 1, sizeof(char));
    441  if (out_str == NULL) {
    442  return NULL;
    443  }
    444  while (*p != 0) {
    445  /* skip white spaces */
    446  while (*p != 0 && isspace(*p)) {
    447  p++;
    448  }
    449  /* field type */
    450  while (*p != 0 && *p != ' ') {
    451  p++;
    452  }
    453  /* skip white spaces */
    454  while (*p != 0 && isspace(*p)) {
    455  p++;
    456  }
    457 
    458  //copy name
    459  source_cpy = p;
    460  name_len = 0;
    461  while (*p != 0 && *p != ',' && !isspace(*p)) {
    462  name_len++;
    463  p++;
    464  }
    465  assert(name_len + act_len + 1 <= str_len);
    466  memcpy(out_str + act_len, source_cpy, name_len);
    467  act_len += name_len;
    468  /* skip white spaces */
    469  while (*p != 0 && isspace(*p)) {
    470  p++;
    471  }
    472  if (*p == ',') {
    473  p++;
    474  } else if (*p == 0) {
    475  break;
    476  } else {
    477  free(out_str);
    478  return NULL; /* name must be followed by a comma or end of string */
    479  }
    480  out_str[act_len] = ',';
    481  act_len++;
    482  }
    483  return out_str;
    484 }
    485 
    486 ur_template_t *ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt)
    487 {
    488  int name_len = 0, act_len = 0, concat_str_len = strlen(ifc_data_fmt);
    489  char *concat_str;
    490  const char *source_cpy, *p = ifc_data_fmt;
    492  uint32_t ifc_out = 0;
    493  concat_str = (char *) malloc(sizeof(char) * concat_str_len);
    494  if (concat_str == NULL) {
    495  return NULL;
    496  }
    497  while (*p != 0) {
    498  while (*p != 0 && !isspace(*p)) {
    499  p++;
    500  }
    501  p++;
    502  //copy name
    503  source_cpy = p;
    504  name_len = 0;
    505  while (*p != 0 && *p != ',') {
    506  name_len++;
    507  p++;
    508  }
    509  if (name_len + act_len + 1 > concat_str_len) {
    510  char *str_new;
    511  str_new = (char *) realloc(concat_str, sizeof(char) * (concat_str_len * 2));
    512  if (str_new == NULL) {
    513  /* XXX memory leak original concat_str? */
    514  return NULL;
    515  }
    516  concat_str_len *= 2;
    517  concat_str = str_new;
    518  }
    519  memcpy(concat_str + act_len, source_cpy, name_len);
    520  act_len += name_len;
    521  concat_str[act_len] = ',';
    522  act_len++;
    523  }
    524  if (tmplt != NULL) {
    525  direction = tmplt->direction;
    526  ifc_out = tmplt->ifc_out;
    527  for (int i = 0; i < tmplt->count; i++) {
    528  const char *f_name = ur_get_name(tmplt->ids[i]);
    529  name_len = strlen(f_name);
    530  if (name_len + act_len + 1 > concat_str_len) {
    531  char *str_new;
    532  str_new = (char *) realloc(concat_str, sizeof(char) * (concat_str_len * 2));
    533  if (str_new == NULL) {
    534  /* XXX memory leak original concat_str? */
    535  return NULL;
    536  }
    537  concat_str_len *= 2;
    538  concat_str = str_new;
    539  }
    540  memcpy(concat_str + act_len, f_name, name_len);
    541  act_len += name_len;
    542  *(concat_str + act_len) = ',';
    543  act_len++;
    544  }
    545  ur_free_template(tmplt);
    546  }
    547  if (act_len > 0) {
    548  act_len--;
    549  concat_str[act_len] = 0;
    550  }
    551  tmplt = ur_create_template(concat_str, NULL);
    552  tmplt->direction = direction;
    553  tmplt->ifc_out = ifc_out;
    554  free(concat_str);
    555  return tmplt;
    556 }
    557 
    558 int ur_define_set_of_fields(const char *ifc_data_fmt)
    559 {
    560  const char *new_fields_move;
    561  new_fields_move = ifc_data_fmt;
    562  char *field_name, *field_type;
    563  int field_name_length = UR_DEFAULT_LENGTH_OF_FIELD_NAME, field_type_length = UR_DEFAULT_LENGTH_OF_FIELD_TYPE;
    564  int field_id = 0, field_type_id = 0;
    565  field_name = (char *) malloc(sizeof(char) * field_name_length);
    566  if (field_name == NULL) {
    567  return UR_E_MEMORY;
    568  }
    569  field_type = (char *) malloc(sizeof(char) * field_type_length);
    570  if (field_type == NULL) {
    571  free(field_name);
    572  return UR_E_MEMORY;
    573  }
    574  while (*new_fields_move != 0) {
    575  new_fields_move = ur_get_type_and_name_from_string(new_fields_move, &field_name, &field_type, &field_name_length, &field_type_length);
    576  if (new_fields_move == NULL) {
    577  if (field_name != NULL) {
    578  free(field_name);
    579  }
    580  if (field_type != NULL) {
    581  free(field_type);
    582  }
    583  return UR_E_MEMORY;
    584  }
    585  //through all fields of receiver
    586  field_type_id = ur_get_field_type_from_str(field_type);
    587  if (field_type_id < 0) {
    588  if (field_name != NULL) {
    589  free(field_name);
    590  }
    591  free(field_type);
    592  return field_type_id;
    593  }
    594  field_id = ur_define_field(field_name, field_type_id);
    595  if (field_id < 0) {
    596  if (field_name != NULL) {
    597  free(field_name);
    598  }
    599  free(field_type);
    600  return field_id;
    601  }
    602  }
    603  if (field_name != NULL) {
    604  free(field_name);
    605  }
    606  free(field_type);
    607  return UR_OK;
    608 }
    609 
    611 {
    612  ur_template_t *new_tmplt;
    613  if (ur_define_set_of_fields(ifc_data_fmt) < 0) {
    614  return NULL;
    615  }
    616  new_tmplt = ur_create_template_from_ifc_spec(ifc_data_fmt);
    617  if (new_tmplt != NULL && tmplt != NULL) {
    618  new_tmplt->ifc_out = tmplt->ifc_out;
    619  new_tmplt->direction = tmplt->direction;
    620  ur_free_template(tmplt);
    621  }
    622  return new_tmplt;
    623 }
    624 
    626 {
    627  char *field_names = ur_ifc_data_fmt_to_field_names(ifc_data_fmt);
    628  if (field_names == NULL) {
    629  return NULL;
    630  }
    631  ur_template_t *new_tmplt = ur_create_template(field_names, NULL);
    632  free(field_names);
    633  return new_tmplt;
    634 }
    635 
    636 int ur_define_field(const char *name, ur_field_type_t type)
    637 {
    638  int insert_id;
    639  char * name_copy;
    640  int name_len;
    641  if (name == NULL) {
    642  return UR_E_INVALID_NAME;
    643  }
    644  //check the regural expression of a name
    645  name_len = strlen(name);
    646  if (name_len == 0) {
    647  return UR_E_INVALID_NAME;
    648  }
    649  if (!((name[0] >= 'A' && name[0] <= 'Z') || (name[0] >= 'a' && name[0] <= 'z'))) {
    650  return UR_E_INVALID_NAME;
    651  }
    652  for (int i = 1; i < name_len; i++) {
    653  if (!((name[i] >= 'A' && name[i] <= 'Z') || (name[i] >= 'a' && name[i] <= 'z') || (name[i] >= '0' && name[i] <= '9') || name[i] == '_')) {
    654  return UR_E_INVALID_NAME;
    655  }
    656  }
    657  // If this is the first dynamically allocated field, call ur_init
    659  int init_val = ur_init(UR_FIELD_SPECS_STATIC);
    660  if (init_val != 0) {
    661  return init_val;
    662  }
    663  }
    664  //check if the field is already defined
    665  for (int i = 0; i < ur_field_specs.ur_last_id; i++) {
    666  if (ur_field_specs.ur_field_names[i] != NULL && strcmp(name, ur_field_specs.ur_field_names[i]) == 0) {
    667  if (type == ur_field_specs.ur_field_types[i]) {
    668  //name exists and type is equal
    669  return i;
    670  } else {
    671  //name exists, but type is different
    672  return UR_E_TYPE_MISMATCH;
    673  }
    674  }
    675  }
    676  //create new field
    677  name_copy = (char *) calloc(sizeof(char), strlen(name) + 1);
    678  if (name_copy == NULL) {
    679  //error during allocation
    680  return UR_E_MEMORY;
    681  }
    682  strcpy(name_copy, name);
    683  insert_id = ur_get_empty_id();
    684  if (insert_id < 0) {
    685  //error
    686  free(name_copy);
    687  return insert_id;
    688  }
    689  ur_field_specs.ur_field_names[insert_id] = name_copy;
    690  ur_field_specs.ur_field_sizes[insert_id] = ur_size_of(type);
    691  ur_field_specs.ur_field_types[insert_id] = type;
    692  return insert_id;
    693 }
    694 
    696 {
    697  if (field_id < ur_field_specs.ur_last_statically_defined_id || field_id >= ur_field_specs.ur_last_id) {
    698  //id is invalid
    699  return UR_E_INVALID_PARAMETER;
    700  } else if (ur_field_specs.ur_field_names[field_id] == NULL) {
    701  //ID is already undefined
    702  return UR_E_INVALID_PARAMETER;
    703  } else {
    704  //undefine field
    705  ur_field_id_linked_list_t *undefined_item;
    706  undefined_item = (ur_field_id_linked_list_t *) calloc(sizeof(ur_field_id_linked_list_t), 1);
    707  if (undefined_item == NULL) {
    708  //error during allocation
    709  return UR_E_MEMORY;
    710  }
    712  ur_field_specs.ur_field_names[field_id] = NULL;
    713  undefined_item->id = field_id;
    714  undefined_item->next = ur_field_specs.ur_undefine_fields;
    715  ur_field_specs.ur_undefine_fields = undefined_item;
    716  }
    717  return UR_OK;
    718 }
    719 
    720 int ur_undefine_field(const char *name)
    721 {
    722  int i;
    723  //find id of field
    725  if (ur_field_specs.ur_field_names[i] != NULL && strcmp(name, ur_field_specs.ur_field_names[i]) == 0) {
    726  return ur_undefine_field_by_id(i);
    727  }
    728  }
    729  //field with given name was not found
    730  return UR_E_INVALID_NAME;
    731 }
    732 
    733 
    735 {
    737  //there is no need for deallocation, because nothing has been allocated.
    738  return;
    739  }
    740  if (ur_field_specs.ur_field_names != NULL) {
    741  for (int i=0; i < ur_field_specs.ur_last_id; i++) {
    742  if (ur_field_specs.ur_field_names[i] != NULL) {
    744  }
    745  }
    747  }
    748  if (ur_field_specs.ur_undefine_fields != NULL) {
    749  ur_field_id_linked_list_t *next, * act_del;
    751  while (act_del != NULL) {
    752  next = act_del->next;
    753  free(act_del);
    754  act_del = next;
    755  }
    756  }
    757  if (ur_field_specs.ur_field_sizes != NULL) {
    759  }
    760  if (ur_field_specs.ur_field_types != NULL) {
    762  }
    771 }
    772 
    773 // Find field ID given its name
    774 int ur_get_id_by_name(const char *name)
    775 {
    776  for (int id = 0; id < ur_field_specs.ur_last_id; id++) {
    777  if (ur_field_specs.ur_field_names[id] != NULL && strcmp(name, ur_field_specs.ur_field_names[id]) == 0) {
    778  return id;
    779  }
    780  }
    781  return UR_E_INVALID_NAME;
    782 }
    783 
    784 // Return -1 if f1 should go before f2, 0 if f1 is the same as f2, 1 otherwise
    785 int compare_fields(const void *field1, const void *field2)
    786 {
    787  const field_spec_t *f1 = field1;
    788  const field_spec_t *f2 = field2;
    789  if (f1->size > f2->size) {
    790  return -1;
    791  } else if (f1->size < f2->size) {
    792  return 1;
    793  } else {
    794  return strcmp(f1->name, f2->name);
    795  }
    796 }
    797 
    798 ur_template_t *ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    799 {
    800  ur_template_t *tmplt = ur_create_template(fields, errstr);
    801  if (tmplt == NULL) {
    802  return NULL;
    803  }
    804  if (ur_ctx_set_input_template(ctx, ifc, tmplt) != UR_OK) {
    805  if (errstr != NULL) {
    806  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    807  if (*errstr != NULL) {
    808  strcpy(*errstr, UR_MEMORY_ERROR);
    809  }
    810  }
    811  ur_free_template(tmplt);
    812  return NULL;
    813  }
    814  return tmplt;
    815 }
    816 
    817 ur_template_t *ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    818 {
    819  ur_template_t *tmplt = ur_create_template(fields, errstr);
    820  if (tmplt == NULL) {
    821  return NULL;
    822  }
    823  if (ur_ctx_set_output_template(ctx, ifc, tmplt) != UR_OK) {
    824  if (errstr != NULL) {
    825  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    826  if (*errstr != NULL) {
    827  strcpy(*errstr, UR_MEMORY_ERROR);
    828  }
    829  }
    830  ur_free_template(tmplt);
    831  return NULL;
    832  }
    833  return tmplt;
    834 }
    835 
    836 int ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    837 {
    838  if (tmplt == NULL) {
    839  return UR_OK;
    840  }
    841  if (tmplt->direction == UR_TMPLT_DIRECTION_IN) {
    843  } else {
    845  }
    846  tmplt->ifc_out = ifc;
    847  char * tmplt_str = ur_template_string(tmplt);
    848  if (tmplt_str == NULL) {
    849  return UR_E_MEMORY;
    850  }
    851  trap_ctx_set_data_fmt(ctx, ifc, TRAP_FMT_UNIREC, tmplt_str);
    852  free(tmplt_str);
    853  return UR_OK;
    854 }
    855 
    856 int ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    857 {
    858  if (tmplt == NULL) {
    859  return UR_OK;
    860  }
    861  if (tmplt->direction == UR_TMPLT_DIRECTION_OUT) {
    863  } else {
    865  }
    866  char * tmplt_str = ur_template_string(tmplt);
    867  if (tmplt_str == NULL) {
    868  return UR_E_MEMORY;
    869  }
    870  trap_ctx_set_required_fmt(ctx, ifc, TRAP_FMT_UNIREC, tmplt_str);
    871  free(tmplt_str);
    872  return UR_OK;
    873 }
    874 
    875 ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
    876 {
    877  ur_template_t *tmplt = ur_create_template(fields, errstr);
    878  if (tmplt == NULL) {
    879  return NULL;
    880  }
    882  tmplt->ifc_out = ifc_out;
    883  char * tmplt_str = ur_template_string(tmplt);
    884  if (tmplt_str == NULL) {
    885  if (errstr != NULL) {
    886  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    887  if (*errstr != NULL) {
    888  strcpy(*errstr, UR_MEMORY_ERROR);
    889  }
    890  }
    891  ur_free_template(tmplt);
    892  return NULL;
    893  }
    894  trap_ctx_set_required_fmt(ctx, ifc_in, TRAP_FMT_UNIREC, tmplt_str);
    895  trap_ctx_set_data_fmt(ctx, ifc_out, TRAP_FMT_UNIREC, tmplt_str);
    896  free(tmplt_str);
    897  return tmplt;
    898 }
    899 
    900 ur_template_t *ur_create_template(const char *fields, char **errstr)
    901 {
    902  // Count number of fields
    903  int n_fields = 0, written_fields = 0;
    904  if (fields) {
    905  /* skip leading spaces */
    906  while (*fields != '\0' && isspace(*fields)) {
    907  fields++;
    908  }
    909  /* Count number of fields */
    910  if (*fields != '\0') {
    911  n_fields = 1;
    912  const char *tmp = fields;
    913  while (*tmp != '\0') {
    914  if (*(tmp++) == ',') {
    915  n_fields++;
    916  }
    917  }
    918  }
    919  }
    920  // Allocate array of field_spec structs
    921  field_spec_t *fields_spec = malloc(n_fields * sizeof(field_spec_t));
    922  if (fields_spec == NULL && n_fields > 0) {
    923  if (errstr != NULL) {
    924  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    925  if (*errstr != NULL) {
    926  strcpy(*errstr, UR_MEMORY_ERROR);
    927  }
    928  }
    929  return NULL;
    930  }
    931  // Parse fields and fill the array
    932  const char *start_ptr = fields;
    933  const char *end_ptr;
    934  for (int i = 0; i < n_fields; i++) {
    935  // Get field name
    936  end_ptr = start_ptr;
    937  /* go to the first space / comma / end-of-string */
    938  while (!isspace(*end_ptr) && *end_ptr != ',' && *end_ptr != '\0') {
    939  end_ptr++;
    940  }
    941  int len = end_ptr - start_ptr;
    942  fields_spec[written_fields].name = malloc(len + 1);
    943  if (fields_spec[written_fields].name == NULL) {
    944  if (errstr != NULL) {
    945  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    946  if (*errstr != NULL) {
    947  strcpy(*errstr, UR_MEMORY_ERROR);
    948  }
    949  }
    950  for (int j = 0; j < i; j++) {
    951  free(fields_spec[j].name);
    952  }
    953  free(fields_spec);
    954  return NULL;
    955  }
    956  memcpy(fields_spec[written_fields].name, start_ptr, len);
    957  fields_spec[written_fields].name[len] = 0;
    958  start_ptr = end_ptr;
    959  while ((isspace(*start_ptr) || *start_ptr == ',') && *start_ptr != '\0') {
    960  start_ptr++;
    961  }
    962  // Get field ID
    963  int id_by_name = ur_get_id_by_name(fields_spec[written_fields].name);
    964  if (id_by_name == UR_E_INVALID_NAME) {
    965  // Unknown field name
    966  if (errstr != NULL) {
    967  *errstr = (char *) malloc(100);
    968  if (*errstr != NULL) {
    969  int n;
    970  n = snprintf(*errstr, 100, "field: %s is not defined.", fields_spec[written_fields].name);
    971  if (n >= 100) {
    972  strcpy(*errstr, "given field is not defined");
    973  }
    974  }
    975  }
    976  for (int j = 0; j <= written_fields; j++) {
    977  free(fields_spec[j].name);
    978  }
    979  free(fields_spec);
    980  return NULL;
    981  }
    982  //check if the field is not in the template.
    983  int in_the_template = 0;
    984  for (int j = 0; j < written_fields; j++) {
    985  if (fields_spec[j].id == id_by_name) {
    986  in_the_template = 1;
    987  break;
    988  }
    989  }
    990  //if the field is not already int the template, copy values and move the index, otherwise just free the string with name.
    991  if (in_the_template == 0) {
    992  fields_spec[written_fields].id = id_by_name;
    993  // Get field size
    994  fields_spec[written_fields].size = ur_get_size(fields_spec[written_fields].id);
    995  written_fields++;
    996  } else {
    997  free(fields_spec[written_fields].name);
    998  fields_spec[written_fields].name = NULL;
    999  }
    1000  }
    1001  // Sort fields according to UniRec specification (by size and names)
    1002  if (n_fields > 0) {
    1003  qsort(fields_spec, written_fields, sizeof(field_spec_t), compare_fields);
    1004  }
    1005  // Allocate memory for the template
    1006  ur_template_t *tmplt = (ur_template_t *) calloc(sizeof(ur_template_t), 1);
    1007  if (tmplt == NULL) {
    1008  for (int i = 0; i < written_fields; i++) {
    1009  free(fields_spec[i].name);
    1010  }
    1011  free(fields_spec);
    1012  if (errstr != NULL) {
    1013  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    1014  if (*errstr != NULL) {
    1015  strcpy(*errstr, UR_MEMORY_ERROR);
    1016  }
    1017  }
    1018  return NULL;
    1019  }
    1020  //set no direction to the template
    1022  //allocate memory for offset table
    1024  tmplt->offset = malloc(ur_field_specs.ur_last_id * sizeof(uint16_t));
    1025  if (tmplt->offset == NULL) {
    1026  for (int i = 0; i < written_fields; i++) {
    1027  free(fields_spec[i].name);
    1028  }
    1029  free(fields_spec);
    1030  free(tmplt);
    1031  if (errstr != NULL) {
    1032  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    1033  if (*errstr != NULL) {
    1034  strcpy(*errstr, UR_MEMORY_ERROR);
    1035  }
    1036  }
    1037  return NULL;
    1038  }
    1039  // Set all fields to invalid offset
    1040  memset(tmplt->offset, 0xff, ur_field_specs.ur_last_id * sizeof(uint16_t));
    1041  // Fill offsets of all fields into the table
    1042  uint16_t offset = 0;
    1043  uint16_t first_dynamic = UR_NO_DYNAMIC_VALUES;
    1044  for (int i = 0; i < written_fields; i++) {
    1045  // Set offset
    1046  if (fields_spec[i].size < 0) { // dynamic field
    1047  tmplt->offset[fields_spec[i].id] = offset;
    1048  offset += 4;
    1049  if (first_dynamic == UR_NO_DYNAMIC_VALUES) {
    1050  first_dynamic = i;
    1051  }
    1052  } else { // static field
    1053  tmplt->offset[fields_spec[i].id] = offset;
    1054  offset += fields_spec[i].size;
    1055  }
    1056  }
    1057  tmplt->first_dynamic = first_dynamic;
    1058  tmplt->static_size = offset;
    1059 
    1060  //save ids to template
    1061  tmplt->ids = (ur_field_id_t *) malloc(sizeof(ur_field_id_t) * written_fields);
    1062  if (tmplt->ids == NULL) {
    1063  for (int i = 0; i < written_fields; i++) {
    1064  free(fields_spec[i].name);
    1065  }
    1066  free(fields_spec);
    1067  free(tmplt);
    1068  if (errstr != NULL) {
    1069  *errstr = (char *) malloc(strlen(UR_MEMORY_ERROR) + 1);
    1070  if (*errstr != NULL) {
    1071  strcpy(*errstr, UR_MEMORY_ERROR);
    1072  }
    1073  }
    1074  return NULL;
    1075  }
    1076  tmplt->count = written_fields;
    1077  for (int i = 0; i < written_fields; i++) {
    1078  tmplt->ids[i] = fields_spec[i].id;
    1079  }
    1080  // Free array of field specs
    1081  for (int i = 0; i < written_fields; i++) {
    1082  free(fields_spec[i].name);
    1083  }
    1084  free(fields_spec);
    1085  return tmplt;
    1086 }
    1087 
    1089  if (tmplt == NULL) {
    1090  return;
    1091  }
    1092  //free offset table
    1093  if (tmplt->offset != NULL) {
    1094  free(tmplt->offset);
    1095  }
    1096  //free ids
    1097  if (tmplt->ids != NULL) {
    1098  free(tmplt->ids);
    1099  }
    1100  free(tmplt);
    1101 }
    1102 
    1103 // Compare fields of two templates
    1104 int ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB)
    1105 {
    1106  if (tmpltA->count == tmpltB->count) {
    1107  return memcmp(tmpltA->ids, tmpltB->ids, sizeof(uint16_t) * tmpltA->count) == 0;
    1108  } else {
    1109  return 0;
    1110  }
    1111 }
    1112 
    1113 
    1114 // Print template
    1116 {
    1117  printf("static_size: %hu, first_dynamic: ", tmplt->static_size);
    1118  (tmplt->first_dynamic == UR_NO_DYNAMIC_VALUES) ? (printf("-")) : (printf("%d", tmplt->ids[tmplt->first_dynamic]));
    1119  printf(", offsets:\n"
    1120  "ID\t%-30s\toffset\n","name");
    1121  for (int i = 0; i < tmplt->count; i++) {
    1122  printf("%d\t%-30s\t%6hu\n", tmplt->ids[i], ur_field_specs.ur_field_names[tmplt->ids[i]], tmplt->offset[tmplt->ids[i]]);
    1123  }
    1124 }
    1125 
    1126 void ur_var_change_size(const ur_template_t *tmplt, void *rec, int field_id, int new_val_len)
    1127 {
    1128  // pointer to field and size of a field
    1129  char *out_ptr = ur_get_ptr_by_id(tmplt, rec, field_id);
    1130  int old_size_of_field = ur_get_len(tmplt, rec, field_id);
    1131  //if the size is different, move following fields
    1132  if (old_size_of_field != new_val_len) {
    1133  uint16_t size = new_val_len;
    1134  uint16_t offset_static = ur_get_var_offset(tmplt, rec, field_id);
    1135  int index = 0;
    1136  //find index of changed field in record array
    1137  for (int i = 0; i< tmplt->count; i++) {
    1138  if (field_id == tmplt->ids[i]) {
    1139  index = i;
    1140  }
    1141  }
    1142  //set new offset for dynamic fields which are situated behind changed field
    1143  for (int i = index + 1; i < tmplt->count; i++) {
    1144  ur_set_var_offset(tmplt, rec, tmplt->ids[i], offset_static + size);
    1145  size += ur_get_len(tmplt, rec, tmplt->ids[i]);
    1146  }
    1147  memmove(out_ptr + new_val_len, out_ptr + old_size_of_field, size - new_val_len);
    1148  ur_set_var_len(tmplt, rec, field_id, new_val_len);
    1149  }
    1150 }
    1151 
    1152 int ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
    1153 {
    1154  if (tmplt->offset[field_id] == UR_INVALID_OFFSET) {
    1155  return UR_E_INVALID_FIELD_ID;
    1156  }
    1157  // wrong parameters or template does not contain dynamic fields
    1158  if (tmplt->first_dynamic == UR_NO_DYNAMIC_VALUES || ur_is_static(field_id)) {
    1159  return UR_E_INVALID_FIELD_ID;
    1160  }
    1161  // pointer to field and size of a field
    1162  char * out_ptr = ur_get_ptr_by_id(tmplt, rec, field_id);
    1163  //change size of a variable length field
    1164  ur_var_change_size(tmplt, rec, field_id, val_len);
    1165  //copy new value
    1166  memcpy(out_ptr, val_ptr, val_len);
    1167  return UR_OK;
    1168 }
    1169 
    1170 int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len)
    1171 {
    1172  if (tmplt->offset[field_id] == UR_INVALID_OFFSET) {
    1173  return UR_E_INVALID_FIELD_ID;
    1174  }
    1175  // wrong parameters or template does not contain dynamic fields
    1176  if (tmplt->first_dynamic == UR_NO_DYNAMIC_VALUES || ur_is_static(field_id)) {
    1177  return UR_E_INVALID_FIELD_ID;
    1178  }
    1179  //change size of a variable length field
    1180  ur_var_change_size(tmplt, rec, field_id, len);
    1181  return UR_OK;
    1182 }
    1183 
    1184 char *ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id)
    1185 {
    1186  int elem_cnt = ur_array_get_elem_cnt(tmplt, rec, field_id);
    1187  int elem_size = ur_array_get_elem_size(field_id);
    1188  if (ur_array_resize(tmplt, rec, field_id, (elem_cnt + 1) * elem_size) == UR_OK) {
    1189  return (char *) ur_get_ptr_by_id(tmplt, rec, field_id) + elem_cnt * elem_size;
    1190  } else {
    1191  return NULL;
    1192  }
    1193 }
    1194 
    1195 void ur_clear_varlen(const ur_template_t * tmplt, void *rec)
    1196 {
    1197  //set null offset and length for all dynamic fields
    1198  for (int i = tmplt->first_dynamic; i < tmplt->count; i++) {
    1199  ur_set_var_offset(tmplt, rec, tmplt->ids[i], 0);
    1200  ur_set_var_len(tmplt, rec, tmplt->ids[i], 0);
    1201  }
    1202 }
    1203 
    1204 uint16_t ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec)
    1205 {
    1206  int size = 0;
    1207  for (int i = tmplt->first_dynamic; i < tmplt->count; i++) {
    1208  size += ur_get_var_len(tmplt, rec, tmplt->ids[i]);
    1209  }
    1210  return size;
    1211 }
    1212 
    1213 // Allocate memory for UniRec record
    1214 void *ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size)
    1215 {
    1216  unsigned int size = (unsigned int)tmplt->static_size + max_var_size;
    1217  if (size > UR_MAX_SIZE)
    1218  size = UR_MAX_SIZE;
    1219  return (void *) calloc(size, 1);
    1220 }
    1221 
    1222 // Free UniRec record
    1223 void ur_free_record(void *record)
    1224 {
    1225  free(record);
    1226 }
    1227 
    1228 // Get dynamic field as C string (allocate, copy and append '\0')
    1229 char *ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
    1230 {
    1231  uint16_t size = ur_get_var_len(tmplt, rec, field_id);
    1232  char *str = malloc(size + 1);
    1233  if (str == NULL)
    1234  return NULL;
    1235  if (size > 0) {
    1236  const char *p = ur_get_ptr_by_id(tmplt, rec, field_id);
    1237  memcpy(str, p, size);
    1238  }
    1239  str[size] = '\0';
    1240  return str;
    1241 }
    1242 
    1243 inline void *ur_clone_record(const ur_template_t *tmplt, const void *src)
    1244 {
    1245  uint16_t varsize = ur_rec_varlen_size(tmplt, src);
    1246  void *copy = ur_create_record(tmplt, varsize);
    1247  if (copy) {
    1248  memcpy(copy, src, ur_rec_fixlen_size(tmplt) + varsize);
    1249  }
    1250  return copy;
    1251 }
    1252 
    1253 void ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
    1254 {
    1255  int size_of_field = 0;
    1256  void * ptr_dst = NULL;
    1257  void * ptr_src = NULL;
    1258  uint16_t size = src_tmplt->offset_size < dst_tmplt->offset_size ? src_tmplt->offset_size : dst_tmplt->offset_size;
    1259  //Fields with same template can be copied by fully by memcpy
    1260  if (src_tmplt == dst_tmplt) {
    1261  memcpy(dst, src, ur_rec_size(src_tmplt, src));
    1262  return;
    1263 
    1264  }
    1265  // minimal value from offset table size
    1266  for (int i = 0; i < size; i++) {
    1267  // if two templates have the same field
    1268  if (src_tmplt->offset[i] != UR_INVALID_OFFSET && dst_tmplt->offset[i] != UR_INVALID_OFFSET) {
    1269  size_of_field = ur_get_size(i);
    1270  if (size_of_field > 0) {
    1271  // static fields
    1272  ptr_dst = ur_get_ptr_by_id(dst_tmplt, dst, i);
    1273  ptr_src = ur_get_ptr_by_id(src_tmplt, src, i);
    1274  memcpy(ptr_dst, ptr_src, size_of_field);
    1275  } else {
    1276  // variable-size fields
    1277  ptr_src = ur_get_ptr_by_id(src_tmplt, src, i);
    1278  size_of_field = ur_get_var_len(src_tmplt, src, i);
    1279  ur_set_var(dst_tmplt, dst, i, ptr_src, size_of_field);
    1280  }
    1281  }
    1282  }
    1283 }
    1284 
    1285 // Function for iterating over all fields in a given template
    1287 {
    1288  // Set first ID to check
    1289  if (id == UR_ITER_BEGIN) {
    1290  id = 0;
    1291  } else {
    1292  id++;
    1293  }
    1294  // Find first ID which is present in the template
    1295  while (id < tmplt->offset_size) {
    1296  if (tmplt->offset[id] != UR_INVALID_OFFSET) {
    1297  return id;
    1298  }
    1299  id++;
    1300  }
    1301  return UR_ITER_END;
    1302 }
    1303 
    1304 // Function for iterating over all fields in a given template. Fields are in the same
    1305 // order like in record
    1307 {
    1308  // Set first ID to check
    1309  if (index >= tmplt->count || index < 0) {
    1310  return UR_ITER_END;
    1311  }
    1312  return tmplt->ids[index];
    1313 }
    1314 
    1315 int ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    1316 {
    1317  ip_addr_t addr;
    1318  mac_addr_t macaddr;
    1319  int rv = 0;
    1320  ur_time_t urtime = 0;
    1321  void *ptr = ur_get_ptr_by_id(tmpl, data, f_id);
    1322  int elems_parsed = 0;
    1323  int elems_allocated = UR_ARRAY_ALLOC;
    1324  const char *scan_format = NULL;
    1325  const int element_size = ur_array_get_elem_size(f_id);
    1326 
    1327  if (ur_is_present(tmpl, f_id) == 0 || !ur_is_array(f_id)) {
    1328  return 1;
    1329  }
    1330  if (ur_array_allocate(tmpl, data, f_id, elems_allocated) != UR_OK) {
    1331  return 1;
    1332  }
    1333  while (v && *v == UR_ARRAY_DELIMITER) {
    1334  v++; // Skip the delimiter, move to beginning of the next value
    1335  }
    1336  switch (ur_get_type(f_id)) {
    1337  case UR_TYPE_A_UINT8:
    1338  scan_format = "%" SCNu8;
    1339  break;
    1340  case UR_TYPE_A_UINT16:
    1341  scan_format = "%" SCNu16;
    1342  break;
    1343  case UR_TYPE_A_UINT32:
    1344  scan_format = "%" SCNu32;
    1345  break;
    1346  case UR_TYPE_A_UINT64:
    1347  scan_format = "%" SCNu64;
    1348  break;
    1349  case UR_TYPE_A_INT8:
    1350  scan_format = "%" SCNi8;
    1351  break;
    1352  case UR_TYPE_A_INT16:
    1353  scan_format = "%" SCNi16;
    1354  break;
    1355  case UR_TYPE_A_INT32:
    1356  scan_format = "%" SCNi32;
    1357  break;
    1358  case UR_TYPE_A_INT64:
    1359  scan_format = "%" SCNi64;
    1360  break;
    1361  case UR_TYPE_A_FLOAT:
    1362  scan_format = "%f";
    1363  break;
    1364  case UR_TYPE_A_DOUBLE:
    1365  scan_format = "%lf";
    1366  break;
    1367  case UR_TYPE_A_IP:
    1368  // IP address - convert to human-readable format
    1369  while (v && *v) {
    1370  char tmp[64];
    1371  const char *ip = tmp;
    1372  char *end;
    1373  end = strchr(v, UR_ARRAY_DELIMITER);
    1374  if (end == NULL) {
    1375  ip = v;
    1376  if (*v == 0) {
    1377  break;
    1378  }
    1379  } else {
    1380  memcpy(tmp, v, end - v);
    1381  tmp[end - v] = 0;
    1382  }
    1383  v = end;
    1384  if (ip_from_str(ip, &addr) == 0) {
    1385  rv = 1;
    1386  break;
    1387  }
    1388  ((ip_addr_t *) ptr)[elems_parsed] = addr;
    1389  elems_parsed++;
    1390  if (elems_parsed >= elems_allocated) {
    1391  elems_allocated += UR_ARRAY_ALLOC;
    1392  if (ur_array_allocate(tmpl, data, f_id, elems_allocated) != UR_OK) {
    1393  return 1;
    1394  }
    1395  }
    1396  while (v && *v == UR_ARRAY_DELIMITER) {
    1397  v++; // Skip the delimiter, move to beginning of the next value
    1398  }
    1399  }
    1400  break;
    1401  case UR_TYPE_A_MAC:
    1402  // MAC address - convert to human-readable format
    1403  while (v && *v) {
    1404  if (mac_from_str(v, &macaddr) == 0) {
    1405  rv = 1;
    1406  break;
    1407  }
    1408  ((mac_addr_t *) ptr)[elems_parsed] = macaddr;
    1409  elems_parsed++;
    1410  if (elems_parsed >= elems_allocated) {
    1411  elems_allocated += UR_ARRAY_ALLOC;
    1412  if (ur_array_allocate(tmpl, data, f_id, elems_allocated) != UR_OK) {
    1413  return 1;
    1414  }
    1415  }
    1416  v = strchr(v, UR_ARRAY_DELIMITER);
    1417  while (v && *v == UR_ARRAY_DELIMITER) {
    1418  v++; // Skip the delimiter, move to beginning of the next value
    1419  }
    1420  }
    1421  break;
    1422  case UR_TYPE_A_TIME:
    1423  // Timestamp - convert from human-readable format
    1424  while (v && *v) {
    1425  char tmp[64];
    1426  const char *time = tmp;
    1427  char *end;
    1428  end = strchr(v, UR_ARRAY_DELIMITER);
    1429  if (end == NULL) {
    1430  time = v;
    1431  if (*v == 0) {
    1432  break;
    1433  }
    1434  } else {
    1435  memcpy(tmp, v, end - v);
    1436  tmp[end - v] = 0;
    1437  }
    1438  if (ur_time_from_string(&urtime, time) != 0) {
    1439  rv = 1;
    1440  break;
    1441  }
    1442  ((ur_time_t *) ptr)[elems_parsed] = urtime;
    1443  elems_parsed++;
    1444  if (elems_parsed >= elems_allocated) {
    1445  elems_allocated += UR_ARRAY_ALLOC;
    1446  if (ur_array_allocate(tmpl, data, f_id, elems_allocated) != UR_OK) {
    1447  return 1;
    1448  }
    1449  }
    1450  v = strchr(v, UR_ARRAY_DELIMITER);
    1451  while (v && *v == UR_ARRAY_DELIMITER) {
    1452  v++; // Skip the delimiter, move to beginning of the next value
    1453  }
    1454  }
    1455  break;
    1456  default:
    1457  fprintf(stderr, "Unsupported UniRec field type, skipping.\n");
    1458  ur_array_allocate(tmpl, data, f_id, 0);
    1459  break;
    1460  }
    1461 
    1462  if (scan_format != NULL) {
    1463  while (v && *v) {
    1464  if (sscanf(v, scan_format, (void *) ((char*) ptr + elems_parsed * element_size)) != 1) {
    1465  rv = 1;
    1466  break;
    1467  }
    1468  elems_parsed++;
    1469  if (elems_parsed >= elems_allocated) {
    1470  elems_allocated += UR_ARRAY_ALLOC;
    1471  if (ur_array_allocate(tmpl, data, f_id, elems_allocated) != UR_OK) {
    1472  return 1;
    1473  }
    1474  }
    1475  v = strchr(v, UR_ARRAY_DELIMITER);
    1476  while (v && *v == UR_ARRAY_DELIMITER) {
    1477  v++; // Skip the delimiter, move to beginning of the next value
    1478  }
    1479  }
    1480  }
    1481 
    1482  if (elems_allocated > elems_parsed) {
    1483  ur_array_allocate(tmpl, data, f_id, elems_parsed);
    1484  }
    1485  return rv;
    1486 }
    1487 int ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    1488 {
    1489  ip_addr_t *addr_p = NULL, addr;
    1490  mac_addr_t *macaddr_p = NULL, macaddr;
    1491  int rv = 0;
    1492  ur_time_t urtime = 0;
    1493  void *ptr = ur_get_ptr_by_id(tmpl, data, f_id);
    1494 
    1495  if (ur_is_present(tmpl, f_id) == 0) {
    1496  return 1;
    1497  }
    1498  switch (ur_get_type(f_id)) {
    1499  case UR_TYPE_UINT8:
    1500  if (sscanf(v, "%" SCNu8, (uint8_t *) ptr) != 1) {
    1501  rv = 1;
    1502  }
    1503  break;
    1504  case UR_TYPE_UINT16:
    1505  if (sscanf(v, "%" SCNu16 , (uint16_t *) ptr) != 1) {
    1506  rv = 1;
    1507  }
    1508  break;
    1509  case UR_TYPE_UINT32:
    1510  if (sscanf(v, "%" SCNu32, (uint32_t *) ptr) != 1) {
    1511  rv = 1;
    1512  }
    1513  break;
    1514  case UR_TYPE_UINT64:
    1515  if (sscanf(v, "%" SCNu64, (uint64_t *) ptr) != 1) {
    1516  rv = 1;
    1517  }
    1518  break;
    1519  case UR_TYPE_INT8:
    1520  if (sscanf(v, "%" SCNi8, (int8_t *) ptr) != 1) {
    1521  rv = 1;
    1522  }
    1523  break;
    1524  case UR_TYPE_INT16:
    1525  if (sscanf(v, "%" SCNi16, (int16_t *) ptr) != 1) {
    1526  rv = 1;
    1527  }
    1528  break;
    1529  case UR_TYPE_INT32:
    1530  if (sscanf(v, "%" SCNi32, (int32_t *) ptr) != 1) {
    1531  rv = 1;
    1532  }
    1533  break;
    1534  case UR_TYPE_INT64:
    1535  if (sscanf(v, "%" SCNi64, (int64_t *) ptr) != 1) {
    1536  rv = 1;
    1537  }
    1538  break;
    1539  case UR_TYPE_CHAR:
    1540  if (sscanf(v, "%c", (char *) ptr) != 1) {
    1541  rv = 1;
    1542  }
    1543  break;
    1544  case UR_TYPE_FLOAT:
    1545  if (sscanf(v, "%f", (float *) ptr) != 1) {
    1546  rv = 1;
    1547  }
    1548  break;
    1549  case UR_TYPE_DOUBLE:
    1550  if (sscanf(v, "%lf", (double *) ptr) != 1) {
    1551  rv = 1;
    1552  }
    1553  break;
    1554  case UR_TYPE_IP:
    1555  // IP address - convert to human-readable format
    1556  if (ip_from_str(v, &addr) == 0) {
    1557  rv = 1;
    1558  break;
    1559  }
    1560  addr_p = (ip_addr_t *) ptr;
    1561  (*addr_p) = addr;
    1562  break;
    1563  case UR_TYPE_MAC:
    1564  // MAC address - convert to human-readable format
    1565  if (mac_from_str(v, &macaddr) == 0) {
    1566  rv = 1;
    1567  break;
    1568  }
    1569  macaddr_p = (mac_addr_t *) ptr;
    1570  (*macaddr_p) = macaddr;
    1571  break;
    1572  case UR_TYPE_TIME:
    1573  // Timestamp - convert from human-readable format
    1574  if (ur_time_from_string(&urtime, v) != 0) {
    1575  fprintf(stderr, "Failed to parse time.\n");
    1576  }
    1577  (*(ur_time_t *) ptr) = urtime;
    1578  break;
    1579  case UR_TYPE_STRING:
    1580  // Printable string
    1581  ur_set_var(tmpl, data, f_id, v, strlen(v));
    1582  break;
    1583  case UR_TYPE_BYTES:
    1584  {
    1585  // Generic string of bytes
    1586  int size = strlen(v)/2;
    1587  ur_var_change_size(tmpl, data, f_id, size);
    1588  unsigned char *data_ptr = ur_get_ptr_by_id(tmpl, data, f_id);
    1589  for ( ; size > 0; --size, v += 2, ++data_ptr) {
    1590  if (sscanf(v, "%2hhx", data_ptr) != 1) {
    1591  rv = 1;
    1592  }
    1593  }
    1594  }
    1595  break;
    1596  default:
    1597  if (ur_is_array(f_id)) {
    1598  return ur_set_array_from_string(tmpl, data, f_id, v);
    1599  }
    1600  fprintf(stderr, "Unsupported UniRec field type, skipping.\n");
    1601  break;
    1602  }
    1603  return rv;
    1604 }
    1605 
    1606 uint8_t ur_time_from_string(ur_time_t *ur, const char *str)
    1607 {
    1608  struct tm t;
    1609  time_t sec = -1;
    1610  uint64_t nsec = 0;
    1611  char *res = NULL;
    1612 
    1613  if (ur == NULL || str == NULL) {
    1614  return 2;
    1615  }
    1616 
    1617  res = strptime(str, "%Y-%m-%dT%T", &t);
    1618  /* parsed to sec - msec delimiter */
    1619  if ((res != NULL) && ((*res == '.') || (*res == 0) || (*res == 'z') || (*res == 'Z'))) {
    1620  sec = timegm(&t);
    1621  if (sec != -1) {
    1622  if (*res != 0 && *++res != 0) {
    1623  char frac_buffer[10];
    1624  memset(frac_buffer, '0', 9);
    1625  frac_buffer[9] = 0;
    1626 
    1627  // now "res" points to the beginning of the fractional part or 'Z' for UTC timezone,
    1628  // which have at least one char.
    1629  // Expand the number by zeros to the right to get it in ns
    1630  // (if there are more than 9 digits, truncate the rest)
    1631  size_t frac_len = strlen(res);
    1632  if (frac_len > 0 && (res[frac_len - 1] == 'z' || res[frac_len - 1] == 'Z')) {
    1633  frac_len--;
    1634  }
    1635  if (frac_len > 9) {
    1636  frac_len = 9;
    1637  }
    1638  memcpy(frac_buffer, res, frac_len);
    1639  nsec = strtoul(frac_buffer, NULL, 10); // returns 0 on error - that's OK
    1640  }
    1641  *ur = ur_time_from_sec_nsec((uint64_t) sec, nsec);
    1642  } else {
    1643  goto failed_time_parsing;
    1644  }
    1645  /* success */
    1646  return 0;
    1647  } else {
    1648 failed_time_parsing:
    1649  *ur = (ur_time_t) 0;
    1650  /* parsing error */
    1651  return 1;
    1652  }
    1653 }
    1654 
    1655 char *ur_cpy_string(const char *str)
    1656 {
    1657  int str_len = strlen(str) + 1;
    1658  char *new_str = malloc(sizeof(char) * str_len);
    1659  if (new_str == NULL) {
    1660  return NULL;
    1661  }
    1662  memcpy(new_str, str, str_len);
    1663  return new_str;
    1664 }
    1665 
    1666 const char *ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value)
    1667 {
    1668  for (int i = start; i < end; i++) {
    1669  if (ur_values[i].value == value) {
    1670  return ur_values[i].name;
    1671  }
    1672  }
    1673  return NULL;
    1674 }
    1675 
    1676 const char *ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value)
    1677 {
    1678  for (int i = start; i < end; i++) {
    1679  if (ur_values[i].value == value) {
    1680  return ur_values[i].description;
    1681  }
    1682  }
    1683  return NULL;
    1684 }
    1685 // *****************************************************************************
    1686 // ** "Links" part - set of functions for handling LINK_BIT_FIELD
    1687 
    1688 // Create and initialize links structure.
    1689 ur_links_t *ur_create_links(const char *mask)
    1690 {
    1691  uint64_t checker;
    1692  unsigned int indexer;
    1693  ur_links_t *lm;
    1694 
    1695  // Allocate memory for structure.
    1696  lm = (ur_links_t *) malloc(sizeof(ur_links_t));
    1697  if (lm == NULL) {
    1698  return NULL;
    1699  }
    1700 
    1701  // Try to convert passed mask in string to uint64_t.
    1702  if (sscanf(mask, "%"SCNx64, &lm->link_mask) < 1) {
    1703  free(lm);
    1704  return NULL;
    1705  }
    1706 
    1707  // Get link count.
    1708  lm->link_count = 0;
    1709  checker = 1;
    1710  for (int i = 0; i < MAX_LINK_COUNT; ++i) {
    1711  if (lm->link_mask & checker) {
    1712  lm->link_count++;
    1713  }
    1714  checker <<= 1;
    1715  }
    1716  if (lm->link_count == 0) {
    1717  free(lm);
    1718  return NULL;
    1719  }
    1720  // Allocate array for link indexes
    1721  lm->link_indexes = (uint64_t *) malloc(lm->link_count * sizeof(uint64_t));
    1722  if (lm->link_indexes == NULL) {
    1723  free(lm);
    1724  return NULL;
    1725  }
    1726 
    1727  // Fill link indexes
    1728  indexer = 0;
    1729  checker = 1;
    1730  for (int i = 0; i < MAX_LINK_COUNT; ++i) {
    1731  if (lm->link_mask & checker) {
    1732  lm->link_indexes[indexer++] = i;
    1733  }
    1734  checker <<= 1;
    1735  }
    1736 
    1737  return lm;
    1738 }
    1739 
    1740 // Destroy links structure.
    1742 {
    1743  if (links != NULL) {
    1744  free(links->link_indexes);
    1745  free(links);
    1746  }
    1747 }
    1748 // Following functions are defined in links.h
    1749 // (their headers are repeated here with INLINE_IMPL to generate externally
    1750 // linkable code)
    1751 
    1752 // Get index of link (0 - (link_count-1))
    1753 INLINE_IMPL int ur_get_link_index(ur_links_t *links, uint64_t link_bit_field);
    1754 
    1755 // Get position in link_bit_field of link
    1756 INLINE_IMPL uint64_t ur_get_link_bit_field_position(ur_links_t *links, unsigned int index);
    1757 
    1758 // Get link mask.
    1759 INLINE_IMPL uint64_t ur_get_link_mask(ur_links_t *links);
    1760 
    1761 // Get link count.
    1762 INLINE_IMPL unsigned int ur_get_link_count(ur_links_t *links);
    1763 
    1764 // END OF "Links" part *********************************************************
    1765 // *****************************************************************************
    1766 
    var-len fields (string where only printable characters are expected; &#39;\0&#39; at the end should NOT be in...
    Definition: unirec.h:96
    +
    #define UR_FIELD_ID_MAX
    Max ID of a field.
    Definition: unirec.h:70
    +
    INLINE_IMPL void mac_to_bytes(const mac_addr_t *addr, uint8_t *array)
    Definition: macaddr.h:144
    +
    int (8b)
    Definition: unirec.h:102
    +
    INLINE_IMPL ip_addr_t ip_from_16_bytes_le(char b[16])
    Definition: ipaddr.h:249
    +
    float (32b)
    Definition: unirec.h:107
    +
    ur_iter_t ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id)
    Iterate over fields of a template in order of a record This function can be used to iterate over all ...
    Definition: unirec.c:1286
    +
    #define UR_E_INVALID_FIELD_ID
    The field ID is not present in a template.
    Definition: unirec.h:85
    +
    int ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    Set value of a UniRec array field.
    Definition: unirec.c:1315
    +
    int (8b) array
    Definition: unirec.h:115
    +
    ur_tmplt_direction direction
    Direction of data input, output, bidirection, no direction.
    Definition: unirec.h:198
    +
    Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm.
    Definition: unirec.h:182
    +
    INLINE_IMPL uint32_t ip_get_v4_as_int(ip_addr_t *addr)
    Definition: ipaddr.h:157
    +
    #define ur_get_type(field_id)
    Get type of UniRec field Get type of any UniRec defined field.
    Definition: unirec.h:388
    +
    int ur_define_set_of_fields(const char *ifc_data_fmt)
    Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existin...
    Definition: unirec.c:558
    +
    void * ur_clone_record(const ur_template_t *tmplt, const void *src)
    Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it...
    Definition: unirec.c:1243
    +
    input direction
    Definition: unirec.h:131
    +
    uint8_t ur_time_from_string(ur_time_t *ur, const char *str)
    Definition: unirec.c:1606
    +
    INLINE_IMPL mac_addr_t mac_from_bytes(uint8_t *array)
    Definition: macaddr.h:83
    +
    #define ur_get_name(field_id)
    Get name of UniRec field Get name of any UniRec defined field.
    Definition: unirec.h:380
    +
    ur_field_id_t ur_allocated_fields
    Definition: unirec.h:173
    +
    #define ur_get_var_offset(tmplt, rec, field_id)
    Get offset of variable-length field in the record. Get offset of a specified variable-length field in...
    Definition: unirec.h:464
    + +
    MAC address (48b) array.
    Definition: unirec.h:125
    +
    int (64b)
    Definition: unirec.h:106
    +
    ur_field_id_t id
    ID of a field.
    Definition: unirec.h:185
    +
    int ur_get_empty_id()
    Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures.
    Definition: unirec.c:288
    + +
    char * name
    Name of Value.
    Definition: ur_values.h:15
    +
    ur_template_t * ur_create_template(const char *fields, char **errstr)
    Create UniRec template Create new UniRec template specified by a string containing names of its field...
    Definition: unirec.c:900
    +
    #define UR_INITIAL_SIZE_FIELDS_TABLE
    Initial size of free space in fields tables.
    Definition: unirec.h:69
    +
    char * description
    Description of Value.
    Definition: ur_values.h:16
    +
    const char * ur_get_type_and_name_from_string(const char *source, char **name, char **type, int *length_name, int *length_type)
    Definition: unirec.c:368
    +
    unsigned int (16b)
    Definition: unirec.h:101
    +
    void ur_clear_varlen(const ur_template_t *tmplt, void *rec)
    Clear variable-length part of a record. For better performance of setting content to variable-length ...
    Definition: unirec.c:1195
    +
    int ur_define_field(const char *name, ur_field_type_t type)
    Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structur...
    Definition: unirec.c:636
    +
    #define ur_set_var_len(tmplt, rec, field_id, len)
    Set size of variable-length field in the record. Set size of specified variable-length field in the r...
    Definition: unirec.h:485
    +
    const char * ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value)
    Returns description of specified value (Helper function) Helper function for ur_values_get_descriptio...
    Definition: unirec.c:1676
    +
    #define ur_is_array(field_id)
    Definition: unirec.h:526
    + +
    ur_static_field_specs_t UR_FIELD_SPECS_STATIC
    Structure that lists staticaly defined UniRec field specifications such as names, types...
    Definition: unirec.c:202
    +
    short * ur_field_sizes
    Array of sizes of fields.
    Definition: unirec.h:166
    +
    int ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    Set UniRec template to ouput interface on specified context.
    Definition: unirec.c:836
    +
    char * ur_cpy_string(const char *str)
    Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user.
    Definition: unirec.c:1655
    +
    *uint16_t * ur_get_ptr_by_id(tmplt2, buffer2, new_id))
    + +
    short * ur_field_sizes
    Array of sizes of fields.
    Definition: unirec.h:154
    +
    int ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    Set value of a UniRec field.
    Definition: unirec.c:1487
    +
    ur_template_t * ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    Create UniRec template and set it to output interface on specified context Creates UniRec template...
    Definition: unirec.c:817
    +
    bidirection
    Definition: unirec.h:133
    +
    INLINE_IMPL ip_addr_t ip_from_16_bytes_be(char b[16])
    Definition: ipaddr.h:236
    +
    int ur_field_array_elem_type[]
    UniRec array element data types.
    Definition: unirec.c:168
    +
    MAC address (48b)
    Definition: unirec.h:110
    +
    #define UR_INITIALIZED
    Indicator if the UniRec has been initialized by calling function ur_init.
    Definition: unirec.h:81
    +
    INLINE_IMPL void mac_to_str(const mac_addr_t *addr, char *str)
    Definition: macaddr.h:129
    +
    IP address (128b) array.
    Definition: unirec.h:124
    +
    #define UR_MAX_SIZE
    Definition: unirec.h:1013
    +
    #define UR_OK
    No problem.
    Definition: unirec.h:90
    +
    #define ur_is_static(field_id)
    Alias for ur_is_fixlen (for backwards compatibility only)
    Definition: unirec.h:662
    +
    #define UR_E_INVALID_PARAMETER
    The given parameter is wrong.
    Definition: unirec.h:84
    + +
    char ** ur_field_names
    Array of names of fields.
    Definition: unirec.h:165
    +
    uint64_t ur_time_t
    Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoc...
    Definition: ur_time.h:61
    +
    #define UR_ARRAY_ALLOC
    Default alloc size increment for ur_set_array_from_string.
    Definition: unirec.h:73
    +
    char ** ur_field_names
    Array of names of fields.
    Definition: unirec.h:153
    +
    free(rec)
    +
    #define ur_rec_size(tmplt, rec)
    Get size of UniRec record (static and variable length) Get total size of whole UniRec record...
    Definition: unirec.h:680
    +
    INLINE_IMPL int ip_from_str(const char *str, ip_addr_t *addr)
    Definition: ipaddr.h:301
    +
    char * name
    Name of a field.
    Definition: unirec.h:183
    +
    #define INLINE_IMPL
    Definition: inline.h:13
    +
    #define UR_ITER_BEGIN
    First value in iterating through the fields.
    Definition: unirec.h:75
    +
    INLINE_IMPL int ip_cmp(const ip_addr_t *addr1, const ip_addr_t *addr2)
    Definition: ipaddr.h:266
    +
    UniRec default field list It contains all fields which are specified statically in source code of a m...
    Definition: unirec.h:152
    +
    unsigned int (64b) array
    Definition: unirec.h:120
    +
    int (32b)
    Definition: unirec.h:104
    +
    #define UR_E_MEMORY
    Problem during allocating memory.
    Definition: unirec.h:89
    +
    const int ur_field_type_size[]
    Sizes of UniRec data types.
    Definition: unirec.c:94
    +
    int ur_get_field_type_from_str(const char *type)
    Definition: unirec.c:355
    +
    char * ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id)
    Allocate new element at the end of array and return its pointer.
    Definition: unirec.c:1184
    +
    INLINE_IMPL ip_addr_t ip_from_4_bytes_be(char b[4])
    Definition: ipaddr.h:199
    + +
    ur_template_t * ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt)
    Expand UniRec template Expand existing UniRec template by a string containing types and names of its ...
    Definition: unirec.c:486
    +
    ur_template_t * ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt)
    Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields)...
    Definition: unirec.c:610
    +
    #define ur_get_len(tmplt, rec, field)
    Get length of UniRec field Get actual length of fixed or variable-length UniRec field.
    Definition: unirec.h:506
    +
    void ur_finalize()
    Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program&#39;s end. This function has to be called if some fields are defined during run-time, otherwise this function is needless.
    Definition: unirec.c:734
    + +
    ur_template_t * ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    Create UniRec template and set it to input interface on specified context Creates UniRec template...
    Definition: unirec.c:798
    +
    int ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
    Set content of variable-length UniRec field Copy given data into variable-length UniRec field...
    Definition: unirec.c:1152
    +
    printf("%u %u %u %s\, ur_get(tmplt, buffer, F_FOO), ip_get_v4_as_int(&(ur_get(tmplt, buffer, F_IP))), ur_get_var_len(tmplt, buffer, F_STR1), ur_get_ptr(tmplt, buffer, F_STR1))
    +
    char * ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
    Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec recor...
    Definition: unirec.c:1229
    +
    IP address (128b)
    Definition: unirec.h:109
    +
    #define UR_ARRAY_DELIMITER
    Delimiter of array elements in string.
    Definition: unirec.h:72
    +
    unsigned int (32b) array
    Definition: unirec.h:118
    +
    unsigned int (64b)
    Definition: unirec.h:105
    +
    const ur_values_t ur_values[]
    Definition: ur_values.c:6
    +
    template is not used for sending data
    Definition: unirec.h:130
    +
    #define UR_E_TYPE_MISMATCH
    The type of a field is different.
    Definition: unirec.h:86
    +
    #define ur_array_allocate(tmplt, rec, field_id, elem_cnt)
    Preallocates UniRec array field to have requested number of elements.
    Definition: unirec.h:629
    +
    #define UR_COUNT_OF_TYPES
    Constants for all possible types of UniRec fields.
    Definition: unirec.h:94
    +
    void * rec
    +
    ur_field_type_t * ur_field_types
    Array of types of fields.
    Definition: unirec.h:167
    +
    ur_field_specs_t ur_field_specs
    Structure that lists UniRec field specifications such as names, types, id.
    Definition: unirec.c:201
    +
    mac_addr_t
    Definition: macaddr.h:75
    + +
    #define UR_E_INVALID_TYPE
    The type of a field is not defined.
    Definition: unirec.h:88
    +
    #define ur_array_get_elem_size(field_id)
    Get size of a single element of UniRec field.
    Definition: unirec.h:535
    +
    int ur_undefine_field_by_id(ur_field_id_t field_id)
    Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from...
    Definition: unirec.c:695
    +
    void * ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size)
    Definition: unirec.c:1214
    +
    uint16_t count
    Count of fields in template.
    Definition: unirec.h:196
    +
    #define UR_DEFAULT_LENGTH_OF_TEMPLATE
    Definition: unirec.h:66
    +
    unsigned int (16b) array
    Definition: unirec.h:116
    +
    #define UR_E_INVALID_NAME
    The given name is not present in a template.
    Definition: unirec.h:87
    +
    UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields.
    Definition: unirec.h:164
    +
    int ur_undefine_field(const char *name)
    Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field fr...
    Definition: unirec.c:720
    +
    ur_template_t * ur_create_template_from_ifc_spec(const char *ifc_data_fmt)
    Create UniRec template from data format string. Creates new UniRec template (function ur_create_templ...
    Definition: unirec.c:625
    +
    double (64b)
    Definition: unirec.h:108
    +
    #define UR_NO_DYNAMIC_VALUES
    Value of variable "first_dynamic" if no dynamic values are present.
    Definition: unirec.h:79
    +
    int16_t * ids
    Array of ids in template.
    Definition: unirec.h:194
    +
    #define ur_is_present(tmplt, field_id)
    Is given field present in given template? Return true (non-zero value) if given template contains fie...
    Definition: unirec.h:638
    + +
    #define UR_ITER_END
    Last value in iterating through the fields.
    Definition: unirec.h:76
    +
    #define ur_get_var_len(tmplt, rec, field_id)
    Get size of a variable sized field in the record. Get size of a variable-length field in the record...
    Definition: unirec.h:474
    +
    int (8b) array
    Definition: unirec.h:117
    +
    void ur_free_record(void *record)
    Definition: unirec.c:1223
    +
    int16_t ur_field_id_t
    Type of UniRec field identifiers.
    Definition: unirec.h:136
    + +
    #define UR_INVALID_OFFSET
    Default value of all offsets (value is not in the record)
    Definition: unirec.h:78
    +
    INLINE_IMPL ip_addr_t ip_from_int(uint32_t i)
    Definition: ipaddr.h:183
    +
    uint16_t ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec)
    Get size of variable sized part of UniRec record Get total size of all variable-length fields in an U...
    Definition: unirec.c:1204
    +
    int (32b) array
    Definition: unirec.h:119
    +
    void ur_free_template(ur_template_t *tmplt)
    Destroy UniRec template Free all memory allocated for a template created previously by ur_create_temp...
    Definition: unirec.c:1088
    +
    ur_field_id_t ur_last_id
    Last specified ID.
    Definition: unirec.h:156
    +
    Definition of UniRec structures and functions.
    +
    ur_template_t * ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
    Create UniRec template and set it to input and output interface on specified context Creates UniRec t...
    Definition: unirec.c:875
    +
    #define ur_array_get_elem_cnt(tmplt, rec, field_id)
    Get number of elements stored in an UniRec array.
    Definition: unirec.h:546
    +
    INLINE_IMPL int ip_is6(const ip_addr_t *addr)
    Definition: ipaddr.h:143
    +
    #define ur_rec_fixlen_size(tmplt)
    Get size of fixed-length part of UniRec record Get total size of UniRec record except variable-length...
    Definition: unirec.h:671
    +
    INLINE_IMPL int mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2)
    Definition: macaddr.h:118
    +
    var-len fields (generic string of bytes)
    Definition: unirec.h:97
    +
    uint16_t static_size
    Size of static part.
    Definition: unirec.h:197
    + +
    uint32_t ifc_out
    output interface number (stored only if the direction == UR_TMPLT_DIRECTION_BI)
    Definition: unirec.h:199
    +
    int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len)
    Change length of a array field.
    Definition: unirec.c:1170
    +
    int size
    Size of a field.
    Definition: unirec.h:184
    +
    #define ur_time_from_sec_nsec(sec, nsec)
    Convert seconds and nanoseconds to ur_time_t.
    Definition: ur_time.h:100
    +
    double (64b) array
    Definition: unirec.h:123
    +
    ur_field_id_t ur_last_statically_defined_id
    Last statically defined field by UR_FIELDS(...)
    Definition: unirec.h:168
    + +
    unsigned int (8b) array
    Definition: unirec.h:114
    +
    ur_field_id_t ur_last_id
    The highest ID of a field + 1.
    Definition: unirec.h:169
    +
    unsigned int (32b)
    Definition: unirec.h:103
    +
    memcpy(buffer, rec, ur_rec_size(tmplt, rec))
    + +
    int ur_init(ur_static_field_specs_t field_specs_static)
    Initialize UniRec structures Initialize UniRec structures. Function is called during defining first o...
    Definition: unirec.c:206
    +
    #define ur_get_size(field_id)
    Get size of UniRec field Get size of a fixed-length UniRec field. When variable-length field is passe...
    Definition: unirec.h:405
    +
    int ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    Set UniRec template to input interface on specified context.
    Definition: unirec.c:856
    +
    ur_field_id_t ur_iter_t
    Type for identifying iteration id through all fields.
    Definition: unirec.h:137
    +
    ur_field_type_t
    Definition: unirec.h:95
    +
    #define UR_DEFAULT_LENGTH_OF_FIELD_TYPE
    Definition: unirec.h:68
    +
    INLINE_IMPL int mac_from_str(const char *str, mac_addr_t *addr)
    Definition: macaddr.h:99
    +
    void ur_print_template(ur_template_t *tmplt)
    Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging)...
    Definition: unirec.c:1115
    +
    ur_field_id_linked_list_t * ur_undefine_fields
    linked list of free (undefined) IDs
    Definition: unirec.h:174
    +
    char * ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt)
    Parses field names from data format Function parses field names from data format and returns pointer ...
    Definition: unirec.c:434
    +
    INLINE_IMPL void ip_to_str(const ip_addr_t *addr, char *str)
    Definition: ipaddr.h:325
    +
    int compare_fields(const void *field1, const void *field2)
    Compare fields Compare two fields. This function is for sorting the fields in the right order...
    Definition: unirec.c:785
    +
    char * ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter)
    Get UniRec specifier of the tmplt template with delimiter between fields.
    Definition: unirec.c:253
    +
    uint16_t * offset
    Table of offsets.
    Definition: unirec.h:192
    +
    #define UR_UNINITIALIZED
    Indicator if the UniRec has not been initialized by calling function ur_init.
    Definition: unirec.h:80
    + +
    if(new_id< 0)
    +
    uint8_t intialized
    If the UniRec is initialized by function ur_init variable is set to UR_INITIALIZED, otherwise 0.
    Definition: unirec.h:175
    +
    uint16_t first_dynamic
    First dynamic (variable-length) field. Index to the ids array.
    Definition: unirec.h:195
    +
    int (64b) array
    Definition: unirec.h:121
    +
    ur_field_type_t * ur_field_types
    Array of types of fields.
    Definition: unirec.h:155
    +
    time (64b)
    Definition: unirec.h:111
    +
    INLINE_IMPL int ip_is4(const ip_addr_t *addr)
    Definition: ipaddr.h:131
    +
    void ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
    Copy data from one UniRec record to another. Copies all fields present in both templates from src to ...
    Definition: unirec.c:1253
    +
    void ur_var_change_size(const ur_template_t *tmplt, void *rec, int field_id, int new_val_len)
    Definition: unirec.c:1126
    +
    char
    Definition: unirec.h:98
    +
    #define ur_set_var_offset(tmplt, rec, field_id, offset_val)
    Set offset of variable-length field in the record. Set offset of specified variable-length field in t...
    Definition: unirec.h:496
    +
    unsigned int (8b)
    Definition: unirec.h:99
    +
    UniRec template. It contains a table mapping a field to its position in an UniRec record...
    Definition: unirec.h:191
    +
    time (64b) array
    Definition: unirec.h:126
    +
    const char UR_MEMORY_ERROR[]
    Definition: unirec.c:204
    +
    #define ur_size_of(type)
    Get size of UniRec type Get size of fixed-length UniRec type. For variable-length type return value <...
    Definition: unirec.h:372
    +
    ur_tmplt_direction
    Definition: unirec.h:129
    +
    int (8b)
    Definition: unirec.h:100
    +
    uint16_t offset_size
    size of offset table.
    Definition: unirec.h:193
    +
    INLINE_IMPL ip_addr_t ip_from_4_bytes_le(char b[4])
    Definition: ipaddr.h:218
    +
    int ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB)
    Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is no...
    Definition: unirec.c:1104
    +
    ur_iter_t ur_iter_fields_record_order(const ur_template_t *tmplt, int index)
    Iterate over fields of a template This function can be used to iterate over all fields of a given tem...
    Definition: unirec.c:1306
    +
    int ur_get_id_by_name(const char *name)
    Get ID of a field by its name Get ID of a field by its name.
    Definition: unirec.c:774
    +
    const char * ur_field_type_str[]
    UniRec data types.
    Definition: unirec.c:133
    +
    #define UR_DEFAULT_LENGTH_OF_FIELD_NAME
    Definition: unirec.h:67
    +
    const char * ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value)
    Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field.
    Definition: unirec.c:1666
    +
    #define ur_template_string(tmplt)
    Get string of a template Get names and sizes of fields separated by comma. Return string has to be fr...
    Definition: unirec.h:364
    +
    ouput direction
    Definition: unirec.h:132
    +
    INLINE_IMPL char * ip_get_v4_as_bytes(const ip_addr_t *addr)
    Definition: ipaddr.h:171
    +
    float (32b) array
    Definition: unirec.h:122
    +
    + + + + diff --git a/doc/unirec/unirec_8h.html b/doc/unirec/unirec_8h.html new file mode 100644 index 00000000..c446b423 --- /dev/null +++ b/doc/unirec/unirec_8h.html @@ -0,0 +1,1339 @@ + + + + + + + +UniRec: unirec.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    unirec.h File Reference
    +
    +
    + +

    Definition of UniRec structures and functions. +More...

    +
    #include <stdint.h>
    +#include "ipaddr.h"
    +#include "macaddr.h"
    +#include "ur_time.h"
    +#include "links.h"
    +#include "ur_values.h"
    +#include <libtrap/trap.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + +

    +Data Structures

    struct  ur_field_id_linked_list_t
     Linked list for undefined field ids Linked list consisting of field ids, which are freed after operation undefine. More...
     
    struct  ur_static_field_specs_t
     UniRec default field list It contains all fields which are specified statically in source code of a module. This structure is passed to ur_init() More...
     
    struct  ur_field_specs_t
     UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields. More...
     
    struct  field_spec_t
     Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm. More...
     
    struct  ur_template_t
     UniRec template. It contains a table mapping a field to its position in an UniRec record. More...
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    #define __STDC_LIMIT_MACROS
     
    #define UR_DEFAULT_LENGTH_OF_TEMPLATE   1024
     
    #define UR_DEFAULT_LENGTH_OF_FIELD_NAME   128
     
    #define UR_DEFAULT_LENGTH_OF_FIELD_TYPE   16
     
    #define UR_INITIAL_SIZE_FIELDS_TABLE   5
     Initial size of free space in fields tables. More...
     
    #define UR_FIELD_ID_MAX   INT16_MAX
     Max ID of a field. More...
     
    #define UR_FIELDS(...)
     Definition of UniRec fields. More...
     
    #define UR_ARRAY_DELIMITER   ' '
     Delimiter of array elements in string. More...
     
    #define UR_ARRAY_ALLOC   10
     Default alloc size increment for ur_set_array_from_string. More...
     
    #define UR_ITER_BEGIN   (-1)
     First value in iterating through the fields. More...
     
    #define UR_ITER_END   INT16_MAX
     Last value in iterating through the fields. More...
     
    #define UR_INVALID_OFFSET   0xffff
     Default value of all offsets (value is not in the record) More...
     
    #define UR_NO_DYNAMIC_VALUES   0xffff
     Value of variable "first_dynamic" if no dynamic values are present. More...
     
    #define UR_UNINITIALIZED   0
     Indicator if the UniRec has not been initialized by calling function ur_init. More...
     
    #define UR_INITIALIZED   1
     Indicator if the UniRec has been initialized by calling function ur_init. More...
     
    #define UR_INVALID_FIELD   ((ur_field_id_t) 0xffff)
     ID of invalid field. More...
     
    #define UR_E_INVALID_PARAMETER   -6
     The given parameter is wrong. More...
     
    #define UR_E_INVALID_FIELD_ID   -5
     The field ID is not present in a template. More...
     
    #define UR_E_TYPE_MISMATCH   -4
     The type of a field is different. More...
     
    #define UR_E_INVALID_NAME   -3
     The given name is not present in a template. More...
     
    #define UR_E_INVALID_TYPE   -2
     The type of a field is not defined. More...
     
    #define UR_E_MEMORY   -1
     Problem during allocating memory. More...
     
    #define UR_OK   0
     No problem. More...
     
    #define UR_COUNT_OF_TYPES   29
     Constants for all possible types of UniRec fields. More...
     
    #define TRAP_RECEIVE(ifc_num, data, data_size, tmplt)   TRAP_CTX_RECEIVE(trap_get_global_ctx(), ifc_num, data, data_size, tmplt);
     Receive data from interface Receive data with specified template from libtrap interface. If the receiving template is subset of sending template, it will define new fields and expand receiving template. More...
     
    #define TRAP_CTX_RECEIVE(ctx, ifc_num, data, data_size, tmplt)
     Receive data from interface with given context Receive data with specified template from libtrap interface with specified context. If the receiving template is subset of sending template, it will define new fields and expand receiving template. More...
     
    #define ur_template_string(tmplt)   ur_template_string_delimiter(tmplt, ',')
     Get string of a template Get names and sizes of fields separated by comma. Return string has to be freed by user. More...
     
    #define ur_size_of(type)   ur_field_type_size[type]
     Get size of UniRec type Get size of fixed-length UniRec type. For variable-length type return value < 0. More...
     
    #define ur_get_name(field_id)   ur_field_specs.ur_field_names[field_id]
     Get name of UniRec field Get name of any UniRec defined field. More...
     
    #define ur_get_type(field_id)   ur_field_specs.ur_field_types[field_id]
     Get type of UniRec field Get type of any UniRec defined field. More...
     
    #define ur_get_size(field_id)   ur_field_specs.ur_field_sizes[field_id]
     Get size of UniRec field Get size of a fixed-length UniRec field. When variable-length field is passed, return value < 0. To get real length of a variable-length field use ur_get_var_len. More...
     
    #define ur_get(tmplt, data, field_id)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]))
     Get value of UniRec field Get value of a fixed-length UniRec field. For variable-length fields, use ur_get_ptr or ur_get_ptr_by_id. More...
     
    #define ur_get_ptr(tmplt, data, field_id)
     Get pointer to UniRec field Get pointer to fixed or varible length statically defined UniRec field. For dynamically defined fields, use ur_get_ptr_by_id. More...
     
    #define ur_get_ptr_by_id(tmplt, data, field_id)
     Get pointer to UniRec field Get pointer to fixed or varible length UniRec field. In contrast to ur_get_ptr, field_id may be a variable (not only F_ token). Returned pointer is always void *. More...
     
    #define ur_set(tmplt, data, field_id, value)   (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]) = (value))
     Set value of UniRec (static) field Set value of a fixed-length UniRec field. For variable-length fields, use ur_set_var. More...
     
    #define ur_get_var_offset(tmplt, rec, field_id)   *((uint16_t *)((char *) rec + tmplt->offset[field_id]))
     Get offset of variable-length field in the record. Get offset of a specified variable-length field in the record. Given field has to be part of the record. More...
     
    #define ur_get_var_len(tmplt, rec, field_id)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2))
     Get size of a variable sized field in the record. Get size of a variable-length field in the record. Given field has to be part of the record. More...
     
    #define ur_set_var_len(tmplt, rec, field_id, len)   *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2)) = (uint16_t) len
     Set size of variable-length field in the record. Set size of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record. More...
     
    #define ur_set_var_offset(tmplt, rec, field_id, offset_val)   *((uint16_t *)((char *) rec + tmplt->offset[field_id])) = (uint16_t) offset_val
     Set offset of variable-length field in the record. Set offset of specified variable-length field in the record. Field has to be part of the record. It does not move other variable sized records. It just sets given value to the right position in the record. More...
     
    #define ur_get_len(tmplt, rec, field)   ur_is_static(field) ? ur_get_size(field) : ur_get_var_len(tmplt, rec, field)
     Get length of UniRec field Get actual length of fixed or variable-length UniRec field. More...
     
    #define ur_set_string(tmplt, rec, field_id, str)   ur_set_var(tmplt, rec, field_id, str, strlen(str))
     Set variable-length field to given string. Set contents of a variable-length field in the record. Field has to be part of the record. It copies string terminated with \0 and safely moves other variable-length records. More...
     
    #define ur_is_array(field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? 1 : 0)
     
    #define ur_array_get_elem_size(field_id)   (ur_field_type_size[ur_get_type(field_id)] < 0 ? -ur_field_type_size[ur_get_type(field_id)] : ur_field_type_size[ur_get_type(field_id)])
     Get size of a single element of UniRec field. More...
     
    #define ur_array_get_elem_cnt(tmplt, rec, field_id)   (ur_get_var_len(tmplt, rec, field_id) / ur_array_get_elem_size(field_id))
     Get number of elements stored in an UniRec array. More...
     
    #define ur_array_get_elem_type(field_id)   ur_field_array_elem_type[ur_get_type(field_id)]
     Get type of an element stored in an UniRec array. More...
     
    #define ur_array_set(tmplt, rec, field_id, index, element)
     Set element to array at given index. Automatically resizes array when index is out of array bounds. Set contents of a variable-length field in the record. Field has to be part of the record. More...
     
    #define ur_array_append(tmplt, rec, field_id, element)
     Set element to array at last position. Automatically resizes array. More...
     
    #define ur_array_clear(tmplt, rec, field_id)   ur_array_resize(tmplt, rec, field_id, 0)
     Clear contents of an UniRec array. Array is resized to 0 elements. More...
     
    #define ur_array_get(tmplt, rec, field_id, index)   ((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index]
     Get element of an array field at given index. More...
     
    #define ur_array_allocate(tmplt, rec, field_id, elem_cnt)   ur_array_resize(tmplt, rec, field_id, (elem_cnt) * ur_array_get_elem_size(field_id))
     Preallocates UniRec array field to have requested number of elements. More...
     
    #define ur_is_present(tmplt, field_id)   ((tmplt)->offset_size > (field_id) && (tmplt)->offset[(field_id)] != UR_INVALID_OFFSET)
     Is given field present in given template? Return true (non-zero value) if given template contains field with given ID. More...
     
    #define ur_is_varlen(field_id)   (ur_field_specs.ur_field_sizes[field_id] < 0)
     Is given field variable-length? Return true (non-zero value) if given ID refers to a field with variable length. More...
     
    #define ur_is_dynamic(field_id)   ur_is_varlen(field_id)
     Alias for ur_is_varlen (for backwards compatibility only) More...
     
    #define ur_is_fixlen(field_id)   (ur_field_specs.ur_field_sizes[field_id] >= 0)
     Is given field fixed-length? Return true (non-zero value) if given ID refers to a field with fixed length. More...
     
    #define ur_is_static(field_id)   ur_is_fixlen(field_id)
     Alias for ur_is_fixlen (for backwards compatibility only) More...
     
    #define ur_rec_fixlen_size(tmplt)   ((tmplt)->static_size)
     Get size of fixed-length part of UniRec record Get total size of UniRec record except variable-length fields. More...
     
    #define ur_rec_size(tmplt, rec)   (ur_rec_fixlen_size(tmplt) + ur_rec_varlen_size(tmplt, rec))
     Get size of UniRec record (static and variable length) Get total size of whole UniRec record. More...
     
    #define ur_create_input_template(ifc, fields, errstr)   ur_ctx_create_input_template(trap_get_global_ctx(), ifc, fields, errstr);
     Create UniRec template and set it to input interface Creates UniRec template (same like ur_create_template) and set this template to input interface of a module. More...
     
    #define ur_create_output_template(ifc, fields, errstr)   ur_ctx_create_output_template(trap_get_global_ctx(), ifc, fields, errstr);
     Create UniRec template and set it to output interface Creates UniRec template (same like ur_create_template) and set this template to ouput interface of a module. More...
     
    #define ur_set_output_template(ifc, tmplt)   ur_ctx_set_output_template(trap_get_global_ctx(), ifc, tmplt)
     Set UniRec template to ouput interface. More...
     
    #define ur_set_input_template(ifc, tmplt)   ur_ctx_set_input_template(trap_get_global_ctx(), ifc, tmplt)
     Set UniRec template to input interface. More...
     
    #define ur_create_bidirectional_template(ifc_in, ifc_out, fields, errstr)   ur_ctx_create_bidirectional_template(trap_get_global_ctx(), ifc_in, ifc_out, fields, errstr);
     Create UniRec template and set it to input and output interface Creates UniRec template (same like ur_create_template) and set this template to input and ouput interface of a module. More...
     
    #define UR_MAX_SIZE   0xffff
     
    #define ur_cpy(tmplt, src, dst)   (memcpy(dst,src,ur_rec_size(tmplt,src)))
     Copy data from one UniRec to another. Procedure gets template and void pointer of source and destination. Then it copies the data defined by the given template. The destination pointer must have required space allocated. More...
     
    #define ur_values_get_name(field, value)   ur_values_get_name_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
     Returns name of specified value This function returns name of specified value and field, which is defined in values file. More...
     
    #define ur_values_get_description(field, value)   ur_values_get_description_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
     Returns description of specified value This function returns description of specified value and field, which is defined in values file. More...
     
    + + + + + + + +

    +Typedefs

    typedef int16_t ur_field_id_t
     Type of UniRec field identifiers. More...
     
    typedef ur_field_id_t ur_iter_t
     Type for identifying iteration id through all fields. More...
     
    + + + + + +

    +Enumerations

    enum  ur_field_type_t {
    +  UR_TYPE_STRING, +UR_TYPE_BYTES, +UR_TYPE_CHAR, +UR_TYPE_UINT8, +
    +  UR_TYPE_INT8, +UR_TYPE_UINT16, +UR_TYPE_INT16, +UR_TYPE_UINT32, +
    +  UR_TYPE_INT32, +UR_TYPE_UINT64, +UR_TYPE_INT64, +UR_TYPE_FLOAT, +
    +  UR_TYPE_DOUBLE, +UR_TYPE_IP, +UR_TYPE_MAC, +UR_TYPE_TIME, +
    +  UR_TYPE_A_UINT8, +UR_TYPE_A_INT8, +UR_TYPE_A_UINT16, +UR_TYPE_A_INT16, +
    +  UR_TYPE_A_UINT32, +UR_TYPE_A_INT32, +UR_TYPE_A_UINT64, +UR_TYPE_A_INT64, +
    +  UR_TYPE_A_FLOAT, +UR_TYPE_A_DOUBLE, +UR_TYPE_A_IP, +UR_TYPE_A_MAC, +
    +  UR_TYPE_A_TIME +
    + }
     
    enum  ur_tmplt_direction { UR_TMPLT_DIRECTION_NO, +UR_TMPLT_DIRECTION_IN, +UR_TMPLT_DIRECTION_OUT, +UR_TMPLT_DIRECTION_BI + }
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    char * ur_template_string_delimiter (const ur_template_t *tmplt, int delimiter)
     Get UniRec specifier of the tmplt template with delimiter between fields. More...
     
    int ur_get_field_type_from_str (const char *type)
     
    char * ur_array_append_get_ptr (const ur_template_t *tmplt, void *rec, int field_id)
     Allocate new element at the end of array and return its pointer. More...
     
    int ur_init (ur_static_field_specs_t field_specs_static)
     Initialize UniRec structures Initialize UniRec structures. Function is called during defining first own field. More...
     
    int ur_get_empty_id ()
     Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures. More...
     
    int ur_define_field (const char *name, ur_field_type_t type)
     Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structures. If the field already exists (name and type are equal) it only returns its ID. More...
     
    int ur_define_set_of_fields (const char *ifc_data_fmt)
     Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existing structures. If the field already exists and type is equal nothing will happen. If the type is not equal an error will be returned. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2". More...
     
    int ur_undefine_field_by_id (ur_field_id_t field_id)
     Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
     
    int ur_undefine_field (const char *name)
     Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field from UniRec structures and the field ID can be used for another field. By undefining field, all templates which were using the undefined field, has to be recreated. More...
     
    void ur_finalize ()
     Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program's end. This function has to be called if some fields are defined during run-time, otherwise this function is needless. More...
     
    int ur_get_id_by_name (const char *name)
     Get ID of a field by its name Get ID of a field by its name. More...
     
    int compare_fields (const void *field1, const void *field2)
     Compare fields Compare two fields. This function is for sorting the fields in the right order. First by sizes (larger first) and then by names. More...
     
    ur_template_tur_create_template (const char *fields, char **errstr)
     Create UniRec template Create new UniRec template specified by a string containing names of its fields separated by commas. Example spec-string: "SRC_IP,DST_IP,SRC_PORT,DST_PORT,PROTOCOL,PACKETS" Order of fields is not important (templates with the same set of fields are equivalent). Template created by this function should be destroyed by ur_free_template. More...
     
    ur_template_tur_ctx_create_output_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
     Create UniRec template and set it to output interface on specified context Creates UniRec template, same like ur_create_output_template, but context is specified. More...
     
    ur_template_tur_ctx_create_input_template (trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
     Create UniRec template and set it to input interface on specified context Creates UniRec template, same like ur_create_input_template, but context is specified. More...
     
    int ur_ctx_set_output_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
     Set UniRec template to ouput interface on specified context. More...
     
    int ur_ctx_set_input_template (trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
     Set UniRec template to input interface on specified context. More...
     
    ur_template_tur_ctx_create_bidirectional_template (trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
     Create UniRec template and set it to input and output interface on specified context Creates UniRec template, same like ur_create_bidirectional_template, but context is specified. More...
     
    ur_template_tur_expand_template (const char *ifc_data_fmt, ur_template_t *tmplt)
     Expand UniRec template Expand existing UniRec template by a string containing types and names of its fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
     
    ur_template_tur_define_fields_and_update_template (const char *ifc_data_fmt, ur_template_t *tmplt)
     Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields) and create new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent). In case of success the given template will be destroyed and new template will be returned. More...
     
    ur_template_tur_create_template_from_ifc_spec (const char *ifc_data_fmt)
     Create UniRec template from data format string. Creates new UniRec template (function ur_create_template_from_ifc_spec). The string describing fields contain types and names of fields separated by commas. Example ifc_data_fmt: "uint32 FOO,uint8 BAR,float FOO2" Order of fields is not important (templates with the same set of fields are equivalent).. More...
     
    void ur_free_template (ur_template_t *tmplt)
     Destroy UniRec template Free all memory allocated for a template created previously by ur_create_template. More...
     
    int ur_template_compare (const ur_template_t *tmpltA, const ur_template_t *tmpltB)
     Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is not compared). More...
     
    void ur_print_template (ur_template_t *tmplt)
     Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging). If template does not contain any dynamic fields, print '-' instead. param[in] tmplt pointer to the template. More...
     
    int ur_set_var (const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
     Set content of variable-length UniRec field Copy given data into variable-length UniRec field, set its offset and length in a record and move data which are behind this field. For better performance use function ur_clear_varlen, before setting all variable fields in record. More...
     
    int ur_array_resize (const ur_template_t *tmplt, void *rec, int field_id, int len)
     Change length of a array field. More...
     
    void ur_clear_varlen (const ur_template_t *tmplt, void *rec)
     Clear variable-length part of a record. For better performance of setting content to variable-length fields, use this function before setting of all the variable-length fields. This function will clear all the variable-length fields, so they don't have to be moved in memory during setting of them. More...
     
    uint16_t ur_rec_varlen_size (const ur_template_t *tmplt, const void *rec)
     Get size of variable sized part of UniRec record Get total size of all variable-length fields in an UniRec record. More...
     
    void * ur_create_record (const ur_template_t *tmplt, uint16_t max_var_size)
     
    void ur_free_record (void *record)
     
    char * ur_get_var_as_str (const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
     Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec record and append '\0' character. The function allocates new memory space for the string, it must be freed using free()! More...
     
    void ur_copy_fields (const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
     Copy data from one UniRec record to another. Copies all fields present in both templates from src to dst. The function compares src_tmplt and dst_tmplt and for each field present in both templates it sets the value of field in dst to a corresponding value in src. "dst" must point to a memory of enough size. More...
     
    void * ur_clone_record (const ur_template_t *tmplt, const void *src)
     Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it with the data given by parameter. More...
     
    ur_iter_t ur_iter_fields (const ur_template_t *tmplt, ur_iter_t id)
     Iterate over fields of a template in order of a record This function can be used to iterate over all fields of a given template. It returns ID of the next field present in the template after a given ID. If ID is set to UR_ITER_BEGIN, it returns the first fields. If no more fields are present, UR_ITER_END is returned. Example usage: ur_field_id_t id = UR_ITER_BEGIN while ((id = ur_iter_fields(&tmplt, id)) != UR_ITER_END) { ... } The order of fields is given by the order in which they are defined. More...
     
    ur_iter_t ur_iter_fields_record_order (const ur_template_t *tmplt, int index)
     Iterate over fields of a template This function can be used to iterate over all fields of a given template. It returns n-th ID of a record specified by index. If the return value is UR_ITER_END. The index is higher than count of fields in the template. Example usage: int i = 0; while ((id = ur_iter_fields(&tmplt, i++)) != UR_ITER_END) { ... } The order of fields is given by the order in the record. More...
     
    int ur_set_array_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
     Set value of a UniRec array field. More...
     
    int ur_set_from_string (const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
     Set value of a UniRec field. More...
     
    char * ur_ifc_data_fmt_to_field_names (const char *ifc_data_fmt)
     Parses field names from data format Function parses field names from data format and returns pointer to new allocated string. Example: "type1 name1,type2 name2" => "name1,name2" New string has to be freed by user. More...
     
    char * ur_cpy_string (const char *str)
     Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user. More...
     
    const char * ur_values_get_name_start_end (uint32_t start, uint32_t end, int32_t value)
     Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
     
    const char * ur_values_get_description_start_end (uint32_t start, uint32_t end, int32_t value)
     Returns description of specified value (Helper function) Helper function for ur_values_get_description. This function returns description of specified value and field, which is defined in values file. Function needs start and end index of a field. More...
     
    + + + + + + + + + + + + + + + + +

    +Variables

    const int ur_field_type_size []
     Sizes of UniRec data types. More...
     
    const char * ur_field_type_str []
     UniRec data types. More...
     
    int ur_field_array_elem_type []
     UniRec array element types. More...
     
    ur_field_specs_t ur_field_specs
     Structure that lists UniRec field specifications such as names, types, id. More...
     
    ur_static_field_specs_t UR_FIELD_SPECS_STATIC
     Structure that lists staticaly defined UniRec field specifications such as names, types, id (using UR_FIELDS()). More...
     
    +

    Detailed Description

    +

    Definition of UniRec structures and functions.

    +
    Author
    Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
    +
    +Zdenek Rosa rosaz.nosp@m.den@.nosp@m.fit.c.nosp@m.vut..nosp@m.cz
    +
    Date
    2015
    + +

    Definition in file unirec.h.

    +

    Data Structure Documentation

    + +

    ◆ ur_field_id_linked_list_s

    + +
    +
    + + + + +
    struct ur_field_id_linked_list_s
    +
    +

    Linked list for undefined field ids Linked list consisting of field ids, which are freed after operation undefine.

    + +

    Definition at line 143 of file unirec.h.

    +
    + + + + + + + +
    Data Fields
    +ur_field_id_t +id +free id
    +ur_field_id_linked_list_t * +next +Pointer to next item in the linked list.
    + +
    +
    + +

    ◆ ur_static_field_specs_t

    + +
    +
    + + + + +
    struct ur_static_field_specs_t
    +
    +

    UniRec default field list It contains all fields which are specified statically in source code of a module. This structure is passed to ur_init()

    + +

    Definition at line 152 of file unirec.h.

    +
    + + + + + + + + + + + + + +
    Data Fields
    +char ** +ur_field_names +Array of names of fields.
    +short * +ur_field_sizes +Array of sizes of fields.
    +ur_field_type_t * +ur_field_types +Array of types of fields.
    +ur_field_id_t +ur_last_id +Last specified ID.
    + +
    +
    + +

    ◆ ur_field_specs_t

    + +
    +
    + + + + +
    struct ur_field_specs_t
    +
    +

    UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields.

    + +

    Definition at line 164 of file unirec.h.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Data Fields
    +uint8_t +intialized +If the UniRec is initialized by function ur_init variable is set to UR_INITIALIZED, otherwise 0.
    +ur_field_id_t +ur_allocated_fields +

    Count of fields which is allocated (ur_allocated_fields - ur_last_id = remaining fields count)

    +
    +char ** +ur_field_names +Array of names of fields.
    +short * +ur_field_sizes +Array of sizes of fields.
    +ur_field_type_t * +ur_field_types +Array of types of fields.
    +ur_field_id_t +ur_last_id +The highest ID of a field + 1.
    +ur_field_id_t +ur_last_statically_defined_id +Last statically defined field by UR_FIELDS(...)
    +ur_field_id_linked_list_t * +ur_undefine_fields +linked list of free (undefined) IDs
    + +
    +
    + +

    ◆ field_spec_t

    + +
    +
    + + + + +
    struct field_spec_t
    +
    +

    Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm.

    + +

    Definition at line 182 of file unirec.h.

    +
    + + + + + + + + + + +
    Data Fields
    +ur_field_id_t +id +ID of a field.
    +char * +name +Name of a field.
    +int +size +Size of a field.
    + +
    +
    + +

    ◆ ur_template_t

    + +
    +
    + + + + +
    struct ur_template_t
    +
    +

    UniRec template. It contains a table mapping a field to its position in an UniRec record.

    + +

    Definition at line 191 of file unirec.h.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Data Fields
    +uint16_t +count +Count of fields in template.
    +ur_tmplt_direction +direction +Direction of data input, output, bidirection, no direction.
    +uint16_t +first_dynamic +First dynamic (variable-length) field. Index to the ids array.
    +int16_t * +ids +Array of ids in template.
    +uint32_t +ifc_out +output interface number (stored only if the direction == UR_TMPLT_DIRECTION_BI)
    +uint16_t * +offset +Table of offsets.
    +uint16_t +offset_size +size of offset table.
    +uint16_t +static_size +Size of static part.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ __STDC_LIMIT_MACROS

    + +
    +
    + + + + +
    #define __STDC_LIMIT_MACROS
    +
    + +

    Definition at line 54 of file unirec.h.

    + +
    +
    + +

    ◆ UR_ARRAY_ALLOC

    + +
    +
    + + + + +
    #define UR_ARRAY_ALLOC   10
    +
    + +

    Default alloc size increment for ur_set_array_from_string.

    + +

    Definition at line 73 of file unirec.h.

    + +
    +
    + +

    ◆ UR_ARRAY_DELIMITER

    + +
    +
    + + + + +
    #define UR_ARRAY_DELIMITER   ' '
    +
    + +

    Delimiter of array elements in string.

    + +

    Definition at line 72 of file unirec.h.

    + +
    +
    + +

    ◆ UR_COUNT_OF_TYPES

    + +
    +
    + + + + +
    #define UR_COUNT_OF_TYPES   29
    +
    + +

    Constants for all possible types of UniRec fields.

    +

    Count of types of UniRec fields

    + +

    Definition at line 94 of file unirec.h.

    + +
    +
    + +

    ◆ UR_DEFAULT_LENGTH_OF_FIELD_NAME

    + +
    +
    + + + + +
    #define UR_DEFAULT_LENGTH_OF_FIELD_NAME   128
    +
    + +

    Definition at line 67 of file unirec.h.

    + +
    +
    + +

    ◆ UR_DEFAULT_LENGTH_OF_FIELD_TYPE

    + +
    +
    + + + + +
    #define UR_DEFAULT_LENGTH_OF_FIELD_TYPE   16
    +
    + +

    Definition at line 68 of file unirec.h.

    + +
    +
    + +

    ◆ UR_DEFAULT_LENGTH_OF_TEMPLATE

    + +
    +
    + + + + +
    #define UR_DEFAULT_LENGTH_OF_TEMPLATE   1024
    +
    + +

    Definition at line 66 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_INVALID_FIELD_ID

    + +
    +
    + + + + +
    #define UR_E_INVALID_FIELD_ID   -5
    +
    + +

    The field ID is not present in a template.

    + +

    Definition at line 85 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_INVALID_NAME

    + +
    +
    + + + + +
    #define UR_E_INVALID_NAME   -3
    +
    + +

    The given name is not present in a template.

    + +

    Definition at line 87 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_INVALID_PARAMETER

    + +
    +
    + + + + +
    #define UR_E_INVALID_PARAMETER   -6
    +
    + +

    The given parameter is wrong.

    + +

    Definition at line 84 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_INVALID_TYPE

    + +
    +
    + + + + +
    #define UR_E_INVALID_TYPE   -2
    +
    + +

    The type of a field is not defined.

    + +

    Definition at line 88 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_MEMORY

    + +
    +
    + + + + +
    #define UR_E_MEMORY   -1
    +
    + +

    Problem during allocating memory.

    + +

    Definition at line 89 of file unirec.h.

    + +
    +
    + +

    ◆ UR_E_TYPE_MISMATCH

    + +
    +
    + + + + +
    #define UR_E_TYPE_MISMATCH   -4
    +
    + +

    The type of a field is different.

    + +

    Definition at line 86 of file unirec.h.

    + +
    +
    + +

    ◆ UR_FIELD_ID_MAX

    + +
    +
    + + + + +
    #define UR_FIELD_ID_MAX   INT16_MAX
    +
    + +

    Max ID of a field.

    + +

    Definition at line 70 of file unirec.h.

    + +
    +
    + +

    ◆ UR_FIELDS

    + +
    +
    + + + + + + + + +
    #define UR_FIELDS( ...)
    +
    + +

    Definition of UniRec fields.

    + +

    Definition at line 71 of file unirec.h.

    + +
    +
    + +

    ◆ UR_INITIAL_SIZE_FIELDS_TABLE

    + +
    +
    + + + + +
    #define UR_INITIAL_SIZE_FIELDS_TABLE   5
    +
    + +

    Initial size of free space in fields tables.

    + +

    Definition at line 69 of file unirec.h.

    + +
    +
    + +

    ◆ UR_INITIALIZED

    + +
    +
    + + + + +
    #define UR_INITIALIZED   1
    +
    + +

    Indicator if the UniRec has been initialized by calling function ur_init.

    + +

    Definition at line 81 of file unirec.h.

    + +
    +
    + +

    ◆ UR_INVALID_FIELD

    + +
    +
    + + + + +
    #define UR_INVALID_FIELD   ((ur_field_id_t) 0xffff)
    +
    + +

    ID of invalid field.

    + +

    Definition at line 82 of file unirec.h.

    + +
    +
    + +

    ◆ UR_INVALID_OFFSET

    + +
    +
    + + + + +
    #define UR_INVALID_OFFSET   0xffff
    +
    + +

    Default value of all offsets (value is not in the record)

    + +

    Definition at line 78 of file unirec.h.

    + +
    +
    + +

    ◆ UR_ITER_BEGIN

    + +
    +
    + + + + +
    #define UR_ITER_BEGIN   (-1)
    +
    + +

    First value in iterating through the fields.

    + +

    Definition at line 75 of file unirec.h.

    + +
    +
    + +

    ◆ UR_ITER_END

    + +
    +
    + + + + +
    #define UR_ITER_END   INT16_MAX
    +
    + +

    Last value in iterating through the fields.

    + +

    Definition at line 76 of file unirec.h.

    + +
    +
    + +

    ◆ UR_NO_DYNAMIC_VALUES

    + +
    +
    + + + + +
    #define UR_NO_DYNAMIC_VALUES   0xffff
    +
    + +

    Value of variable "first_dynamic" if no dynamic values are present.

    + +

    Definition at line 79 of file unirec.h.

    + +
    +
    + +

    ◆ UR_OK

    + +
    +
    + + + + +
    #define UR_OK   0
    +
    + +

    No problem.

    + +

    Definition at line 90 of file unirec.h.

    + +
    +
    + +

    ◆ UR_UNINITIALIZED

    + +
    +
    + + + + +
    #define UR_UNINITIALIZED   0
    +
    + +

    Indicator if the UniRec has not been initialized by calling function ur_init.

    + +

    Definition at line 80 of file unirec.h.

    + +
    +
    +

    Typedef Documentation

    + +

    ◆ ur_field_id_t

    + +
    +
    + + + + +
    typedef int16_t ur_field_id_t
    +
    + +

    Type of UniRec field identifiers.

    + +

    Definition at line 136 of file unirec.h.

    + +
    +
    + +

    ◆ ur_iter_t

    + +
    +
    + + + + +
    typedef ur_field_id_t ur_iter_t
    +
    + +

    Type for identifying iteration id through all fields.

    + +

    Definition at line 137 of file unirec.h.

    + +
    +
    +

    Enumeration Type Documentation

    + +

    ◆ ur_field_type_t

    + +
    +
    + + + + +
    enum ur_field_type_t
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Enumerator
    UR_TYPE_STRING 

    var-len fields (string where only printable characters are expected; '\0' at the end should NOT be included)

    +
    UR_TYPE_BYTES 

    var-len fields (generic string of bytes)

    +
    UR_TYPE_CHAR 

    char

    +
    UR_TYPE_UINT8 

    unsigned int (8b)

    +
    UR_TYPE_INT8 

    int (8b)

    +
    UR_TYPE_UINT16 

    unsigned int (16b)

    +
    UR_TYPE_INT16 

    int (8b)

    +
    UR_TYPE_UINT32 

    unsigned int (32b)

    +
    UR_TYPE_INT32 

    int (32b)

    +
    UR_TYPE_UINT64 

    unsigned int (64b)

    +
    UR_TYPE_INT64 

    int (64b)

    +
    UR_TYPE_FLOAT 

    float (32b)

    +
    UR_TYPE_DOUBLE 

    double (64b)

    +
    UR_TYPE_IP 

    IP address (128b)

    +
    UR_TYPE_MAC 

    MAC address (48b)

    +
    UR_TYPE_TIME 

    time (64b)

    +
    UR_TYPE_A_UINT8 

    unsigned int (8b) array

    +
    UR_TYPE_A_INT8 

    int (8b) array

    +
    UR_TYPE_A_UINT16 

    unsigned int (16b) array

    +
    UR_TYPE_A_INT16 

    int (8b) array

    +
    UR_TYPE_A_UINT32 

    unsigned int (32b) array

    +
    UR_TYPE_A_INT32 

    int (32b) array

    +
    UR_TYPE_A_UINT64 

    unsigned int (64b) array

    +
    UR_TYPE_A_INT64 

    int (64b) array

    +
    UR_TYPE_A_FLOAT 

    float (32b) array

    +
    UR_TYPE_A_DOUBLE 

    double (64b) array

    +
    UR_TYPE_A_IP 

    IP address (128b) array.

    +
    UR_TYPE_A_MAC 

    MAC address (48b) array.

    +
    UR_TYPE_A_TIME 

    time (64b) array

    +
    + +

    Definition at line 95 of file unirec.h.

    + +
    +
    + +

    ◆ ur_tmplt_direction

    + +
    +
    + + + + +
    enum ur_tmplt_direction
    +
    + + + + + +
    Enumerator
    UR_TMPLT_DIRECTION_NO 

    template is not used for sending data

    +
    UR_TMPLT_DIRECTION_IN 

    input direction

    +
    UR_TMPLT_DIRECTION_OUT 

    ouput direction

    +
    UR_TMPLT_DIRECTION_BI 

    bidirection

    +
    + +

    Definition at line 129 of file unirec.h.

    + +
    +
    +
    + + + + diff --git a/doc/unirec/unirec_8h_source.html b/doc/unirec/unirec_8h_source.html new file mode 100644 index 00000000..43ea3fc7 --- /dev/null +++ b/doc/unirec/unirec_8h_source.html @@ -0,0 +1,196 @@ + + + + + + + +UniRec: unirec.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    unirec.h
    +
    +
    +Go to the documentation of this file.
    1 
    8 /*
    9  * Copyright (C) 2015 CESNET
    10 
    11  *
    12  * LICENSE TERMS
    13  *
    14  * Redistribution and use in source and binary forms, with or without
    15  * modification, are permitted provided that the following conditions
    16  * are met:
    17  * 1. Redistributions of source code must retain the above copyright
    18  * notice, this list of conditions and the following disclaimer.
    19  * 2. Redistributions in binary form must reproduce the above copyright
    20  * notice, this list of conditions and the following disclaimer in
    21  * the documentation and/or other materials provided with the
    22  * distribution.
    23  * 3. Neither the name of the Company nor the names of its contributors
    24  * may be used to endorse or promote products derived from this
    25  * software without specific prior written permission.
    26  *
    27  * ALTERNATIVELY, provided that this notice is retained in full, this
    28  * product may be distributed under the terms of the GNU General Public
    29  * License (GPL) version 2 or later, in which case the provisions
    30  * of the GPL apply INSTEAD OF those given above.
    31  *
    32  * This software is provided ``as is'', and any express or implied
    33  * warranties, including, but not limited to, the implied warranties of
    34  * merchantability and fitness for a particular purpose are disclaimed.
    35  * In no event shall the company or contributors be liable for any
    36  * direct, indirect, incidental, special, exemplary, or consequential
    37  * damages (including, but not limited to, procurement of substitute
    38  * goods or services; loss of use, data, or profits; or business
    39  * interruption) however caused and on any theory of liability, whether
    40  * in contract, strict liability, or tort (including negligence or
    41  * otherwise) arising in any way out of the use of this software, even
    42  * if advised of the possibility of such damage.
    43  *
    44  */
    45 
    46 #ifndef _UNIREC2_H_
    47 #define _UNIREC2_H_
    48 
    49 #ifdef __cplusplus
    50 extern "C" {
    51 #endif
    52 
    53 #ifndef __STDC_LIMIT_MACROS
    54 #define __STDC_LIMIT_MACROS
    55 #endif
    56 #include <stdint.h>
    57 
    58 #include "ipaddr.h"
    59 #include "macaddr.h"
    60 #include "ur_time.h"
    61 #include "links.h"
    62 #include "ur_values.h"
    63 #include <libtrap/trap.h>
    64 
    65 //General setting
    66 #define UR_DEFAULT_LENGTH_OF_TEMPLATE 1024
    67 #define UR_DEFAULT_LENGTH_OF_FIELD_NAME 128
    68 #define UR_DEFAULT_LENGTH_OF_FIELD_TYPE 16
    69 #define UR_INITIAL_SIZE_FIELDS_TABLE 5
    70 #define UR_FIELD_ID_MAX INT16_MAX
    71 #define UR_FIELDS(...)
    72 #define UR_ARRAY_DELIMITER ' '
    73 #define UR_ARRAY_ALLOC 10
    74 //Iteration constants
    75 #define UR_ITER_BEGIN (-1)
    76 #define UR_ITER_END INT16_MAX
    77 //default values
    78 #define UR_INVALID_OFFSET 0xffff
    79 #define UR_NO_DYNAMIC_VALUES 0xffff
    80 #define UR_UNINITIALIZED 0
    81 #define UR_INITIALIZED 1
    82 #define UR_INVALID_FIELD ((ur_field_id_t) 0xffff)
    83 //return codes
    84 #define UR_E_INVALID_PARAMETER -6
    85 #define UR_E_INVALID_FIELD_ID -5
    86 #define UR_E_TYPE_MISMATCH -4
    87 #define UR_E_INVALID_NAME -3
    88 #define UR_E_INVALID_TYPE -2
    89 #define UR_E_MEMORY -1
    90 #define UR_OK 0
    91 
    92 
    94 #define UR_COUNT_OF_TYPES 29
    95 typedef enum {
    112 
    113  // Arrays
    128 
    129 typedef enum {
    135 
    136 typedef int16_t ur_field_id_t;
    138 
    142 typedef struct ur_field_id_linked_list_s ur_field_id_linked_list_t;
    145  ur_field_id_linked_list_t *next;
    146 };
    147 
    152 typedef struct {
    153  char **ur_field_names;
    154  short *ur_field_sizes;
    158 
    164 typedef struct {
    165  char **ur_field_names;
    166  short *ur_field_sizes;
    170 
    174  ur_field_id_linked_list_t * ur_undefine_fields;
    175  uint8_t intialized;
    177 
    182 typedef struct field_spec_s {
    183  char *name;
    184  int size;
    186 } field_spec_t;
    187 
    191 typedef struct {
    192  uint16_t *offset;
    193  uint16_t offset_size;
    194  int16_t *ids;
    195  uint16_t first_dynamic;
    196  uint16_t count;
    197  uint16_t static_size;
    199  uint32_t ifc_out;
    200 } ur_template_t;
    201 
    219 #define TRAP_RECEIVE(ifc_num, data, data_size, tmplt) \
    220  TRAP_CTX_RECEIVE(trap_get_global_ctx(), ifc_num, data, data_size, tmplt);
    221 
    233 #define TRAP_CTX_RECEIVE(ctx, ifc_num, data, data_size, tmplt) __extension__ \
    234 ({\
    235  int ret = trap_ctx_recv(ctx, ifc_num, &data, &data_size);\
    236  if (ret == TRAP_E_FORMAT_CHANGED) {\
    237  const char *spec = NULL;\
    238  uint8_t data_fmt;\
    239  if (trap_ctx_get_data_fmt(ctx, TRAPIFC_INPUT, ifc_num, &data_fmt, &spec) != TRAP_E_OK) {\
    240  fprintf(stderr, "Data format was not loaded.\n");\
    241  } else {\
    242  tmplt = ur_define_fields_and_update_template(spec, tmplt);\
    243  if (tmplt == NULL) {\
    244  fprintf(stderr, "Template could not be edited.\n");\
    245  } else {\
    246  if (tmplt->direction == UR_TMPLT_DIRECTION_BI) {\
    247  char * spec_cpy = ur_cpy_string(spec);\
    248  if (spec_cpy == NULL) {\
    249  fprintf(stderr, "Memory allocation problem.\n");\
    250  } else {\
    251  trap_ctx_set_data_fmt(ctx, tmplt->ifc_out, TRAP_FMT_UNIREC, spec_cpy);\
    252  }\
    253  }\
    254  }\
    255  }\
    256  }\
    257  ret;\
    258 })
    259 
    271 /*#define UNIREC_CTX_CHECK_TEMPLATE (ctx, ret, ifc_num, tmplt, fmt_changed_cmd, fmt_not_compatabile_cmd) __extension__ \
    272 ({\
    273  if (ret == TRAP_E_OK_FORMAT_CHANGED && trap_ctx_get_in_ifc_state(ctx, ifc_num) == FMT_SUBSET) {\
    274  const char *spec = NULL;\
    275  uint8_t data_fmt;\
    276  if (trap_ctx_get_data_fmt(ctx, TRAPIFC_INPUT, ifc_num, &data_fmt, &spec) != TRAP_E_OK) {\
    277  fprintf(stderr, "Data format was not loaded.");\
    278  } else {\
    279  tmplt = ur_define_fields_and_update_template(spec, tmplt);\
    280  if (tmplt == NULL) {\
    281  fprintf(stderr, "Template could not be edited");\
    282  } else {\
    283  if (tmplt->direction == UR_TMPLT_DIRECTION_BI) {\
    284  char * spec_cpy = ur_cpy_string(spec);\
    285  if (spec_cpy == NULL) {\
    286  fprintf(stderr, "Memory allocation problem.");\
    287  } else {\
    288  trap_ctx_set_data_fmt(ctx, tmplt->ifc_out, TRAP_FMT_UNIREC, spec_cpy);\
    289  }\
    290  }\
    291  trap_ctx_confirm_ifc_state(ctx, ifc_num);\
    292  fmt_changed_cmd;
    293  }\
    294  }\
    295  }\
    296  ret;\
    297 })*/
    298 /* libtraphelpers */
    302 
    314 extern const int ur_field_type_size[];
    315 
    321 extern const char *ur_field_type_str[];
    322 
    328 extern int ur_field_array_elem_type[];
    329 
    334 
    339 
    354 char *ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter);
    355 
    364 #define ur_template_string(tmplt) \
    365  ur_template_string_delimiter(tmplt, ',')
    366 
    372 #define ur_size_of(type) \
    373  ur_field_type_size[type]
    374 
    380 #define ur_get_name(field_id) \
    381  ur_field_specs.ur_field_names[field_id]
    382 
    388 #define ur_get_type(field_id) \
    389  ur_field_specs.ur_field_types[field_id]
    390 
    397 int ur_get_field_type_from_str(const char *type);
    398 
    405 #define ur_get_size(field_id) \
    406  ur_field_specs.ur_field_sizes[field_id]
    407 
    418 #define ur_get(tmplt, data, field_id) \
    419  (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]))
    420 
    430 #define ur_get_ptr(tmplt, data, field_id) \
    431  (field_id ## _T*)((char *) (ur_is_static(field_id) ? ((char *)(data) + (tmplt)->offset[field_id]) : \
    432  (char *)(data) + (tmplt)->static_size + (*((uint16_t *)((char *)(data) + (tmplt)->offset[field_id])))))
    433 
    442 #define ur_get_ptr_by_id(tmplt, data, field_id) \
    443  (void *)((char *) (ur_is_static(field_id) ? ((char *)(data) + (tmplt)->offset[field_id]) : \
    444  (char *)(data) + (tmplt)->static_size + (*((uint16_t *)((char *)(data) + (tmplt)->offset[field_id])))))
    445 
    454 #define ur_set(tmplt, data, field_id, value) \
    455  (*(field_id ## _T*)((char *)(data) + (tmplt)->offset[field_id]) = (value))
    456 
    464 #define ur_get_var_offset(tmplt, rec, field_id) \
    465  *((uint16_t *)((char *) rec + tmplt->offset[field_id]))
    466 
    474 #define ur_get_var_len(tmplt, rec, field_id) \
    475  *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2))
    476 
    485 #define ur_set_var_len(tmplt, rec, field_id, len) \
    486  *((uint16_t *)((char *) rec + tmplt->offset[field_id] + 2)) = (uint16_t) len
    487 
    496 #define ur_set_var_offset(tmplt, rec, field_id, offset_val) \
    497  *((uint16_t *)((char *) rec + tmplt->offset[field_id])) = (uint16_t) offset_val
    498 
    506 #define ur_get_len(tmplt, rec, field) \
    507  ur_is_static(field) ? ur_get_size(field) : ur_get_var_len(tmplt, rec, field)
    508 
    517 #define ur_set_string(tmplt, rec, field_id, str) \
    518  ur_set_var(tmplt, rec, field_id, str, strlen(str))
    519 
    526 #define ur_is_array(field_id) \
    527  (ur_field_type_size[ur_get_type(field_id)] < 0 ? 1 : 0)
    528 
    535 #define ur_array_get_elem_size(field_id) \
    536  (ur_field_type_size[ur_get_type(field_id)] < 0 ? -ur_field_type_size[ur_get_type(field_id)] : ur_field_type_size[ur_get_type(field_id)])
    537 
    546 #define ur_array_get_elem_cnt(tmplt, rec, field_id) \
    547  (ur_get_var_len(tmplt, rec, field_id) / ur_array_get_elem_size(field_id))
    548 
    555 #define ur_array_get_elem_type(field_id) \
    556  ur_field_array_elem_type[ur_get_type(field_id)]
    557 
    568 #define ur_array_set(tmplt, rec, field_id, index, element) \
    569  if ((index) * ur_array_get_elem_size(field_id) < ur_get_var_len(tmplt, rec, field_id) || ur_array_resize(tmplt, rec, field_id, (index + 1) * ur_array_get_elem_size(field_id)) == UR_OK) { \
    570  (((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index] = (element)); \
    571  }
    572 
    581 #define ur_array_append(tmplt, rec, field_id, element) \
    582  if (ur_array_resize(tmplt, rec, field_id, (ur_array_get_elem_cnt(tmplt, rec, field_id) + 1) * ur_array_get_elem_size(field_id)) == UR_OK) { \
    583  (((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[ur_array_get_elem_cnt(tmplt, rec, field_id) - 1] = (element)); \
    584  }
    585 
    594 char *ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id);
    595 
    604 #define ur_array_clear(tmplt, rec, field_id) \
    605  ur_array_resize(tmplt, rec, field_id, 0)
    606 
    617 #define ur_array_get(tmplt, rec, field_id, index) \
    618  ((field_id ## _T)((char *)(ur_get_ptr_by_id(tmplt, rec, field_id))))[index]
    619 
    629 #define ur_array_allocate(tmplt, rec, field_id, elem_cnt) \
    630  ur_array_resize(tmplt, rec, field_id, (elem_cnt) * ur_array_get_elem_size(field_id))
    631 
    638 #define ur_is_present(tmplt, field_id) \
    639  ((tmplt)->offset_size > (field_id) && (tmplt)->offset[(field_id)] != UR_INVALID_OFFSET)
    640 
    646 #define ur_is_varlen(field_id) \
    647  (ur_field_specs.ur_field_sizes[field_id] < 0)
    648 
    650 #define ur_is_dynamic(field_id) \
    651  ur_is_varlen(field_id)
    652 
    658 #define ur_is_fixlen(field_id) \
    659  (ur_field_specs.ur_field_sizes[field_id] >= 0)
    660 
    662 #define ur_is_static(field_id) \
    663  ur_is_fixlen(field_id)
    664 
    665 
    671 #define ur_rec_fixlen_size(tmplt) \
    672  ((tmplt)->static_size)
    673 
    680 #define ur_rec_size(tmplt, rec) \
    681  (ur_rec_fixlen_size(tmplt) + ur_rec_varlen_size(tmplt, rec))
    682 
    688 int ur_init(ur_static_field_specs_t field_specs_static);
    689 
    695 int ur_get_empty_id();
    696 
    707 int ur_define_field(const char *name, ur_field_type_t type);
    708 
    721 int ur_define_set_of_fields(const char *ifc_data_fmt);
    722 
    732 
    741 int ur_undefine_field(const char *name);
    742 
    750 void ur_finalize();
    751 
    757 int ur_get_id_by_name(const char *name);
    758 
    766 int compare_fields(const void *field1, const void *field2);
    767 
    781 ur_template_t *ur_create_template(const char *fields, char **errstr);
    782 
    793 #define ur_create_input_template(ifc, fields, errstr) \
    794  ur_ctx_create_input_template(trap_get_global_ctx(), ifc, fields, errstr);
    795 
    806 #define ur_create_output_template(ifc, fields, errstr) \
    807  ur_ctx_create_output_template(trap_get_global_ctx(), ifc, fields, errstr);
    808 
    819 ur_template_t *ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr);
    820 
    831 ur_template_t *ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr);
    832 
    833 
    840 int ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt);
    841 
    847 #define ur_set_output_template(ifc, tmplt) \
    848  ur_ctx_set_output_template(trap_get_global_ctx(), ifc, tmplt)
    849 
    856 int ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt);
    857 
    863 #define ur_set_input_template(ifc, tmplt) \
    864  ur_ctx_set_input_template(trap_get_global_ctx(), ifc, tmplt)
    865 
    877 ur_template_t *ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr);
    878 
    890 #define ur_create_bidirectional_template(ifc_in, ifc_out, fields, errstr) \
    891  ur_ctx_create_bidirectional_template(trap_get_global_ctx(), ifc_in, ifc_out, fields, errstr);
    892 
    904 ur_template_t *ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt);
    905 
    918 ur_template_t *ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt);
    919 
    929 ur_template_t *ur_create_template_from_ifc_spec(const char *ifc_data_fmt);
    930 
    936 void ur_free_template(ur_template_t *tmplt);
    937 
    947 int ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB);
    948 
    949 
    955 void ur_print_template(ur_template_t *tmplt);
    956 
    968 int ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len);
    969 
    977 int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len);
    978 
    986 void ur_clear_varlen(const ur_template_t *tmplt, void *rec);
    987 
    994 uint16_t ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec);
    995 
    1012 void *ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size);
    1013 #define UR_MAX_SIZE 0xffff
    1014 
    1020 void ur_free_record(void *record);
    1021 
    1032 char *ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id);
    1033 
    1045 void ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src);
    1046 
    1056 #define ur_cpy(tmplt, src, dst) \
    1057  (memcpy(dst,src,ur_rec_size(tmplt,src)))
    1058 /*inline void ur_cpy(ur_template_t *tmplt, const void *src, void *dst)
    1059 {
    1060  memcpy(dst, src, ur_rec_size(tmplt, src));
    1061 }*/
    1062 
    1071 void *ur_clone_record(const ur_template_t *tmplt, const void *src);
    1072 
    1090 
    1107 ur_iter_t ur_iter_fields_record_order(const ur_template_t *tmplt, int index);
    1108 
    1117 int ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v);
    1118 
    1127 int ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v);
    1128 
    1137 char *ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt);
    1138 
    1145 char *ur_cpy_string(const char *str);
    1146 
    1156 const char *ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value);
    1157 
    1167 const char *ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value);
    1168 
    1176 #define ur_values_get_name(field, value) \
    1177  ur_values_get_name_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
    1178 
    1186 #define ur_values_get_description(field, value) \
    1187  ur_values_get_description_start_end(UR_TYPE_START_ ## field, UR_TYPE_END_ ## field, value)
    1188 /* urtemplate */
    1192 
    1193 #ifdef __cplusplus
    1194 } // extern "C"
    1195 #endif
    1196 
    1197 #endif
    var-len fields (string where only printable characters are expected; &#39;\0&#39; at the end should NOT be in...
    Definition: unirec.h:96
    +
    int (8b)
    Definition: unirec.h:102
    +
    float (32b)
    Definition: unirec.h:107
    +
    ur_iter_t ur_iter_fields(const ur_template_t *tmplt, ur_iter_t id)
    Iterate over fields of a template in order of a record This function can be used to iterate over all ...
    Definition: unirec.c:1286
    +
    int ur_set_array_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    Set value of a UniRec array field.
    Definition: unirec.c:1315
    +
    int (8b) array
    Definition: unirec.h:115
    +
    ur_tmplt_direction direction
    Direction of data input, output, bidirection, no direction.
    Definition: unirec.h:198
    +
    Sorting fields structure This structure is used to sort fields by their size and name. The structure is passed to the sorting algorithm.
    Definition: unirec.h:182
    +
    int ur_define_set_of_fields(const char *ifc_data_fmt)
    Define set of new UniRec fields Define new UniRec fields at run-time. It adds new fields into existin...
    Definition: unirec.c:558
    +
    void * ur_clone_record(const ur_template_t *tmplt, const void *src)
    Create new UniRec and copy the source UniRec into it. Function creates new UniRec record and fills it...
    Definition: unirec.c:1243
    +
    input direction
    Definition: unirec.h:131
    +
    ur_field_id_t ur_allocated_fields
    Definition: unirec.h:173
    +
    MAC address (48b) array.
    Definition: unirec.h:125
    +
    int (64b)
    Definition: unirec.h:106
    +
    ur_field_id_t id
    ID of a field.
    Definition: unirec.h:185
    +
    int ur_get_empty_id()
    Return first empty id for new UniRec field Return first empty id for new UniRec field. If there is no space in the UniRec structures, it will increase space in the existing structures.
    Definition: unirec.c:288
    +
    ur_template_t * ur_create_template(const char *fields, char **errstr)
    Create UniRec template Create new UniRec template specified by a string containing names of its field...
    Definition: unirec.c:900
    +
    unsigned int (16b)
    Definition: unirec.h:101
    +
    Structure to store both IPv4 and IPv6 addresses and associated functions.
    +
    void ur_clear_varlen(const ur_template_t *tmplt, void *rec)
    Clear variable-length part of a record. For better performance of setting content to variable-length ...
    Definition: unirec.c:1195
    +
    int ur_define_field(const char *name, ur_field_type_t type)
    Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structur...
    Definition: unirec.c:636
    +
    const char * ur_values_get_description_start_end(uint32_t start, uint32_t end, int32_t value)
    Returns description of specified value (Helper function) Helper function for ur_values_get_descriptio...
    Definition: unirec.c:1676
    +
    ur_static_field_specs_t UR_FIELD_SPECS_STATIC
    Structure that lists staticaly defined UniRec field specifications such as names, types...
    Definition: unirec.c:202
    +
    Linked list for undefined field ids Linked list consisting of field ids, which are freed after operat...
    Definition: unirec.h:143
    +
    short * ur_field_sizes
    Array of sizes of fields.
    Definition: unirec.h:166
    +
    int ur_ctx_set_output_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    Set UniRec template to ouput interface on specified context.
    Definition: unirec.c:836
    +
    char * ur_cpy_string(const char *str)
    Duplicates given string. Helper function which returns pointer to duplicated string. New string has to be freed by user.
    Definition: unirec.c:1655
    +
    short * ur_field_sizes
    Array of sizes of fields.
    Definition: unirec.h:154
    +
    int ur_set_from_string(const ur_template_t *tmpl, void *data, ur_field_id_t f_id, const char *v)
    Set value of a UniRec field.
    Definition: unirec.c:1487
    +
    ur_template_t * ur_ctx_create_output_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    Create UniRec template and set it to output interface on specified context Creates UniRec template...
    Definition: unirec.c:817
    +
    bidirection
    Definition: unirec.h:133
    +
    int ur_field_array_elem_type[]
    UniRec array element types.
    Definition: unirec.c:168
    +
    MAC address (48b)
    Definition: unirec.h:110
    +
    IP address (128b) array.
    Definition: unirec.h:124
    +
    char ** ur_field_names
    Array of names of fields.
    Definition: unirec.h:165
    +
    char ** ur_field_names
    Array of names of fields.
    Definition: unirec.h:153
    +
    char * name
    Name of a field.
    Definition: unirec.h:183
    +
    Structure to store MAC address and associated functions.
    +
    UniRec default field list It contains all fields which are specified statically in source code of a m...
    Definition: unirec.h:152
    +
    unsigned int (64b) array
    Definition: unirec.h:120
    +
    int (32b)
    Definition: unirec.h:104
    +
    const int ur_field_type_size[]
    Sizes of UniRec data types.
    Definition: unirec.c:94
    +
    int ur_get_field_type_from_str(const char *type)
    Definition: unirec.c:355
    +
    char * ur_array_append_get_ptr(const ur_template_t *tmplt, void *rec, int field_id)
    Allocate new element at the end of array and return its pointer.
    Definition: unirec.c:1184
    +
    ur_template_t * ur_expand_template(const char *ifc_data_fmt, ur_template_t *tmplt)
    Expand UniRec template Expand existing UniRec template by a string containing types and names of its ...
    Definition: unirec.c:486
    +
    ur_template_t * ur_define_fields_and_update_template(const char *ifc_data_fmt, ur_template_t *tmplt)
    Defined new fields and expand an UniRec template Define new fields (function ur_define_set_of_fields)...
    Definition: unirec.c:610
    +
    void ur_finalize()
    Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program&#39;s end. This function has to be called if some fields are defined during run-time, otherwise this function is needless.
    Definition: unirec.c:734
    +
    ur_template_t * ur_ctx_create_input_template(trap_ctx_t *ctx, int ifc, const char *fields, char **errstr)
    Create UniRec template and set it to input interface on specified context Creates UniRec template...
    Definition: unirec.c:798
    +
    int ur_set_var(const ur_template_t *tmplt, void *rec, int field_id, const void *val_ptr, int val_len)
    Set content of variable-length UniRec field Copy given data into variable-length UniRec field...
    Definition: unirec.c:1152
    +
    char * ur_get_var_as_str(const ur_template_t *tmplt, const void *rec, ur_field_id_t field_id)
    Get variable-length UniRec field as a C string Copy data of a variable-length field from UniRec recor...
    Definition: unirec.c:1229
    +
    IP address (128b)
    Definition: unirec.h:109
    +
    unsigned int (32b) array
    Definition: unirec.h:118
    + +
    unsigned int (64b)
    Definition: unirec.h:105
    +
    template is not used for sending data
    Definition: unirec.h:130
    +
    Types, macros and function for UniRec timestamp format.
    +
    void * rec
    +
    ur_field_type_t * ur_field_types
    Array of types of fields.
    Definition: unirec.h:167
    +
    ur_field_specs_t ur_field_specs
    Structure that lists UniRec field specifications such as names, types, id.
    Definition: unirec.c:201
    + +
    int ur_undefine_field_by_id(ur_field_id_t field_id)
    Undefine UniRec field by its id Undefine UniRec field created at run-time. It erases given field from...
    Definition: unirec.c:695
    +
    void * ur_create_record(const ur_template_t *tmplt, uint16_t max_var_size)
    Definition: unirec.c:1214
    +
    uint16_t count
    Count of fields in template.
    Definition: unirec.h:196
    +
    unsigned int (16b) array
    Definition: unirec.h:116
    +
    UniRec fields structure It contains all fields which are statically defined by UR_FIELDS(...) and run-time generated fields. This structure can be modified during run-time by generating new fields and erasing existing fields.
    Definition: unirec.h:164
    +
    int ur_undefine_field(const char *name)
    Undefine UniRec field by its name Undefine UniRec field created at run-time. It erases given field fr...
    Definition: unirec.c:720
    +
    ur_template_t * ur_create_template_from_ifc_spec(const char *ifc_data_fmt)
    Create UniRec template from data format string. Creates new UniRec template (function ur_create_templ...
    Definition: unirec.c:625
    +
    double (64b)
    Definition: unirec.h:108
    +
    int16_t * ids
    Array of ids in template.
    Definition: unirec.h:194
    +
    int (8b) array
    Definition: unirec.h:117
    +
    void ur_free_record(void *record)
    Definition: unirec.c:1223
    +
    int16_t ur_field_id_t
    Type of UniRec field identifiers.
    Definition: unirec.h:136
    +
    uint16_t ur_rec_varlen_size(const ur_template_t *tmplt, const void *rec)
    Get size of variable sized part of UniRec record Get total size of all variable-length fields in an U...
    Definition: unirec.c:1204
    +
    int (32b) array
    Definition: unirec.h:119
    +
    void ur_free_template(ur_template_t *tmplt)
    Destroy UniRec template Free all memory allocated for a template created previously by ur_create_temp...
    Definition: unirec.c:1088
    +
    ur_field_id_t ur_last_id
    Last specified ID.
    Definition: unirec.h:156
    +
    ur_template_t * ur_ctx_create_bidirectional_template(trap_ctx_t *ctx, int ifc_in, int ifc_out, const char *fields, char **errstr)
    Create UniRec template and set it to input and output interface on specified context Creates UniRec t...
    Definition: unirec.c:875
    +
    var-len fields (generic string of bytes)
    Definition: unirec.h:97
    +
    uint16_t static_size
    Size of static part.
    Definition: unirec.h:197
    +
    uint32_t ifc_out
    output interface number (stored only if the direction == UR_TMPLT_DIRECTION_BI)
    Definition: unirec.h:199
    +
    int ur_array_resize(const ur_template_t *tmplt, void *rec, int field_id, int len)
    Change length of a array field.
    Definition: unirec.c:1170
    +
    int size
    Size of a field.
    Definition: unirec.h:184
    +
    double (64b) array
    Definition: unirec.h:123
    +
    ur_field_id_t ur_last_statically_defined_id
    Last statically defined field by UR_FIELDS(...)
    Definition: unirec.h:168
    +
    unsigned int (8b) array
    Definition: unirec.h:114
    +
    ur_field_id_t ur_last_id
    The highest ID of a field + 1.
    Definition: unirec.h:169
    +
    unsigned int (32b)
    Definition: unirec.h:103
    +
    int ur_init(ur_static_field_specs_t field_specs_static)
    Initialize UniRec structures Initialize UniRec structures. Function is called during defining first o...
    Definition: unirec.c:206
    +
    int ur_ctx_set_input_template(trap_ctx_t *ctx, int ifc, ur_template_t *tmplt)
    Set UniRec template to input interface on specified context.
    Definition: unirec.c:856
    +
    ur_field_id_t ur_iter_t
    Type for identifying iteration id through all fields.
    Definition: unirec.h:137
    +
    ur_field_type_t
    Definition: unirec.h:95
    +
    void ur_print_template(ur_template_t *tmplt)
    Print UniRec template Print static_size, first_dynamic and table of offsets to stdout (for debugging)...
    Definition: unirec.c:1115
    +
    ur_field_id_linked_list_t * ur_undefine_fields
    linked list of free (undefined) IDs
    Definition: unirec.h:174
    +
    char * ur_ifc_data_fmt_to_field_names(const char *ifc_data_fmt)
    Parses field names from data format Function parses field names from data format and returns pointer ...
    Definition: unirec.c:434
    +
    int compare_fields(const void *field1, const void *field2)
    Compare fields Compare two fields. This function is for sorting the fields in the right order...
    Definition: unirec.c:785
    +
    char * ur_template_string_delimiter(const ur_template_t *tmplt, int delimiter)
    Get UniRec specifier of the tmplt template with delimiter between fields.
    Definition: unirec.c:253
    +
    uint16_t * offset
    Table of offsets.
    Definition: unirec.h:192
    +
    uint8_t intialized
    If the UniRec is initialized by function ur_init variable is set to UR_INITIALIZED, otherwise 0.
    Definition: unirec.h:175
    +
    uint16_t first_dynamic
    First dynamic (variable-length) field. Index to the ids array.
    Definition: unirec.h:195
    +
    int (64b) array
    Definition: unirec.h:121
    +
    ur_field_id_linked_list_t * next
    Pointer to next item in the linked list.
    Definition: unirec.h:145
    +
    ur_field_type_t * ur_field_types
    Array of types of fields.
    Definition: unirec.h:155
    +
    time (64b)
    Definition: unirec.h:111
    +
    void ur_copy_fields(const ur_template_t *dst_tmplt, void *dst, const ur_template_t *src_tmplt, const void *src)
    Copy data from one UniRec record to another. Copies all fields present in both templates from src to ...
    Definition: unirec.c:1253
    +
    char
    Definition: unirec.h:98
    +
    unsigned int (8b)
    Definition: unirec.h:99
    +
    UniRec template. It contains a table mapping a field to its position in an UniRec record...
    Definition: unirec.h:191
    +
    time (64b) array
    Definition: unirec.h:126
    +
    ur_tmplt_direction
    Definition: unirec.h:129
    +
    int (8b)
    Definition: unirec.h:100
    +
    uint16_t offset_size
    size of offset table.
    Definition: unirec.h:193
    +
    ur_field_id_t id
    free id
    Definition: unirec.h:144
    +
    int ur_template_compare(const ur_template_t *tmpltA, const ur_template_t *tmpltB)
    Compares fields of two UniRec templates Function compares only sets of UniRec fields (direction is no...
    Definition: unirec.c:1104
    +
    ur_iter_t ur_iter_fields_record_order(const ur_template_t *tmplt, int index)
    Iterate over fields of a template This function can be used to iterate over all fields of a given tem...
    Definition: unirec.c:1306
    +
    int ur_get_id_by_name(const char *name)
    Get ID of a field by its name Get ID of a field by its name.
    Definition: unirec.c:774
    +
    const char * ur_field_type_str[]
    UniRec data types.
    Definition: unirec.c:133
    +
    const char * ur_values_get_name_start_end(uint32_t start, uint32_t end, int32_t value)
    Returns name of specified value (Helper function) Helper function for ur_values_get_name. This function returns name of specified value and field, which is defined in values file. Function needs start and end index of a field.
    Definition: unirec.c:1666
    +
    ouput direction
    Definition: unirec.h:132
    +
    float (32b) array
    Definition: unirec.h:122
    +
    + + + + diff --git a/doc/unirec/ur__time_8h.html b/doc/unirec/ur__time_8h.html new file mode 100644 index 00000000..faa547d5 --- /dev/null +++ b/doc/unirec/ur__time_8h.html @@ -0,0 +1,145 @@ + + + + + + + +UniRec: ur_time.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_time.h File Reference
    +
    +
    + +

    Types, macros and function for UniRec timestamp format. +More...

    +
    #include <stdint.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    #define UR_TIME_NSEC_TO_FRAC   0x44B82FA0AULL
     
    #define ur_time_from_sec_nsec(sec, nsec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (nsec) * UR_TIME_NSEC_TO_FRAC) >> 32))
     Convert seconds and nanoseconds to ur_time_t. More...
     
    #define ur_time_from_sec_usec(sec, usec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (usec) * 1000 * UR_TIME_NSEC_TO_FRAC) >> 32))
     Convert seconds and microseconds to ur_time_t. More...
     
    #define ur_time_from_sec_msec(sec, msec)   (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (msec) * 1000000 * UR_TIME_NSEC_TO_FRAC) >> 32))
     Convert seconds and milliseconds to ur_time_t. More...
     
    #define ur_time_get_sec(time)   (uint32_t) ((uint64_t) (time) >> 32)
     Get number of seconds from ur_time_t. More...
     
    #define ur_time_get_nsec(time)   (uint32_t) ((((uint64_t) (time) & 0xffffffff) * 1000000000ULL + 0xffffffff) >> 32)
     Get number of nanoseconds from ur_time_t. More...
     
    #define ur_time_get_usec(time)   (uint32_t) (ur_time_get_nsec(time) / 1000)
     Get number of microeconds from ur_time_t. More...
     
    #define ur_time_get_msec(time)   (uint32_t) (ur_time_get_nsec(time) / 1000000)
     Get number of milliseconds from ur_time_t. More...
     
    + + + + +

    +Typedefs

    typedef uint64_t ur_time_t
     Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoch in 64bit fixed point number (32bit integral part, 32bit fraction part). More...
     
    + + + + + + + + + +

    +Functions

    static uint64_t ur_timediff (ur_time_t a, ur_time_t b)
     
    static uint64_t ur_timediff_us (ur_time_t a, ur_time_t b)
     
    static uint64_t ur_timediff_ns (ur_time_t a, ur_time_t b)
     
    uint8_t ur_time_from_string (ur_time_t *ur, const char *str)
     
    +

    Detailed Description

    +

    Types, macros and function for UniRec timestamp format.

    +
    Author
    Erik Sabik xsabi.nosp@m.k02@.nosp@m.stud..nosp@m.fit..nosp@m.vutbr.nosp@m..cz
    +
    +Vaclav Bartos ibart.nosp@m.osv@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
    +
    +Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
    +
    Date
    2013
    +
    +2014
    +
    +2015
    + +

    Definition in file ur_time.h.

    +
    + + + + diff --git a/doc/unirec/ur__time_8h_source.html b/doc/unirec/ur__time_8h_source.html new file mode 100644 index 00000000..5b3f1c14 --- /dev/null +++ b/doc/unirec/ur__time_8h_source.html @@ -0,0 +1,86 @@ + + + + + + + +UniRec: ur_time.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    ur_time.h
    +
    +
    +Go to the documentation of this file.
    1 
    11 /*
    12  * Copyright (C) 2013-2015 CESNET
    13  *
    14  * LICENSE TERMS
    15  *
    16  * Redistribution and use in source and binary forms, with or without
    17  * modification, are permitted provided that the following conditions
    18  * are met:
    19  * 1. Redistributions of source code must retain the above copyright
    20  * notice, this list of conditions and the following disclaimer.
    21  * 2. Redistributions in binary form must reproduce the above copyright
    22  * notice, this list of conditions and the following disclaimer in
    23  * the documentation and/or other materials provided with the
    24  * distribution.
    25  * 3. Neither the name of the Company nor the names of its contributors
    26  * may be used to endorse or promote products derived from this
    27  * software without specific prior written permission.
    28  *
    29  * ALTERNATIVELY, provided that this notice is retained in full, this
    30  * product may be distributed under the terms of the GNU General Public
    31  * License (GPL) version 2 or later, in which case the provisions
    32  * of the GPL apply INSTEAD OF those given above.
    33  *
    34  * This software is provided ``as is'', and any express or implied
    35  * warranties, including, but not limited to, the implied warranties of
    36  * merchantability and fitness for a particular purpose are disclaimed.
    37  * In no event shall the company or contributors be liable for any
    38  * direct, indirect, incidental, special, exemplary, or consequential
    39  * damages (including, but not limited to, procurement of substitute
    40  * goods or services; loss of use, data, or profits; or business
    41  * interruption) however caused and on any theory of liability, whether
    42  * in contract, strict liability, or tort (including negligence or
    43  * otherwise) arising in any way out of the use of this software, even
    44  * if advised of the possibility of such damage.
    45  *
    46  */
    47 #ifndef _UR_TIME_H
    48 #define _UR_TIME_H
    49 
    50 #include <stdint.h>
    51 
    61 typedef uint64_t ur_time_t;
    62 
    67 #define UR_TIME_NSEC_TO_FRAC 0x44B82FA0AULL
    68 //#define UR_TIME_USEC_TO_FRAC 0x10C6F7A0B5EEULL
    69 //#define UR_TIME_MSEC_TO_FRAC 0x4189374BC6A7F0ULL
    70 
    71 /*
    72 Note: We could use spearate constants for direct conversion from ms, us
    73 and ns, but each such constant would have a different rounding error.
    74 It would result in incorrect results when a value would be encoded from
    75 one precision and decoded in another one (e.g. store as ms -> read as us
    76 wouldn't result in a number like "x.xxx000").
    77 The only consistent way is to always convert to fixed-point using the
    78 highest precision (ns) and do additional conversion to/from ms/us by
    79 multiplying/dividing it by 1000 or 1000000, i.e. in decadic form.
    80 
    81 The current implementation satisfies these rules:
    82 (everything is related to the fractional part only, the integer part is easy)
    83 - Converting the time to unirec and back using the same precision always results
    84  in exactly the same number. Example:
    85  123456us -> ur_time -> 123456us
    86 - Setting the time in lower precision and reading it in higer precision
    87  results in a number ending with zeros. Example:
    88  123ms -> ur_time -> 123000000ns
    89 - Seting the time in higher precision and reading it in lower precision
    90  results in a floored value (i.e. rounded down). Example:
    91  199999us -> ur_time -> 199ms
    92 */
    93 
    94 
    100 #define ur_time_from_sec_nsec(sec, nsec) \
    101  (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (nsec) * UR_TIME_NSEC_TO_FRAC) >> 32))
    102 
    108 #define ur_time_from_sec_usec(sec, usec) \
    109  (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (usec) * 1000 * UR_TIME_NSEC_TO_FRAC) >> 32))
    110 
    116 #define ur_time_from_sec_msec(sec, msec) \
    117  (ur_time_t) (((uint64_t) (sec) << 32) | (((uint64_t) (msec) * 1000000 * UR_TIME_NSEC_TO_FRAC) >> 32))
    118 
    119 
    124 #define ur_time_get_sec(time) \
    125  (uint32_t) ((uint64_t) (time) >> 32)
    126 
    127 
    132 #define ur_time_get_nsec(time) \
    133  (uint32_t) ((((uint64_t) (time) & 0xffffffff) * 1000000000ULL + 0xffffffff) >> 32)
    134 
    139 #define ur_time_get_usec(time) \
    140  (uint32_t) (ur_time_get_nsec(time) / 1000)
    141 
    146 #define ur_time_get_msec(time) \
    147  (uint32_t) (ur_time_get_nsec(time) / 1000000)
    148 
    149 
    157 static inline uint64_t ur_timediff(ur_time_t a, ur_time_t b)
    158 {
    159  ur_time_t c = (a > b) ? a - b : b - a;
    160  return (uint64_t) ur_time_get_sec(c) * 1000 + ur_time_get_msec(c);
    161 }
    162 
    170 static inline uint64_t ur_timediff_us(ur_time_t a, ur_time_t b)
    171 {
    172  ur_time_t c = (a > b) ? a - b : b - a;
    173  return (uint64_t) ur_time_get_sec(c) * 1000000 + ur_time_get_usec(c);
    174 }
    175 
    183 static inline uint64_t ur_timediff_ns(ur_time_t a, ur_time_t b)
    184 {
    185  ur_time_t c = (a > b) ? a - b : b - a;
    186  return (uint64_t) ur_time_get_sec(c) * 1000000000 + ur_time_get_nsec(c);
    187 }
    188 
    200 uint8_t ur_time_from_string(ur_time_t *ur, const char *str);
    201 // hint: implementation is in unirec.c
    202 
    207 #endif
    uint8_t ur_time_from_string(ur_time_t *ur, const char *str)
    Definition: unirec.c:1606
    +
    static uint64_t ur_timediff_us(ur_time_t a, ur_time_t b)
    Definition: ur_time.h:170
    +
    uint64_t ur_time_t
    Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoc...
    Definition: ur_time.h:61
    +
    #define ur_time_get_sec(time)
    Get number of seconds from ur_time_t.
    Definition: ur_time.h:124
    +
    #define ur_time_get_msec(time)
    Get number of milliseconds from ur_time_t.
    Definition: ur_time.h:146
    +
    static uint64_t ur_timediff(ur_time_t a, ur_time_t b)
    Definition: ur_time.h:157
    +
    #define ur_time_get_nsec(time)
    Get number of nanoseconds from ur_time_t.
    Definition: ur_time.h:132
    +
    #define ur_time_get_usec(time)
    Get number of microeconds from ur_time_t.
    Definition: ur_time.h:139
    +
    static uint64_t ur_timediff_ns(ur_time_t a, ur_time_t b)
    Definition: ur_time.h:183
    +
    + + + + diff --git a/doc/unirec/ur__values_8c.html b/doc/unirec/ur__values_8c.html new file mode 100644 index 00000000..ac76b602 --- /dev/null +++ b/doc/unirec/ur__values_8c.html @@ -0,0 +1,105 @@ + + + + + + + +UniRec: ur_values.c File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_values.c File Reference
    +
    +
    +
    #include "ur_values.h"
    +
    +

    Go to the source code of this file.

    + + + + +

    +Variables

    const ur_values_t ur_values []
     
    +

    Variable Documentation

    + +

    ◆ ur_values

    + +
    +
    + + + + +
    const ur_values_t ur_values[]
    +
    + +

    Definition at line 6 of file ur_values.c.

    + +
    +
    +
    + + + + diff --git a/doc/unirec/ur__values_8c_source.html b/doc/unirec/ur__values_8c_source.html new file mode 100644 index 00000000..4879764b --- /dev/null +++ b/doc/unirec/ur__values_8c_source.html @@ -0,0 +1,80 @@ + + + + + + + +UniRec: ur_values.c Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    ur_values.c
    +
    +
    +Go to the documentation of this file.
    1 /************* THIS IS AUTOMATICALLY GENERATED FILE, DO NOT EDIT *************/
    2 /* Edit "values" file and run ur_values.sh script to add UniRec values. */
    3 
    4 #include "ur_values.h"
    5 
    6 const ur_values_t ur_values[] = {
    7  {0x1, "TCP_FIN", "Finish bit"},
    8  {0x2, "TCP_SYN", "Synchronize bit"},
    9  {0x4, "TCP_RST", "Reset bit"},
    10  {0x8, "TCP_PSH", "Push bit"},
    11  {0x10, "TCP_ACK", "Acknowledgement bit"},
    12  {0x20, "TCP_URG", "Urgent bit"},
    13  {1, "DIR_IN", "Direction"},
    14  {0, "DIR_OUT", "Direction"},
    15  {0x8, "DIR_FLAG_REQ", "Request"},
    16  {0x4, "DIR_FLAG_RSP", "Response"},
    17  {0x2, "DIR_FLAG_SF", "Single"},
    18  {0x1, "DIR_FLAG_NRC", "Not"},
    19  {0, "IPV6_TUN_NATIVE", "Native"},
    20  {1, "IPV6_TUN_TEREDO", "Teredo"},
    21  {2, "IPV6_TUN_ISATAP", "ISATAP"},
    22  {4, "IPV6_TUN_6TO4", "6to4"},
    23  {8, "IPV6_TUN_AYIYA", "AYIYA"},
    24  {16, "IPV6_TUN_OTHER", "Other protocol"},
    25  {32, "IPV6_TUN_6OVER4", "6over4"},
    26  {0x1, "SPOOF_BOGONS", "Bogon"},
    27  {0x2, "SPOOF_SYMETRIC", "Symetric"},
    28  {0x4, "SPOOF_NEWIP", "New IP"},
    29  {0x8, "SPOOF_TCPHIST", "TCP history"},
    30  {1, "EVT_T_PORTSCAN", "Portscan (unspecified"},
    31  {2, "EVT_T_PORTSCAN_H", "Horizontal portscan (one or a few ports, many"},
    32  {3, "EVT_T_PORTSCAN_V", "Vertical portscan (one address, many"},
    33  {10, "EVT_T_DOS", "Denial of service attack (unspecified"},
    34  {11, "EVT_T_SYNFLOOD", "TCP SYN"},
    35  {15, "EVT_T_DNSAMP", "DNS Amplification"},
    36  {30, "EVT_T_BRUTEFORCE", "Bruteforce password"},
    37  {40, "EVT_T_VOIP_PREFIX_GUESS", "VoIP prefix"},
    38  {41, "EVT_T_VOIP_CALL_DIFFERENT_COUNTRY", "VoIP call to different"},
    39  {1, "TUN_T_REQUEST_TUNNEL", "Request anomaly - detected"},
    40  {2, "TUN_T_REQUEST_OTHER", "Request anomaly - detected other anomaly than"},
    41  {3, "TUN_T_REQUEST_MALFORMED_P", "Request anomaly - malformed"},
    42  {4, "TUN_T_RESPONSE_TUNNEL_REQ", "Response anomaly - detected tunnel in request string"},
    43  {5, "TUN_T_RESPONSE_TUNNEL_TXT", "Response anomaly - detected tunnel in TXT"},
    44  {6, "TUN_T_RESPONSE_TUNNEL_CNAME", "Response anomaly - detected tunnel in CNAME"},
    45  {7, "TUN_T_RESPONSE_TUNNEL_MX", "Response anomaly - detected tunnel in MX"},
    46  {8, "TUN_T_RESPONSE_TUNNEL_NS", "Response anomaly - detected tunnel in NS"},
    47  {9, "TUN_T_RESPONSE_OTHER", "Response anomaly - detected other anomaly than"},
    48  {10, "TUN_T_RESPONSE_MALFORMED_P", "Response anomaly - malformed"},
    49  {24, "HB_HEARTBEAT", "Type of message is heartbeat"},
    50  {0, "HB_UNKNOWN", "Unknow direction - if message is"},
    51  {1, "HB_REQUEST", "Heartbeat"},
    52  {2, "HB_RESPONSE", "Heartbeat"},
    53  {1, "HB_AT_MIN_SIZE", "Request smaller then minimal request"},
    54  {2, "HB_AT_DIFF_SIZE", "Payload size is greater then real message"},
    55  {4, "HB_AT_DIFF_REQ_RESP", "Difference of request and response size is too"},
    56  {8, "HB_AVG_RESP", "Average response size is suspicious (only if do not have"},
    57  {1, "WT_PORTSCAN", ""},
    58  {2, "WT_BRUTEFORCE", ""},
    59  {3, "WT_PROBE", ""},
    60  {4, "WT_SPAM", ""},
    61  {5, "WT_PHISHING", ""},
    62  {6, "WT_BOTNET_C_C", ""},
    63  {7, "WT_DOS", ""},
    64  {8, "WT_MALWARE", ""},
    65  {9, "WT_COPYRIGHT", ""},
    66  {10, "WT_WEBATTACK", ""},
    67  {11, "WT_VULNERABILITY", ""},
    68  {12, "WT_TEST", ""},
    69  {13, "WT_OTHER", ""},
    70  {1, "HTTP_SDM_METHOD_GET", "Constants taken from http-sdm.h in sources of http-sdm exporter"},
    71  {2, "HTTP_SDM_METHOD_POST", ""},
    72  {4, "HTTP_SDM_METHOD_HEAD", ""},
    73  {5, "HTTP_SDM_METHOD_PUT", ""},
    74  {6, "HTTP_SDM_METHOD_OPTIONS", ""},
    75  {7, "HTTP_SDM_METHOD_DELETE", ""},
    76  {8, "HTTP_SDM_METHOD_TRACE", ""},
    77  {9, "HTTP_SDM_METHOD_CONNECT", ""},
    78 
    79 };
    +
    const ur_values_t ur_values[]
    Definition: ur_values.c:6
    +
    Values names and descriptions It contains a table mapping a value to name and description.
    Definition: ur_values.h:13
    +
    + + + + diff --git a/doc/unirec/ur__values_8h.html b/doc/unirec/ur__values_8h.html new file mode 100644 index 00000000..60e0bc3f --- /dev/null +++ b/doc/unirec/ur__values_8h.html @@ -0,0 +1,565 @@ + + + + + + + +UniRec: ur_values.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    ur_values.h File Reference
    +
    +
    +
    #include <stdint.h>
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Data Structures

    struct  ur_values_t
     Values names and descriptions It contains a table mapping a value to name and description. More...
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    #define UR_TYPE_START_TCP_FLAGS   0
     
    #define UR_TYPE_END_TCP_FLAGS   6
     
    #define UR_TYPE_START_DIR_BIT_FIELD   6
     
    #define UR_TYPE_END_DIR_BIT_FIELD   8
     
    #define UR_TYPE_START_DIRECTION_FLAGS   8
     
    #define UR_TYPE_END_DIRECTION_FLAGS   12
     
    #define UR_TYPE_START_IPV6_TUN_TYPE   12
     
    #define UR_TYPE_END_IPV6_TUN_TYPE   19
     
    #define UR_TYPE_START_SPOOF_TYPE   19
     
    #define UR_TYPE_END_SPOOF_TYPE   23
     
    #define UR_TYPE_START_EVENT_TYPE   23
     
    #define UR_TYPE_END_EVENT_TYPE   32
     
    #define UR_TYPE_START_TUNNEL_TYPE   32
     
    #define UR_TYPE_END_TUNNEL_TYPE   42
     
    #define UR_TYPE_START_HB_TYPE   42
     
    #define UR_TYPE_END_HB_TYPE   43
     
    #define UR_TYPE_START_HB_DIR   43
     
    #define UR_TYPE_END_HB_DIR   46
     
    #define UR_TYPE_START_HB_ALERT_TYPE_FIELD   46
     
    #define UR_TYPE_END_HB_ALERT_TYPE_FIELD   50
     
    #define UR_TYPE_START_WARDEN_TYPE   50
     
    #define UR_TYPE_END_WARDEN_TYPE   63
     
    #define UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID   63
     
    #define UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID   71
     
    +

    Data Structure Documentation

    + +

    ◆ ur_values_t

    + +
    +
    + + + + +
    struct ur_values_t
    +
    +

    Values names and descriptions It contains a table mapping a value to name and description.

    + +

    Definition at line 13 of file ur_values.h.

    +
    + + + + + + + + + + +
    Data Fields
    +char * +description +Description of Value.
    +char * +name +Name of Value.
    +int32_t +value +Numeric Value.
    + +
    +
    +

    Macro Definition Documentation

    + +

    ◆ UR_TYPE_END_DIR_BIT_FIELD

    + +
    +
    + + + + +
    #define UR_TYPE_END_DIR_BIT_FIELD   8
    +
    + +

    Definition at line 22 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_DIRECTION_FLAGS

    + +
    +
    + + + + +
    #define UR_TYPE_END_DIRECTION_FLAGS   12
    +
    + +

    Definition at line 24 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_EVENT_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_EVENT_TYPE   32
    +
    + +

    Definition at line 30 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_HB_ALERT_TYPE_FIELD

    + +
    +
    + + + + +
    #define UR_TYPE_END_HB_ALERT_TYPE_FIELD   50
    +
    + +

    Definition at line 38 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_HB_DIR

    + +
    +
    + + + + +
    #define UR_TYPE_END_HB_DIR   46
    +
    + +

    Definition at line 36 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_HB_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_HB_TYPE   43
    +
    + +

    Definition at line 34 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID

    + +
    +
    + + + + +
    #define UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID   71
    +
    + +

    Definition at line 42 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_IPV6_TUN_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_IPV6_TUN_TYPE   19
    +
    + +

    Definition at line 26 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_SPOOF_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_SPOOF_TYPE   23
    +
    + +

    Definition at line 28 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_TCP_FLAGS

    + +
    +
    + + + + +
    #define UR_TYPE_END_TCP_FLAGS   6
    +
    + +

    Definition at line 20 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_TUNNEL_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_TUNNEL_TYPE   42
    +
    + +

    Definition at line 32 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_END_WARDEN_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_END_WARDEN_TYPE   63
    +
    + +

    Definition at line 40 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_DIR_BIT_FIELD

    + +
    +
    + + + + +
    #define UR_TYPE_START_DIR_BIT_FIELD   6
    +
    + +

    Definition at line 21 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_DIRECTION_FLAGS

    + +
    +
    + + + + +
    #define UR_TYPE_START_DIRECTION_FLAGS   8
    +
    + +

    Definition at line 23 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_EVENT_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_EVENT_TYPE   23
    +
    + +

    Definition at line 29 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_HB_ALERT_TYPE_FIELD

    + +
    +
    + + + + +
    #define UR_TYPE_START_HB_ALERT_TYPE_FIELD   46
    +
    + +

    Definition at line 37 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_HB_DIR

    + +
    +
    + + + + +
    #define UR_TYPE_START_HB_DIR   43
    +
    + +

    Definition at line 35 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_HB_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_HB_TYPE   42
    +
    + +

    Definition at line 33 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID

    + +
    +
    + + + + +
    #define UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID   63
    +
    + +

    Definition at line 41 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_IPV6_TUN_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_IPV6_TUN_TYPE   12
    +
    + +

    Definition at line 25 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_SPOOF_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_SPOOF_TYPE   19
    +
    + +

    Definition at line 27 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_TCP_FLAGS

    + +
    +
    + + + + +
    #define UR_TYPE_START_TCP_FLAGS   0
    +
    + +

    Definition at line 19 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_TUNNEL_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_TUNNEL_TYPE   32
    +
    + +

    Definition at line 31 of file ur_values.h.

    + +
    +
    + +

    ◆ UR_TYPE_START_WARDEN_TYPE

    + +
    +
    + + + + +
    #define UR_TYPE_START_WARDEN_TYPE   50
    +
    + +

    Definition at line 39 of file ur_values.h.

    + +
    +
    +
    + + + + diff --git a/doc/unirec/ur__values_8h_source.html b/doc/unirec/ur__values_8h_source.html new file mode 100644 index 00000000..bf2f0a1d --- /dev/null +++ b/doc/unirec/ur__values_8h_source.html @@ -0,0 +1,81 @@ + + + + + + + +UniRec: ur_values.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    UniRec +  2.9.3 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    ur_values.h
    +
    +
    +Go to the documentation of this file.
    1 #ifndef _UR_VALUES_H_
    2 #define _UR_VALUES_H_
    3 
    4 /************* THIS IS AUTOMATICALLY GENERATED FILE, DO NOT EDIT *************/
    5 /* Edit "values" file and run ur_values.sh script to add UniRec values. */
    6 /*****************************************************************************/
    7 
    8 #include <stdint.h>
    9 
    13 typedef struct ur_values_s {
    14  int32_t value;
    15  char *name;
    16  char *description;
    17 } ur_values_t;
    18 
    19 #define UR_TYPE_START_TCP_FLAGS 0
    20 #define UR_TYPE_END_TCP_FLAGS 6
    21 #define UR_TYPE_START_DIR_BIT_FIELD 6
    22 #define UR_TYPE_END_DIR_BIT_FIELD 8
    23 #define UR_TYPE_START_DIRECTION_FLAGS 8
    24 #define UR_TYPE_END_DIRECTION_FLAGS 12
    25 #define UR_TYPE_START_IPV6_TUN_TYPE 12
    26 #define UR_TYPE_END_IPV6_TUN_TYPE 19
    27 #define UR_TYPE_START_SPOOF_TYPE 19
    28 #define UR_TYPE_END_SPOOF_TYPE 23
    29 #define UR_TYPE_START_EVENT_TYPE 23
    30 #define UR_TYPE_END_EVENT_TYPE 32
    31 #define UR_TYPE_START_TUNNEL_TYPE 32
    32 #define UR_TYPE_END_TUNNEL_TYPE 42
    33 #define UR_TYPE_START_HB_TYPE 42
    34 #define UR_TYPE_END_HB_TYPE 43
    35 #define UR_TYPE_START_HB_DIR 43
    36 #define UR_TYPE_END_HB_DIR 46
    37 #define UR_TYPE_START_HB_ALERT_TYPE_FIELD 46
    38 #define UR_TYPE_END_HB_ALERT_TYPE_FIELD 50
    39 #define UR_TYPE_START_WARDEN_TYPE 50
    40 #define UR_TYPE_END_WARDEN_TYPE 63
    41 #define UR_TYPE_START_HTTP_SDM_REQUEST_METHOD_ID 63
    42 #define UR_TYPE_END_HTTP_SDM_REQUEST_METHOD_ID 71
    43 
    44 #endif
    char * name
    Name of Value.
    Definition: ur_values.h:15
    +
    char * description
    Description of Value.
    Definition: ur_values.h:16
    +
    int32_t value
    Numeric Value.
    Definition: ur_values.h:14
    +
    Values names and descriptions It contains a table mapping a value to name and description.
    Definition: ur_values.h:13
    +
    + + + + diff --git a/doc/warden.md b/doc/warden.md new file mode 100644 index 00000000..b98d16b3 --- /dev/null +++ b/doc/warden.md @@ -0,0 +1,128 @@ +--- +layout: page +title: Connection to Warden system +menuentry: Warden +public: false +docmenu: true +permalink: /doc/warden/ +--- + +Warden ([warden.cesnet.cz](https://warden.cesnet.cz//en/index)) is a system for +sharing detected security events in form of low-level [IDEA](idea.cesnet.cz) +messages - alerts. + +NEMEA system is ready to send detected events into Warden and help the community in a potential collaborative defense this way. + +At first, Warden client must be registered properly on the Warden server. See +[guide](https://warden.cesnet.cz/en/participation) for detailed information to +obtain a valid certificate. + +There are two main principles of connection to Warden, both of them are related to the configuration of NEMEA Reporting modules: + +## Reporters - Files - Warden Filer + +The simplest way of export is to use a service process, which is called `warden_filer` from `contrib` package: [warden.cesnet.cz/en/downloads](https://warden.cesnet.cz/en/downloads). + +To install and run it, see the README file of the `warden_filer`. + +Sample configuration file can look like: + +``` +{ + "warden": { + "url": "https://warden-hub.cesnet.cz/warden3", + "certfile": "/etc/warden/filer/cert.pem", + "keyfile": "/etc/warden/filer/key.pem", + "cafile": "/etc/warden/filer/ca-bundle.crt", + "timeout": 60, + "get_events_limit": 1000, + "errlog": {"level": "error"}, + "filelog": {"file": "/data/warden/warden_client.log", "level": "error"}, + "idstore": "warden_client.id", + "name": "cz.my.registered.ids" + }, + "sender": { + "dir": "/data/warden/filer/", + "node": { + "Name": "cz.my.registered.warden_filer" + } + } +} +``` + +The most important parameter is `dir` that point to a directory, where it waits for new messages to send. + +This `dir` must be used to configure reporting modules. + +Use [file type](/reporting/#file) of custom action to set a target directory and use tmpdir that points to tmp/ subdir. + +Example of configuration file for NEMEA reporters (`/etc/nemea/reporters-config.yml`) with `/data/warden/filer/` dir: + +``` +custom_actions: + - id: warden_export + file: + - path: /data/warden/filer/incoming/ + - temp_path: /data/warden/filer/temp/ + +rules: + - id: always_export + condition: True + actions: + - warden_exports +``` + +Reporter modules can be started simply as follows: + +``` +vportscan2idea.py --name=cz.my.registered.nemea.vportscan -c /etc/nemea/reporters-config.yml +``` + + +This way, any IDEA message created in `/data/warden/filer/incoming/` will be sent to warden by `warden_filer` and only one registration and one certificate is needed for a server. + +## Direct export by warden action + +Reporters are able to send alerts to Warden directly. + +There is a warden type of action. + +This way requires an additional config file to be passed as `--warden=` argument to each reporter at startup (e.g. `/etc/warden/vportscan/config.cfg`). + +Example: + +``` +vportscan2idea.py --name=cz.my.registered.nemea.vportscan --warden=/etc/warden/vportscan/config.cfg -c /etc/nemea/reporters-config.yml +``` + +Example of `/etc/warden/vportscan/config.cfg`: + +``` +{ + "url": "https://warden-hub.cesnet.cz/warden3", + "certfile": "/etc/warden/vportscan/cert.pem", + "keyfile": "/etc/warden/vportscan/key.pem", + "cafile": "/etc/ssl/certs/ca-bundle.crt", + "timeout": 60, + "get_events_limit": 1000, + "errlog": {"level": "debug"}, + "syslog": {"socket": "/dev/log", "facility": "local7", "level": "warning"}, +} +``` + +Example of configuration file for NEMEA reporters (`/etc/nemea/reporters-config.yml`): + +``` +custom_actions: +- id: warden + warden: + +rules: + - id: always_export + condition: True + actions: + - warden +``` + +It is worth noting that each reporter must have its own `config.cfg`, certificate, and it must be registered on Warden server. + diff --git a/feed.xml b/feed.xml new file mode 100644 index 00000000..a6628bd8 --- /dev/null +++ b/feed.xml @@ -0,0 +1,30 @@ +--- +layout: null +--- + + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + {% for post in site.posts limit:10 %} + + {{ post.title | xml_escape }} + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {% for tag in post.tags %} + {{ tag | xml_escape }} + {% endfor %} + {% for cat in post.categories %} + {{ cat | xml_escape }} + {% endfor %} + + {% endfor %} + + diff --git a/generate-rpm.sh b/generate-rpm.sh deleted file mode 100755 index 7ea9b836..00000000 --- a/generate-rpm.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2015 CESNET -# -# LICENSE TERMS -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of the Company nor the names of its contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# ALTERNATIVELY, provided that this notice is retained in full, this -# product may be distributed under the terms of the GNU General Public -# License (GPL) version 2 or later, in which case the provisions -# of the GPL apply INSTEAD OF those given above. -# -# This software is provided ``as is'', and any express or implied -# warranties, including, but not limited to, the implied warranties of -# merchantability and fitness for a particular purpose are disclaimed. -# In no event shall the company or contributors be liable for any -# direct, indirect, incidental, special, exemplary, or consequential -# damages (including, but not limited to, procurement of substitute -# goods or services; loss of use, data, or profits; or business -# interruption) however caused and on any theory of liability, whether -# in contract, strict liability, or tort (including negligence or -# otherwise) arising in any way out of the use of this software, even -# if advised of the possibility of such damage. - -pwd -./bootstrap.sh >/dev/null 2>/dev/null&& ./configure -q && make -j4 && make rpm - diff --git a/if2019/index.md b/if2019/index.md new file mode 100644 index 00000000..bdf4f2fc --- /dev/null +++ b/if2019/index.md @@ -0,0 +1,16 @@ +--- +layout: page +title: Hands-on workshop at InstallFest2019 (Czech) +menuentry: installfest2019 +public: false +permalink: /if2019/ +--- + +# Setup own monitoring infrastructure + +Files for download: + +* Presentation files: [mon-workshop-files.tar.gz]({{"./mon-workshop-files.tar.gz" | prepend: site.baseurl}}) +* All files available at [Google Drive](https://drive.google.com/drive/u/0/folders/1jf7Q9jpHlp3OvhpLGbKYq7a9qMeJACoD). +* To setup PC room at FEE CTU in Prague: [workshop-setup.sh]({{"./workshop-setup.sh" | prepend: site.baseurl}}) + diff --git a/if2019/mon-workshop-files.tar.gz b/if2019/mon-workshop-files.tar.gz new file mode 100644 index 00000000..457e6d7b Binary files /dev/null and b/if2019/mon-workshop-files.tar.gz differ diff --git a/if2019/workshop-setup.sh b/if2019/workshop-setup.sh new file mode 100644 index 00000000..b3c886ba --- /dev/null +++ b/if2019/workshop-setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x + +# Warning: this script was created to setup PCs in the lab of FEE CTU in Prague +# (www.fel.cvut.cz) +# You probably should not run it anywhere else... + +sudo /opt/vytahnout.sh + +VBoxManage import --options keepallmacs,importtovdi /opt/InstallFest2019/installfest2019.ova + +mkdir ~guest/monitoring-ws +cd ~guest/monitoring-ws +wget -O - 'https://nemea.liberouter.org/if2019/mon-workshop-files.tar.gz' | tar -xzf - + +VirtualBox& + diff --git a/images/bg_hr.png b/images/bg_hr.png new file mode 100644 index 00000000..514aee50 Binary files /dev/null and b/images/bg_hr.png differ diff --git a/images/blacktocat.png b/images/blacktocat.png new file mode 100644 index 00000000..e160053a Binary files /dev/null and b/images/blacktocat.png differ diff --git a/images/icon_download.png b/images/icon_download.png new file mode 100644 index 00000000..5a793f17 Binary files /dev/null and b/images/icon_download.png differ diff --git a/images/interoperability.png b/images/interoperability.png new file mode 100644 index 00000000..4876c7a0 Binary files /dev/null and b/images/interoperability.png differ diff --git a/images/nemea-scheme.png b/images/nemea-scheme.png new file mode 100644 index 00000000..7e523ffa Binary files /dev/null and b/images/nemea-scheme.png differ diff --git a/images/reporter-config.odg b/images/reporter-config.odg new file mode 100644 index 00000000..f658057d Binary files /dev/null and b/images/reporter-config.odg differ diff --git a/images/reporter-config.png b/images/reporter-config.png new file mode 100644 index 00000000..00eb1274 Binary files /dev/null and b/images/reporter-config.png differ diff --git a/images/sprite_download.png b/images/sprite_download.png new file mode 100644 index 00000000..f9f8de24 Binary files /dev/null and b/images/sprite_download.png differ diff --git a/index.md b/index.md new file mode 100644 index 00000000..4ebf7bb2 --- /dev/null +++ b/index.md @@ -0,0 +1,93 @@ +--- +layout: default +--- + +# General Information + +NEMEA (Network Measurements Analysis) system is a **stream-wise**, +**flow-based** and **modular** detection system for network traffic analysis. +In practice, it is a set of independently running NEMEA modules that process +continuously incoming data (**messages**). Usually, the messages contain information about network +flows (like NetFlow or IPFIX formats) but the messages are more general - they might represent +detected security events or anything else. +A NEMEA module is technically an executable file that can be run in multiple instances in +an operating system. + +The system is suitable for an on-the-fly analysis of the flow data (live or captured&stored). +The system currently contains a set of modules for *detection* various types of suspicious traffic, +computing *statistics* of the traffic, *filtering*/*aggregating* messages, +*reporting* alerts that were detected. +Even though the functionality of modules differ (each module has some own purpose), all modules +are handled uniformly - they all use the same **NEMEA framework** that implements the functionality +of inter-module communication, data format (representation of the messages), common data structures +and algorithms. + +**NEMEA Modules** can receive or send messages using input and output **communication +interfaces (IFC)**. The number of input and output IFCs is usually chosen by a developer +based on the functionality of the NEMEA module, e.g. a detection module usually receives +flow data via one input IFC and sends alerts (other format/content of messages) +via one output IFC. + +![Connected NEMEA modules](images/nemea-scheme.png) + +Since the **configuration of IFCs** is done during **startup**, a user may choose which module to interconnect +and how. There are several types of IFCs that can be chosen ([IFC types](/trap-ifcspec/)). +A NEMEA module (at the time of development) does not need any information about other modules, +however, it usually expects some information fields in the messages that are needed for the processing. +That means a module might be connected to any other module to receive data from, but +only a data sources containing all needed information will work. + +There are several ways how to **get data into NEMEA**. It is possible to read data from *files* +(CSV, nfdump, PCAP), receive data from [IPFIXcol collector](https://github.com/CESNET/IPFIXcol) +(which supports NetFlow/IPFIX formats) via special IPFIXcol [UniRec plugin](https://github.com/CESNET/ipfixcol/tree/master/plugins/storage/unirec), use NEMEA flow exporter ([flow_meter](https://github.com/CESNET/Nemea-Modules/tree/master/flow_meter)). + +![NEMEA interoperability - supported data formats](images/interoperability.png) + + + +Further Information +=================== + +* [Documentation section](/doc/) +* README files of [NEMEA](https://github.com/CESNET/NEMEA/), [Modules](https://github.com/CESNET/Nemea-Modules/), [Detectors](https://github.com/CESNET/Nemea-Detectors/), [NEMEA Supervisor](https://github.com/CESNET/Nemea-Supervisor/) +* Public mailing list: nemea@cesnet.cz, subscribe at: [https://random.cesnet.cz/mailman/listinfo/nemea](https://random.cesnet.cz/mailman/listinfo/nemea) +* The archive of mailing list: [https://random.cesnet.cz/pipermail/nemea/](https://random.cesnet.cz/pipermail/nemea/) +* Twitter: [@NEMEA_System](https://twitter.com/NEMEA_System) + +Attribution +=========== + +We kindly ask anyone who uses NEMEA for research and writes an academic paper about it to cite NEMEA as follows: + +``` +@inproceedings{nemea16, + author = {Cejka, Tomas and Bartos, Vaclav and Svepes, Marek and Rosa, Zdenek and Kubatova, Hana}, + title = {NEMEA: A Framework for Network Traffic Analysis}, + booktitle = {12th International Conference on Network and Service Management (CNSM 2016)}, + doi = {10.1109/CNSM.2016.7818417}, + url = {http://dx.doi.org/10.1109/CNSM.2016.7818417}, + year = 2016 +} +``` + +NEMEA Related Publications +========================== + +* Tomas Jansky, Tomas Cejka, Vaclav Bartoš, [Hunting SIP Authentication Attacks Efficiently](http://dx.doi.org/10.1007/978-3-319-60774-0_9), In Security of Networks and Services in an All-Connected World: 11th IFIP WG 6.6 International Conference on Autonomous Infrastructure, Management, and Security, AIMS 2017, Zurich, Switzerland, 2017. + +* Marek Švepeš, Tomas Cejka. [Making Flow-Based Security Detection Parallel](http://dx.doi.org/10.1007/978-3-319-60774-0_1). In Security of Networks and Services in an All-Connected World: 11th IFIP WG 6.6 International Conference on Autonomous Infrastructure, Management, and Security, AIMS 2017, Zurich, Switzerland, 2017. + +* Tomas Cejka, Václav Bartoš, Marek Svepes, Zdenek Rosa, Hana Kubatova. [NEMEA: A Framework for Network Traffic Analysis](http://dx.doi.org/10.1109/CNSM.2016.7818417). In 12th International Conference on Network and Service Management (CNSM 2016), Montreal, Canada, 2016. + +* Zdenek Rosa, Tomas Cejka, Martin Zadnik, Viktor Puš. [Building a Feedback Loop to Capture Evidence of Network Incidents](http://dx.doi.org/10.1109/CNSM.2016.7818435). In 12th International Conference on Network and Service Management (CNSM 2016), Montreal, Canada, 2016. + +* Tomas Cejka, Marek Svepes. [Analysis of Vertical Scans Discovered by Naive Detection](http://dx.doi.org/10.1007/978-3-319-39814-3_19). Management and Security in the Age of Hyperconnectivity: 10th IFIP WG 6.6 International Conference on Autonomous Infrastructure, Management, and Security, AIMS 2016. + +* Tomáš Čejka, Radoslav Bodó, Hana Kubátová: Nemea: Searching for Botnet Footprints. In: Proceedings of the 3rd Prague Embedded Systems Workshop (PESW), Prague, CZ, 2015. + +* Tomáš Čejka, Václav Bartoš, Lukáš Truxa, Hana Kubátová: [Using Application-Aware Flow Monitoring for SIP Fraud Detection](http://link.springer.com/chapter/10.1007/978-3-319-20034-7_10). In: Proc. of 9th International Conference on Autonomous Infrastructure, Management and Security (AIMS15), 2015. + +* Tomáš Čejka, Zdeněk Rosa and Hana Kubátová: [Stream-wise Detection of Surreptitious Traffic over DNS](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=true&arnumber=7033254). In: Proc. of 19th IEEE International Workshop on Computer Aided Modeling and Design of Communication Links and Networks (CAMAD 2014). Athens, 2014. + +* Václav Bartoš, Martin Žádník, Tomáš Čejka: [Nemea: Framework for stream-wise analysis of network traffic](http://www.cesnet.cz/wp-content/uploads/2014/02/trapnemea.pdf), CESNET technical report 6/2013. + diff --git a/jenkins/Centos-Dockerfile b/jenkins/Centos-Dockerfile deleted file mode 100644 index cb1127a8..00000000 --- a/jenkins/Centos-Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM centos:7 - -RUN rpm -ih http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; \ - yum install -y autoconf automake gcc gcc-c++ libtool libxml2-devel m4 make \ - openssl openssl-devel pkg-config libxslt-devel graphviz \ - xsltproc git bc libxml2-python libxslt-python doxygen \ - libpcap-devel bison flex python python-devel python-pip \ - python-setuptools python34 python34-devel python34-pip python34-setuptools python-yaml python34-ply python34-yaml \ - rpm-build epel-rpm-macros; \ - curl -s 'https://copr.fedorainfracloud.org/coprs/g/CESNET/NEMEA/repo/epel-7/group_CESNET-NEMEA-epel-7.repo' > /etc/yum.repos.d/group_CESNET-NEMEA-epel-7.repo; \ - yum install -y python-pynspect python34-pynspect - -RUN chmod u+s,o+rx /usr/sbin/useradd /usr/sbin/groupadd; yum install -y sudo; sed -i "\$aALL ALL=(ALL) NOPASSWD:ALL" /etc/sudoers - -CMD ["/usr/bin/cat"] - diff --git a/jenkins/Debian-Dockerfile b/jenkins/Debian-Dockerfile deleted file mode 100644 index 4123e9bc..00000000 --- a/jenkins/Debian-Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM debian:stable - -RUN apt-get update; apt-get install -y gawk autoconf automake gcc g++ libtool make pkg-config libpcap-dev \ - libxml2-dev libidn11-dev bison flex \ - libssl-dev pkg-config libxslt-dev xsltproc doxygen graphviz \ - bc git \ - python python-dev python-pip python-setuptools python3 python3-dev python3-pip python3-setuptools \ - debmake devscripts debhelper python3-all-dev - -RUN pip install stdeb; pip3 install stdeb - -RUN chmod u+s,o+rx /usr/sbin/useradd /usr/sbin/groupadd; apt-get install -y sudo; sed -i "\$aALL ALL=(ALL) NOPASSWD:ALL" /etc/sudoers - -CMD ["/bin/bash"] - diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile deleted file mode 100644 index 3c9b4ca0..00000000 --- a/jenkins/Jenkinsfile +++ /dev/null @@ -1,53 +0,0 @@ -pipeline { - agent none - stages { - stage('Build Centos') { - agent { - dockerfile { - filename 'Centos-Dockerfile' - dir 'jenkins' - } - } - steps { - //sh './bootstrap.sh && ./configure --prefix=$PWD/install --libdir=$PWD/install/lib -q --enable-debug CXXFLAGS=-coverage CFLAGS=-coverage LDFLAGS=-lgcov && make rpm make install && export LD_LIBRARY_PATH=$PWD/install/lib && export CPPFLAGS=-I$PWD/install/include && (cd pytrap && make coverage; python setup.py install;)' - - sh '/usr/sbin/groupadd -f -g `id -g` jenkins; /usr/sbin/useradd jenkins -u `id -u` -g `id -g`; true' - - sh '( cd nemea-framework/libtrap; ./bootstrap.sh && ./configure -q && make rpm && sudo yum install -y ./RPMBUILD/RPMS/*/libtrap*.rpm;)' - sh '( cd nemea-framework/unirec; ./bootstrap.sh && ./configure -q && make rpm && sudo yum install -y ./RPMBUILD/RPMS/*/unirec*.rpm;)' - sh '( cd nemea-framework/common; ./bootstrap.sh && ./configure -q && make rpm && sudo yum install -y ./RPMBUILD/RPMS/*/nemea-common*.rpm;)' - sh '( ./bootstrap.sh && ./configure -q;)' - sh '( cd nemea-framework/pytrap; make rpm; sudo yum install -y ./dist/*.rpm;)' - sh '( cd nemea-framework/pycommon; make rpm; sudo yum install -y ./dist/*.rpm;)' - sh '( cd modules; ./bootstrap.sh && ./configure -q && make rpm; sudo yum install -y ./RPMBUILD/RPMS/*/*.rpm;)' - sh '( cd detectors; ./bootstrap.sh && ./configure -q && make rpm; sudo yum install -y ./RPMBUILD/RPMS/*/*.rpm;)' - sh '( cd supervisor; ./bootstrap.sh && ./configure -q && make rpm; sudo yum install -y ./RPMBUILD/RPMS/*/*.rpm;)' - sh 'mkdir -p rpms; find libtrap unirec common pytrap pycommon -name "*.rpm" -exec mv {} rpms ";"' - archiveArtifacts artifacts: 'rpms/*', onlyIfSuccessful: true - } - } - stage('Build Debian packages') { - agent { - dockerfile { - filename 'Debian-Dockerfile' - dir 'jenkins' - } - } - steps { - sh '/usr/sbin/groupadd -f -g `id -g` jenkins; /usr/sbin/useradd jenkins -u `id -u` -g `id -g`; true' - - sh '( cd nemea-framework/libtrap; ./bootstrap.sh && ./configure -q && make deb && sudo dpkg -i ./libtrap*.deb;)' - sh '( cd nemea-framework/unirec; ./bootstrap.sh && ./configure -q && make deb && sudo dpkg -i ./unirec*.deb;)' - sh '( cd nemea-framework/common; ./bootstrap.sh && ./configure -q && make deb && sudo dpkg -i ./nemea-common*.deb;)' - sh '( cd nemea-framework/pytrap; python setup.py --command-packages=stdeb.command bdist_deb; python3 setup.py --command-packages=stdeb.command bdist_deb; sudo dpkg -i ./deb_dist/*.deb;)' - sh '( cd nemea-framework/pycommon; python setup.py --command-packages=stdeb.command bdist_deb; python3 setup.py --command-packages=stdeb.command bdist_deb; sudo dpkg -i ./deb_dist/*.deb;)' - sh '( cd modules; ./bootstrap.sh && ./configure -q && make rpm; sudo dpkg -i ./nemea-modules*.deb;)' - sh '( cd detectors; ./bootstrap.sh && ./configure -q && make rpm; sudo dpkg -i ./nemea-detectors*.deb;)' - sh '( cd supervisor; ./bootstrap.sh && ./configure -q && make rpm; sudo dpkg -i ./nemea-supervisor*.deb;)' - sh 'mkdir -p debs; find libtrap unirec common pytrap pycommon -name "*.deb" -exec mv {} debs ";"' - archiveArtifacts artifacts: 'debs/*', onlyIfSuccessful: true - } - } - } -} - diff --git a/js/jquery-3.3.1.min.js b/js/jquery-3.3.1.min.js new file mode 100644 index 00000000..4d9b3a25 --- /dev/null +++ b/js/jquery-3.3.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("