2
* Copyright (c) 2012 Nagy, Attila <bra@fsn.hu>
3
* Copyright (c) 2012-2013 BalaBit IT Ltd, Budapest, Hungary
4
* Copyright (c) 2012-2013 Gergely Nagy <algernon@balabit.hu>
6
* This program is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 2 as published
8
* by the Free Software Foundation, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
* As an additional exemption you are allowed to compile & link against the
20
* OpenSSL libraries as published by the OpenSSL project. See the file
21
* COPYING for details.
27
#include "afamqp-parser.h"
33
#include "cfg-parser.h"
34
#include "cfg-grammar.h"
35
#include "afamqp-grammar.h"
37
#include "vptransform.h"
41
%name-prefix "afamqp_"
42
%lex-param {CfgLexer *lexer}
43
%parse-param {CfgLexer *lexer}
44
%parse-param {LogDriver **instance}
45
%parse-param {gpointer arg}
52
%token KW_EXCHANGE_DECLARE
53
%token KW_EXCHANGE_TYPE
62
: LL_CONTEXT_DESTINATION KW_AMQP
64
last_driver = *instance = afamqp_dd_new(configuration);
66
'(' afamqp_options ')' { YYACCEPT; }
70
: afamqp_option afamqp_options
75
: KW_HOST '(' string ')' { afamqp_dd_set_host(last_driver, $3); free($3); }
76
| KW_PORT '(' LL_NUMBER ')' { afamqp_dd_set_port(last_driver, $3); }
77
| KW_VHOST '(' string ')' { afamqp_dd_set_vhost(last_driver, $3); free($3); }
78
| KW_EXCHANGE '(' string ')' { afamqp_dd_set_exchange(last_driver, $3); free($3); }
79
| KW_EXCHANGE_DECLARE '(' yesno ')' { afamqp_dd_set_exchange_declare(last_driver, $3); }
80
| KW_EXCHANGE_TYPE '(' string ')' { afamqp_dd_set_exchange_type(last_driver, $3); free($3); }
81
| KW_ROUTING_KEY '(' string ')' { afamqp_dd_set_routing_key(last_driver, $3); free($3); }
82
| KW_BODY '(' string ')' { afamqp_dd_set_body(last_driver, $3); free($3); }
83
| KW_PERSISTENT '(' yesno ')' { afamqp_dd_set_persistent(last_driver, $3); }
84
| KW_USERNAME '(' string ')' { afamqp_dd_set_user(last_driver, $3); free($3); }
85
| KW_PASSWORD '(' string ')' { afamqp_dd_set_password(last_driver, $3); free($3); }
86
| value_pair_option { afamqp_dd_set_value_pairs(last_driver, $1); }
88
| { last_template_options = afamqp_dd_get_template_options(last_driver); } template_option