/* * Copyright (c) 2002, 2003, 2004 Niels Provos * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ %{ #include #include "config.h" #ifdef HAVE_SYS_TIME_H #include #endif #include #include #define _XOPEN_SOURCE /* glibc2 is stupid and needs this */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include "honeyd.h" #include "personality.h" #include "router.h" #include "plugins_config.h" #include "plugins.h" #include "template.h" #include "condition.h" #include "interface.h" #include "ethernet.h" #include "pfvar.h" #include "dhcpclient.h" #include "subsystem.h" #include "util.h" #ifdef HAVE_PYTHON #include "pyextend.h" #endif int hydlex(void); int hydparse(void); int hyderror(char *, ...); int hydwarn(char *, ...); int hydprintf(char *, ...); void *hyd_scan_string(char *); int hyd_delete_buffer(void *); #define yylex hydlex #define yyparse hydparse #define yy_scan_string hyd_scan_string #define yy_delete_buffer hyd_delete_buffer #define yyerror hyderror #define yywarn hydwarn #define yyprintf hydprintf #define yyin hydin extern int honeyd_verify_config; pf_osfp_t pfctl_get_fingerprint(const char *); struct action *honeyd_protocol(struct template *, int); void port_action_clone(struct action *, struct action *); static void dhcp_template(struct template *tmpl, char *interface, char *mac_addr); static struct evbuffer *buffer = NULL; int lineno; char *filename; int errors = 0; int curtype = -1; /* Lex sets it to SOCK_STREAM or _DGRAM */ %} %token CREATE ADD PORT BIND CLONE DOT BLOCK OPEN RESET DEFAULT SET ACTION %token PERSONALITY RANDOM ANNOTATE NO FINSCAN FRAGMENT DROP OLD NEW COLON %token PROXY UPTIME DROPRATE IN SYN UID GID ROUTE ENTRY LINK NET UNREACH %token SLASH LATENCY MS LOSS BANDWIDTH SUBSYSTEM OPTION TO SHARED NETWORK %token SPOOF FROM TEMPLATE %token TUNNEL TARPIT DYNAMIC USE IF OTHERWISE EQUAL SOURCE OS IP BETWEEN %token DELETE LIST ETHERNET DHCP ON MAXFDS RESTART DEBUG %token DASH TIME INTERNAL %token STRING %token CMDSTRING %token IPSTRING %token NUMBER %token PROTO %token FLOAT %type ipaddr %type ipnet %type ipaddrplusport %type action %type template %type personality %type finscan; %type fragment; %type rate; %type randomearlydrop; %type latency; %type bandwidth; %type packetloss; %type shared; %type restart; %type flags; %type condition; %type timecondition; %type