/usr/include/parser.h is in liblognorm-dev 2.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | /*
* liblognorm - a fast samples-based log normalization library
* Copyright 2010-2015 by Rainer Gerhards and Adiscon GmbH.
*
* Modified by Pavel Levshin (pavel@levshin.spb.ru) in 2013
*
* This file is part of liblognorm.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* A copy of the LGPL v2.1 can be found in the file "COPYING" in this distribution.
*/
#ifndef LIBLOGNORM_PARSER_H_INCLUDED
#define LIBLOGNORM_PARSER_H_INCLUDED
#include "pdag.h"
/**
* Parser interface
* @param[in] str the to-be-parsed string
* @param[in] strLen length of the to-be-parsed string
* @param[in] offs an offset into the string
* @param[out] parsed bytes
* @param[out] ptr to json object containing parsed data (can be unused)
* if NULL on input, object is NOT persisted
* @return 0 on success, something else otherwise
*/
// TODO #warning check how to handle "value" - does it need to be set to NULL?
#define PARSERDEF_NO_DATA(parser) \
int ln_v2_parse##parser(npb_t *npb, size_t *offs, void *const, size_t *parsed, struct json_object **value);
#define PARSERDEF(parser) \
int ln_construct##parser(ln_ctx ctx, json_object *const json, void **pdata); \
int ln_v2_parse##parser(npb_t *npb, size_t *offs, void *const, size_t *parsed, struct json_object **value); \
void ln_destruct##parser(ln_ctx ctx, void *const pdata);
PARSERDEF_NO_DATA(RFC5424Date);
PARSERDEF_NO_DATA(RFC3164Date);
PARSERDEF_NO_DATA(Number);
PARSERDEF_NO_DATA(Float);
PARSERDEF(HexNumber);
PARSERDEF_NO_DATA(KernelTimestamp);
PARSERDEF_NO_DATA(Whitespace);
PARSERDEF_NO_DATA(Word);
PARSERDEF(StringTo);
PARSERDEF_NO_DATA(Alpha);
PARSERDEF(Literal);
PARSERDEF(CharTo);
PARSERDEF(CharSeparated);
PARSERDEF(Repeat);
PARSERDEF(String);
PARSERDEF_NO_DATA(Rest);
PARSERDEF_NO_DATA(OpQuotedString);
PARSERDEF_NO_DATA(QuotedString);
PARSERDEF_NO_DATA(ISODate);
PARSERDEF_NO_DATA(Time12hr);
PARSERDEF_NO_DATA(Time24hr);
PARSERDEF_NO_DATA(Duration);
PARSERDEF_NO_DATA(IPv4);
PARSERDEF_NO_DATA(IPv6);
PARSERDEF_NO_DATA(JSON);
PARSERDEF_NO_DATA(CEESyslog);
PARSERDEF_NO_DATA(v2IPTables);
PARSERDEF_NO_DATA(CiscoInterfaceSpec);
PARSERDEF_NO_DATA(MAC48);
PARSERDEF_NO_DATA(CEF);
PARSERDEF_NO_DATA(CheckpointLEA);
PARSERDEF_NO_DATA(NameValue);
#undef PARSERDEF_NO_DATA
/* utility functions */
int ln_combineData_Literal(void *const org, void *const add);
/* definitions for friends */
struct data_Repeat {
ln_pdag *parser;
ln_pdag *while_cond;
int permitMismatchInParser;
};
#endif /* #ifndef LIBLOGNORM_PARSER_H_INCLUDED */
|