2 "==============================================\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" 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" 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" 10 "Example of startup of a module with 1 input and 1 output IFC:\n" 12 "traffic_repeater -i t:example.org:1234,u:my_socket\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" 16 "Supported interface types:\n" 17 "==========================\n" 19 "TCP interface ('t')\n" 20 "-------------------\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" 24 "Parameters when used as INPUT interface:\n" 27 "t:<hostname or ip>:<port>\n" 36 "If you skip `<hostname or ip>:`, IFC assumes you want to use localhost as the hostname.\n" 38 "Parameters when used as OUTPUT interface:\n" 41 "<port>:<max_num_of_clients>\n" 44 "Maximal number of connected clients (input interfaces) is optional (64 by default).\n" 46 "TLS interface ('T')\n" 47 "-------------------\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" 51 "Parameters when used as INPUT interface:\n" 54 "T:<hostname or ip>:<port>:<keyfile>:<certfile>:<CAfile>\n" 60 "T:<port>:<keyfile>:<certfile>:<CAfile>\n" 63 "If you skip `<hostname or ip>:`, IFC assumes you want to use localhost as a hostname.\n" 65 "Parameters when used as OUTPUT interface:\n" 67 "<port>:<max_num_of_clients>:<keyfile>:<certfile>:<CAfile>\n" 69 "Maximal number of connected clients (input interfaces) is optional (64 by default).\n" 71 "Parameters keyfile, certfile, CAfile expect a path to apropriate files in PEM format.\n" 73 "UNIX domain socket ('u')\n" 74 "------------------------\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" 78 "Parameters when used as INPUT interface:\n" 82 "Socket name can be any string usable as a file name.\n" 84 "Parameters when used as OUTPUT interface:\n" 86 "<socket_name>:<max_num_of_clients>\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" 92 "Blackhole interface ('b')\n" 93 "-------------------------\n" 95 "Can be used as OUTPUT interface only. Does nothing, everything sent to this interface is dropped. It has no parameters.\n" 98 "File interface ('f')\n" 99 "--------------------\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" 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" 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" 111 "Name of file (path to the file) must be specified.\n" 112 "Input file interface can also read from /dev/stdin.\n" 114 "Output interface:\n" 116 "<file_name>:<mode>:<time=>:<size=>\n" 118 "Name of file (path to the file) must be specified.\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" 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" 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" 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" 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" 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" 146 "When mode `a` is specified, the interface finds first non-existing file in which it writes data.\n" 148 "Assume we have already files \"data.trapcap\" and \"data.trapcap.00000\", the following command:\n" 150 "-i \"f:~/nemea/data.trapcap:a\"\n" 152 "checks for existing files and first captured data will be stored to file \"data.trapcap.00001\".\n" 154 "Output file interface can also write data to /dev/stdout and /dev/null, however mode `w` must be specified.\n" 156 "Common IFC parameters\n" 157 "=====================\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" 166 "* buffer (OUTPUT only) - buffering of data and sending in larger bulks (increases throughput)\n" 167 " * possible values: on, off\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" 173 "Example: `-i u:inputsocket:timeout=WAIT,u:outputsocket:timeout=500000:buffer=off:autoflush=off`\n" 179 "my_module with 1 input interface and 2 output interfaces:\n" 181 "./my_module -i \"t:localhost:12345,b:,t:23456:5\"\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" 185 "nfdump_reader module that reads nfdump file and drops records via Blackhole IFC type:\n" 187 "./modules/nfreader/nfdump_reader -i b: ./file.nfdump\n" const char * trap_help_ifcspec