nmsg 1.1.1
output.h
1/*
2 * Copyright (c) 2008-2019 by Farsight Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef NMSG_OUTPUT_H
18#define NMSG_OUTPUT_H
19
38typedef enum {
39 nmsg_output_type_stream,
40 nmsg_output_type_pres,
41 nmsg_output_type_callback,
42 nmsg_output_type_json,
43} nmsg_output_type;
44
57nmsg_output_t
58nmsg_output_open_file(int fd, size_t bufsz);
59
73nmsg_output_t
74nmsg_output_open_sock(int fd, size_t bufsz);
75
85nmsg_output_t
86nmsg_output_open_zmq(void *s, size_t bufsz);
87
117nmsg_output_t
118nmsg_output_open_zmq_endpoint(void *zmq_ctx, const char *ep, size_t bufsz);
119
127nmsg_output_t
128nmsg_output_open_pres(int fd);
129
158nmsg_output_t
159nmsg_output_open_json(int fd);
160
173nmsg_output_t
174nmsg_output_open_callback(nmsg_cb_message cb, void *user);
175
189nmsg_res
190nmsg_output_flush(nmsg_output_t output);
191
205nmsg_res
206nmsg_output_write(nmsg_output_t output, nmsg_message_t msg);
207
215nmsg_res
216nmsg_output_close(nmsg_output_t *output);
217
228void
229nmsg_output_set_buffered(nmsg_output_t output, bool buffered);
230
245void
246nmsg_output_set_filter_msgtype(nmsg_output_t output, unsigned vid, unsigned msgtype);
247
257nmsg_res
258nmsg_output_set_filter_msgtype_byname(nmsg_output_t output,
259 const char *vname, const char *mname);
260
271void
272nmsg_output_set_rate(nmsg_output_t output, nmsg_rate_t rate);
273
282void
283nmsg_output_set_endline(nmsg_output_t output, const char *endline);
284
295void
296nmsg_output_set_source(nmsg_output_t output, unsigned source);
297
308void
309nmsg_output_set_operator(nmsg_output_t output, unsigned operator_);
310
321void
322nmsg_output_set_group(nmsg_output_t output, unsigned group);
323
331void
332nmsg_output_set_zlibout(nmsg_output_t output, bool zlibout);
333
334#endif /* NMSG_OUTPUT_H */