nmsg 1.3.1
nmsg.h
Go to the documentation of this file.
1#ifndef NMSG_H
2#define NMSG_H
3
4/*
5 * Copyright (c) 2024 DomainTools LLC
6 * Copyright (c) 2008-2015 by Farsight Security, Inc.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include <netinet/in.h>
33#include <arpa/inet.h>
34#include <sys/socket.h>
35#include <sys/types.h>
36#include <stdarg.h>
37#include <stdbool.h>
38#include <stddef.h>
39#include <stdint.h>
40#include <time.h>
41
42#include <pcap.h>
43
44#include <nmsg/res.h>
45typedef enum nmsg_res nmsg_res;
46
47typedef struct nmsg_container * nmsg_container_t;
48typedef struct nmsg_fltmod * nmsg_fltmod_t;
49typedef struct nmsg_statsmod * nmsg_statsmod_t;
50typedef struct nmsg_input * nmsg_input_t;
51typedef struct nmsg_io * nmsg_io_t;
52typedef struct nmsg_message * nmsg_message_t;
53typedef struct nmsg_msgmod * nmsg_msgmod_t;
54typedef struct nmsg_output * nmsg_output_t;
55typedef struct nmsg_pcap * nmsg_pcap_t;
56typedef struct nmsg_pres * nmsg_pres_t;
57typedef struct nmsg_rate * nmsg_rate_t;
58typedef struct nmsg_random * nmsg_random_t;
59typedef struct nmsg_strbuf * nmsg_strbuf_t;
60typedef struct nmsg_zbuf * nmsg_zbuf_t;
61
66 unsigned id; /*%< ID number */
67 const char *name; /*%< Human readable name */
68};
69
80typedef void (*nmsg_cb_message)(nmsg_message_t msg, void *user);
81
96typedef nmsg_res (*nmsg_cb_message_read)(nmsg_message_t *msg, void *user);
97
98#include <nmsg/alias.h>
99#include <nmsg/asprintf.h>
100#include <nmsg/chalias.h>
101#include <nmsg/compat.h>
102#include <nmsg/constants.h>
103#include <nmsg/container.h>
104#include <nmsg/filter.h>
105#include <nmsg/fltmod.h>
106#include <nmsg/input.h>
107#include <nmsg/io.h>
108#include <nmsg/ipdg.h>
109#include <nmsg/message.h>
110#include <nmsg/msgmod.h>
111#include <nmsg/output.h>
112#include <nmsg/pcap_input.h>
113#include <nmsg/random.h>
114#include <nmsg/rate.h>
115#include <nmsg/statsmod.h>
116#include <nmsg/sock.h>
117#include <nmsg/strbuf.h>
118#include <nmsg/timespec.h>
119#include <nmsg/vendors.h>
120#include <nmsg/version.h>
121#include <nmsg/zbuf.h>
122
139#if __GNUC__ >= 4
140__attribute__ ((warn_unused_result))
141#endif
143
153void nmsg_set_autoclose(bool autoclose);
154
160void nmsg_set_debug(int debug);
161
166
170const char *nmsg_get_version(void);
171
178#ifdef __cplusplus
179}
180#endif
181
414#endif /* NMSG_H */
Nmsg payload operator and group aliasing.
Asprintf utility functions.
Nmsg channel aliases.
Nmsg constants.
Functions for marshalling NMSG containers.
Message filtering API.
Loading and calling external message filter modules.
Convert input streams to nmsg format.
Multi-threaded nmsg I/O processing.
IP datagram parsing functions.
Create, load, inspect, and manipulate message objects. Message objects are proxy objects that bind to...
Message modules.
const char * nmsg_get_version(void)
Retrieve the semantic library version as a string.
nmsg_res nmsg_init(void)
Initialize the libnmsg library.
void nmsg_set_debug(int debug)
Set debug level.
nmsg_res(* nmsg_cb_message_read)(nmsg_message_t *msg, void *user)
Callback function for generating nmsg messages.
Definition: nmsg.h:96
void nmsg_set_autoclose(bool autoclose)
Configure automatic close() behavior of nmsg inputs and outputs.
uint32_t nmsg_get_version_number(void)
Retrieve the semantic library version as a packed integer.
void(* nmsg_cb_message)(nmsg_message_t msg, void *user)
Callback function for processing nmsg messages.
Definition: nmsg.h:80
int nmsg_get_debug(void)
Retrieve the current debug level.
Write nmsg containers to output streams.
Reassembled IP datagram interface to libpcap.
Random number generator.
Rate-limiting.
Possible result codes for nmsg functions.
nmsg_res
nmsg result code
Definition: res.h:25
Socket utilities.
Loading and calling external statistics modules.
String buffers.
Generic ID to name map.
Definition: nmsg.h:65
const char * name
Human readable name.
Definition: nmsg.h:67
unsigned id
ID number.
Definition: nmsg.h:66
String buffer.
Definition: strbuf.h:28
Sleeping and getting the current time.
NMSG vendor ID values.
Compressed buffers.