diff --git a/.gitmodules b/.gitmodules index 7080850de55..cb22d209a0c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -124,3 +124,6 @@ [submodule "libraries/cmake/source/augeas/gnulib/src"] path = libraries/cmake/source/augeas/gnulib/src url = https://github.com/osquery/third-party-gnulib +[submodule "libraries/cmake/source/libpcap/src"] + path = libraries/cmake/source/libpcap/src + url = https://github.com/the-tcpdump-group/libpcap diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c6c69fb5df..7d4ca413f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,7 @@ function(importLibraries) "Linux,Darwin,Windows:openssl" "Linux,Darwin,Windows:aws-sdk-cpp" "Linux,Darwin,Windows:icu" + "Linux:libpcap" ) foreach(python_module ${python_module_list}) diff --git a/libraries/cmake/source/libpcap/CMakeLists.txt b/libraries/cmake/source/libpcap/CMakeLists.txt new file mode 100644 index 00000000000..848d3a2af6f --- /dev/null +++ b/libraries/cmake/source/libpcap/CMakeLists.txt @@ -0,0 +1,47 @@ +# Copyright (c) 2014-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed in accordance with the terms specified in +# the LICENSE file found in the root directory of this source tree. + +function(libPcapMain) + set(library_root "${CMAKE_CURRENT_SOURCE_DIR}/src") + add_library(thirdparty_libpcap + "${library_root}/bpf_dump.c" + "${library_root}/etherent.c" + "${library_root}/fmtutils.c" + "${library_root}/pcap-common.c" + "${library_root}/pcap-linux.c" + "${library_root}/sf-pcapng.c" + "${library_root}/bpf_filter.c" + "${library_root}/fad-getad.c" + "${library_root}/gencode.c" + "${library_root}/pcap-netfilter-linux.c" + "${library_root}/rpcap-protocol.c" + "${library_root}/sockutils.c" + "${library_root}/bpf_image.c" + "${library_root}/fad-gifc.c" + "${library_root}/nametoaddr.c" + "${library_root}/pcap-null.c" + "${library_root}/savefile.c" + "${library_root}/optimize.c" + "${library_root}/pcap.c" + "${library_root}/sf-pcap.c" + "${library_root}/../generated/scanner.c" + "${library_root}/../generated/grammar.c" + + ) + target_compile_definitions(thirdparty_libpcap PRIVATE + HAVE_STRLCPY + ) + target_include_directories(thirdparty_libpcap PUBLIC + $<1:${library_root}> + "${CMAKE_CURRENT_SOURCE_DIR}/generated" + ) + target_compile_options(thirdparty_libpcap PRIVATE + -include "${CMAKE_CURRENT_SOURCE_DIR}/config/linux/config.h" + ) + +endfunction() + +libPcapMain() diff --git a/libraries/cmake/source/libpcap/config/linux/config.h b/libraries/cmake/source/libpcap/config/linux/config.h new file mode 100644 index 00000000000..3e6b12f6e15 --- /dev/null +++ b/libraries/cmake/source/libpcap/config/linux/config.h @@ -0,0 +1,387 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if arpa/inet.h declares `ether_hostton' */ +/* #undef ARPA_INET_H_DECLARES_ETHER_HOSTTON */ + +/* Enable optimizer debugging */ +/* #undef BDEBUG */ + +/* Define to 1 if remote packet capture is to be supported */ +/* #undef ENABLE_REMOTE */ + +/* define if we have the AIX getnetbyname_r() */ +/* #undef HAVE_AIX_GETNETBYNAME_R */ + +/* define if we have the AIX getprotobyname_r() */ +/* #undef HAVE_AIX_GETPROTOBYNAME_R */ + +/* Define to 1 if you have the `asprintf' function. */ +#define HAVE_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DAGAPI_H */ + +/* define if you have the DAG API */ +/* #undef HAVE_DAG_API */ + +/* define if you have dag_get_erf_types() */ +/* #undef HAVE_DAG_GET_ERF_TYPES */ + +/* define if you have dag_get_stream_erf_types() */ +/* #undef HAVE_DAG_GET_STREAM_ERF_TYPES */ + +/* define if you have large streams capable DAG API */ +/* #undef HAVE_DAG_LARGE_STREAMS_API */ + +/* define if you have vdag_set_device_info() */ +/* #undef HAVE_DAG_VDAG */ + +/* Define to 1 if you have the declaration of `ether_hostton' */ +#define HAVE_DECL_ETHER_HOSTTON 1 + +/* Define to 1 if `dl_module_id_1' is a member of `dl_hp_ppa_info_t'. */ +/* #undef HAVE_DL_HP_PPA_INFO_T_DL_MODULE_ID_1 */ + +/* Define to 1 if the system has the type `dl_passive_req_t'. */ +/* #undef HAVE_DL_PASSIVE_REQ_T */ + +/* Define to 1 if you have the `ether_hostton' function. */ +#define HAVE_ETHER_HOSTTON 1 + +/* Define to 1 if you have the `ffs' function. */ +#define HAVE_FFS 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the `getspnam' function. */ +/* #undef HAVE_GETSPNAM */ + +/* Define to 1 if you have a GNU-style `strerror_r' function. */ +#define HAVE_GNU_STRERROR_R /**/ + +/* on HP-UX 10.20 or later */ +/* #undef HAVE_HPUX10_20_OR_LATER */ + +/* on HP-UX 9.x */ +/* #undef HAVE_HPUX9 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `dag' library (-ldag). */ +/* #undef HAVE_LIBDAG */ + +/* if libdlpi exists */ +/* #undef HAVE_LIBDLPI */ + +/* if libnl exists */ +/* #undef HAVE_LIBNL */ + +/* if libnl exists and is version 2.x */ +/* #undef HAVE_LIBNL_2_x */ + +/* if libnl exists and is version 3.x */ +/* #undef HAVE_LIBNL_3_x */ + +/* libnl has NLE_FAILURE */ +/* #undef HAVE_LIBNL_NLE */ + +/* libnl has new-style socket api */ +/* #undef HAVE_LIBNL_SOCKETS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_COMPILER_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_ETHTOOL_H 1 + +/* define if we have the Linux getnetbyname_r() */ +#define HAVE_LINUX_GETNETBYNAME_R 1 + +/* define if we have the Linux getprotobyname_r() */ +#define HAVE_LINUX_GETPROTOBYNAME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_IF_BONDING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_NET_TSTAMP_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SOCKIOS_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_LINUX_USBDEVICE_FS_H 1*/ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_WIRELESS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETPACKET_PACKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_BPF_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_ENET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF_MEDIA_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_NIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_PFILT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_PFVAR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_RAW_H */ + +/* if there's an os_proto.h for this platform, to use additional prototypes */ +/* #undef HAVE_OS_PROTO_H */ + +/* define if net/pfvar.h defines PF_NAT through PF_NORDR */ +/* #undef HAVE_PF_NAT_THROUGH_PF_NORDR */ + +/* Define to 1 if you have a POSIX-style `strerror_r' function. */ +/* #undef HAVE_POSIX_STRERROR_R */ + +/* define if you have the Septel API */ +/* #undef HAVE_SEPTEL_API */ + +/* define if you have the Myricom SNF API */ +/* #undef HAVE_SNF_API */ + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if the system has the type `socklen_t'. */ +#define HAVE_SOCKLEN_T 1 + +/* On solaris */ +/* #undef HAVE_SOLARIS */ + +/* define if we have the Solaris/IRIX getnetbyname_r() */ +/* #undef HAVE_SOLARIS_IRIX_GETNETBYNAME_R */ + +/* define if we have the Solaris/IRIX getprotobyname_r() */ +/* #undef HAVE_SOLARIS_IRIX_GETPROTOBYNAME_R */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strerror_s' function. */ +/* #undef HAVE_STRERROR_S */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +/* #undef HAVE_STRLCAT */ + +/* Define to 1 if you have the `strlcpy' function. */ +/* #undef HAVE_STRLCPY */ + +/* Define to 1 if you have the `strtok_r' function. */ +#define HAVE_STRTOK_R 1 + +/* Define to 1 if the system has the type `struct BPF_TIMEVAL'. */ +/* #undef HAVE_STRUCT_BPF_TIMEVAL */ + +/* Define to 1 if the system has the type `struct ether_addr'. */ +/* #undef HAVE_STRUCT_ETHER_ADDR */ + +/* Define to 1 if `msg_control' is a member of `struct msghdr'. */ +/* #undef HAVE_STRUCT_MSGHDR_MSG_CONTROL */ + +/* Define to 1 if `msg_flags' is a member of `struct msghdr'. */ +/* #undef HAVE_STRUCT_MSGHDR_MSG_FLAGS */ + +/* Define to 1 if `hci_channel' is a member of `struct sockaddr_hci'. */ +/* #undef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL */ + +/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */ +/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */ + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if `tp_vlan_tci' is a member of `struct tpacket_auxdata'. */ +#define HAVE_STRUCT_TPACKET_AUXDATA_TP_VLAN_TCI 1 + +/* Define to 1 if the system has the type `struct tpacket_stats'. */ +#define HAVE_STRUCT_TPACKET_STATS 1 + +/* Define to 1 if `bRequestType' is a member of `struct + usbdevfs_ctrltransfer'. */ +/*#define HAVE_STRUCT_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE 1*/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BUFMOD_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DLPI_EXT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DLPI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IOCCOM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_NET_NIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* define if you have the TurboCap API */ +/* #undef HAVE_TC_API */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `vsyslog' function. */ +#define HAVE_VSYSLOG 1 + +/* IPv6 */ +#define INET6 1 + +/* if unaligned access fails */ +/* #undef LBL_ALIGN */ + +/* path for device for USB sniffing */ +/*#define LINUX_USB_MON_DEV "/dev/usbmon"*/ + +/* Define to 1 if netinet/ether.h declares `ether_hostton' */ +#define NETINET_ETHER_H_DECLARES_ETHER_HOSTTON /**/ + +/* Define to 1 if netinet/if_ether.h declares `ether_hostton' */ +/* #undef NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON */ + +/* Define to 1 if net/ethernet.h declares `ether_hostton' */ +/* #undef NET_ETHERNET_H_DECLARES_ETHER_HOSTTON */ + +/* do not use protochain */ +/* #undef NO_PROTOCHAIN */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pcap" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pcap 1.9.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pcap" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.9.1" + +/* target host supports Bluetooth sniffing */ +/* #undef PCAP_SUPPORT_BT */ + +/* target host supports Bluetooth Monitor */ +/* #undef PCAP_SUPPORT_BT_MONITOR */ + +/* support D-Bus sniffing */ +/* #undef PCAP_SUPPORT_DBUS */ + +/* target host supports netfilter sniffing */ +#define PCAP_SUPPORT_NETFILTER 1 + +/* target host supports netmap */ +/* #undef PCAP_SUPPORT_NETMAP */ + +/* use packet ring capture support on Linux if available */ +#define PCAP_SUPPORT_PACKET_RING 1 + +/* target host supports RDMA sniffing */ +/* #undef PCAP_SUPPORT_RDMASNIFF */ + +/* target host supports USB sniffing */ +/*#define PCAP_SUPPORT_USB 1*/ + +/* include ACN support */ +/* #undef SITA */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if strings.h declares `ffs' */ +#define STRINGS_H_DECLARES_FFS /**/ + +/* Define to 1 if sys/ethernet.h declares `ether_hostton' */ +/* #undef SYS_ETHERNET_H_DECLARES_ETHER_HOSTTON */ + +/* Enable parser debugging */ +/* #undef YYDEBUG */ + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* define on AIX to get certain functions */ +/* #undef _SUN */ + +/* to handle Ultrix compilers that don't support const in prototypes */ +/* #undef const */ + +/* Define as token for inline if inlining supported */ +#define inline inline + +/* on sinix */ +/* #undef sinix */ diff --git a/libraries/cmake/source/libpcap/generated/grammar.c b/libraries/cmake/source/libpcap/generated/grammar.c new file mode 100644 index 00000000000..35a5ab02069 --- /dev/null +++ b/libraries/cmake/source/libpcap/generated/grammar.c @@ -0,0 +1,3683 @@ +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + 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 3 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.0.4" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + +/* Substitute the variable and function names. */ +#define yyparse pcap_parse +#define yylex pcap_lex +#define yyerror pcap_error +#define yydebug pcap_debug +#define yynerrs pcap_nerrs + + +/* Copy the first part of user declarations. */ +#line 26 "grammar.y" /* yacc.c:339 */ + +/* + * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code distributions + * retain the above copyright notice and this paragraph in its entirety, (2) + * distributions including binary code include the above copyright notice and + * this paragraph in its entirety in the documentation or other materials + * provided with the distribution, and (3) all advertising materials mentioning + * features or use of this software display the following acknowledgement: + * ``This product includes software developed by the University of California, + * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of + * the University nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#ifndef _WIN32 +#include +#include + +#if __STDC__ +struct mbuf; +struct rtentry; +#endif + +#include +#include +#endif /* _WIN32 */ + +#include + +#include "diag-control.h" + +#include "pcap-int.h" + +#include "gencode.h" +#include "grammar.h" +#include "scanner.h" + +#ifdef HAVE_NET_PFVAR_H +#include +#include +#include +#endif +#include "llc.h" +#include "ieee80211.h" +#include + +#ifdef HAVE_OS_PROTO_H +#include "os-proto.h" +#endif + +#ifdef YYBYACC +/* + * Both Berkeley YACC and Bison define yydebug (under whatever name + * it has) as a global, but Bison does so only if YYDEBUG is defined. + * Berkeley YACC define it even if YYDEBUG isn't defined; declare it + * here to suppress a warning. + */ +#if !defined(YYDEBUG) +extern int yydebug; +#endif + +/* + * In Berkeley YACC, yynerrs (under whatever name it has) is global, + * even if it's building a reentrant parser. In Bison, it's local + * in reentrant parsers. + * + * Declare it to squelch a warning. + */ +extern int yynerrs; +#endif + +#define QSET(q, p, d, a) (q).proto = (unsigned char)(p),\ + (q).dir = (unsigned char)(d),\ + (q).addr = (unsigned char)(a) + +struct tok { + int v; /* value */ + const char *s; /* string */ +}; + +static const struct tok ieee80211_types[] = { + { IEEE80211_FC0_TYPE_DATA, "data" }, + { IEEE80211_FC0_TYPE_MGT, "mgt" }, + { IEEE80211_FC0_TYPE_MGT, "management" }, + { IEEE80211_FC0_TYPE_CTL, "ctl" }, + { IEEE80211_FC0_TYPE_CTL, "control" }, + { 0, NULL } +}; +static const struct tok ieee80211_mgt_subtypes[] = { + { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assocreq" }, + { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assoc-req" }, + { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assocresp" }, + { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assoc-resp" }, + { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassocreq" }, + { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassoc-req" }, + { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassocresp" }, + { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassoc-resp" }, + { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probereq" }, + { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probe-req" }, + { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "proberesp" }, + { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "probe-resp" }, + { IEEE80211_FC0_SUBTYPE_BEACON, "beacon" }, + { IEEE80211_FC0_SUBTYPE_ATIM, "atim" }, + { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassoc" }, + { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassociation" }, + { IEEE80211_FC0_SUBTYPE_AUTH, "auth" }, + { IEEE80211_FC0_SUBTYPE_AUTH, "authentication" }, + { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauth" }, + { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauthentication" }, + { 0, NULL } +}; +static const struct tok ieee80211_ctl_subtypes[] = { + { IEEE80211_FC0_SUBTYPE_PS_POLL, "ps-poll" }, + { IEEE80211_FC0_SUBTYPE_RTS, "rts" }, + { IEEE80211_FC0_SUBTYPE_CTS, "cts" }, + { IEEE80211_FC0_SUBTYPE_ACK, "ack" }, + { IEEE80211_FC0_SUBTYPE_CF_END, "cf-end" }, + { IEEE80211_FC0_SUBTYPE_CF_END_ACK, "cf-end-ack" }, + { 0, NULL } +}; +static const struct tok ieee80211_data_subtypes[] = { + { IEEE80211_FC0_SUBTYPE_DATA, "data" }, + { IEEE80211_FC0_SUBTYPE_CF_ACK, "data-cf-ack" }, + { IEEE80211_FC0_SUBTYPE_CF_POLL, "data-cf-poll" }, + { IEEE80211_FC0_SUBTYPE_CF_ACPL, "data-cf-ack-poll" }, + { IEEE80211_FC0_SUBTYPE_NODATA, "null" }, + { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACK, "cf-ack" }, + { IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "cf-poll" }, + { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "cf-ack-poll" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_DATA, "qos-data" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACK, "qos-data-cf-ack" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_POLL, "qos-data-cf-poll" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACPL, "qos-data-cf-ack-poll" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA, "qos" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "qos-cf-poll" }, + { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "qos-cf-ack-poll" }, + { 0, NULL } +}; +static const struct tok llc_s_subtypes[] = { + { LLC_RR, "rr" }, + { LLC_RNR, "rnr" }, + { LLC_REJ, "rej" }, + { 0, NULL } +}; +static const struct tok llc_u_subtypes[] = { + { LLC_UI, "ui" }, + { LLC_UA, "ua" }, + { LLC_DISC, "disc" }, + { LLC_DM, "dm" }, + { LLC_SABME, "sabme" }, + { LLC_TEST, "test" }, + { LLC_XID, "xid" }, + { LLC_FRMR, "frmr" }, + { 0, NULL } +}; +struct type2tok { + int type; + const struct tok *tok; +}; +static const struct type2tok ieee80211_type_subtypes[] = { + { IEEE80211_FC0_TYPE_MGT, ieee80211_mgt_subtypes }, + { IEEE80211_FC0_TYPE_CTL, ieee80211_ctl_subtypes }, + { IEEE80211_FC0_TYPE_DATA, ieee80211_data_subtypes }, + { 0, NULL } +}; + +static int +str2tok(const char *str, const struct tok *toks) +{ + int i; + + for (i = 0; toks[i].s != NULL; i++) { + if (pcap_strcasecmp(toks[i].s, str) == 0) + return (toks[i].v); + } + return (-1); +} + +static const struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; + +static void +yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg) +{ + bpf_set_error(cstate, "can't parse filter expression: %s", msg); +} + +#ifdef HAVE_NET_PFVAR_H +static int +pfreason_to_num(compiler_state_t *cstate, const char *reason) +{ + const char *reasons[] = PFRES_NAMES; + int i; + + for (i = 0; reasons[i]; i++) { + if (pcap_strcasecmp(reason, reasons[i]) == 0) + return (i); + } + bpf_set_error(cstate, "unknown PF reason"); + return (-1); +} + +static int +pfaction_to_num(compiler_state_t *cstate, const char *action) +{ + if (pcap_strcasecmp(action, "pass") == 0 || + pcap_strcasecmp(action, "accept") == 0) + return (PF_PASS); + else if (pcap_strcasecmp(action, "drop") == 0 || + pcap_strcasecmp(action, "block") == 0) + return (PF_DROP); +#if HAVE_PF_NAT_THROUGH_PF_NORDR + else if (pcap_strcasecmp(action, "rdr") == 0) + return (PF_RDR); + else if (pcap_strcasecmp(action, "nat") == 0) + return (PF_NAT); + else if (pcap_strcasecmp(action, "binat") == 0) + return (PF_BINAT); + else if (pcap_strcasecmp(action, "nordr") == 0) + return (PF_NORDR); +#endif + else { + bpf_set_error(cstate, "unknown PF action"); + return (-1); + } +} +#else /* !HAVE_NET_PFVAR_H */ +static int +pfreason_to_num(compiler_state_t *cstate, const char *reason _U_) +{ + bpf_set_error(cstate, "libpcap was compiled on a machine without pf support"); + return (-1); +} + +static int +pfaction_to_num(compiler_state_t *cstate, const char *action _U_) +{ + bpf_set_error(cstate, "libpcap was compiled on a machine without pf support"); + return (-1); +} +#endif /* HAVE_NET_PFVAR_H */ + +/* + * For calls that might return an "an error occurred" value. + */ +#define CHECK_INT_VAL(val) if (val == -1) YYABORT +#define CHECK_PTR_VAL(val) if (val == NULL) YYABORT + +DIAG_OFF_BISON_BYACC + +#line 337 "grammar.c" /* yacc.c:339 */ + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "grammar.h". */ +#ifndef YY_PCAP_GRAMMAR_H_INCLUDED +# define YY_PCAP_GRAMMAR_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int pcap_debug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + DST = 258, + SRC = 259, + HOST = 260, + GATEWAY = 261, + NET = 262, + NETMASK = 263, + PORT = 264, + PORTRANGE = 265, + LESS = 266, + GREATER = 267, + PROTO = 268, + PROTOCHAIN = 269, + CBYTE = 270, + ARP = 271, + RARP = 272, + IP = 273, + SCTP = 274, + TCP = 275, + UDP = 276, + ICMP = 277, + IGMP = 278, + IGRP = 279, + PIM = 280, + VRRP = 281, + CARP = 282, + ATALK = 283, + AARP = 284, + DECNET = 285, + LAT = 286, + SCA = 287, + MOPRC = 288, + MOPDL = 289, + TK_BROADCAST = 290, + TK_MULTICAST = 291, + NUM = 292, + INBOUND = 293, + OUTBOUND = 294, + PF_IFNAME = 295, + PF_RSET = 296, + PF_RNR = 297, + PF_SRNR = 298, + PF_REASON = 299, + PF_ACTION = 300, + TYPE = 301, + SUBTYPE = 302, + DIR = 303, + ADDR1 = 304, + ADDR2 = 305, + ADDR3 = 306, + ADDR4 = 307, + RA = 308, + TA = 309, + LINK = 310, + GEQ = 311, + LEQ = 312, + NEQ = 313, + ID = 314, + EID = 315, + HID = 316, + HID6 = 317, + AID = 318, + LSH = 319, + RSH = 320, + LEN = 321, + IPV6 = 322, + ICMPV6 = 323, + AH = 324, + ESP = 325, + VLAN = 326, + MPLS = 327, + PPPOED = 328, + PPPOES = 329, + GENEVE = 330, + ISO = 331, + ESIS = 332, + CLNP = 333, + ISIS = 334, + L1 = 335, + L2 = 336, + IIH = 337, + LSP = 338, + SNP = 339, + CSNP = 340, + PSNP = 341, + STP = 342, + IPX = 343, + NETBEUI = 344, + LANE = 345, + LLC = 346, + METAC = 347, + BCC = 348, + SC = 349, + ILMIC = 350, + OAMF4EC = 351, + OAMF4SC = 352, + OAM = 353, + OAMF4 = 354, + CONNECTMSG = 355, + METACONNECT = 356, + VPI = 357, + VCI = 358, + RADIO = 359, + FISU = 360, + LSSU = 361, + MSU = 362, + HFISU = 363, + HLSSU = 364, + HMSU = 365, + SIO = 366, + OPC = 367, + DPC = 368, + SLS = 369, + HSIO = 370, + HOPC = 371, + HDPC = 372, + HSLS = 373, + LEX_ERROR = 374, + OR = 375, + AND = 376, + UMINUS = 377 + }; +#endif +/* Tokens. */ +#define DST 258 +#define SRC 259 +#define HOST 260 +#define GATEWAY 261 +#define NET 262 +#define NETMASK 263 +#define PORT 264 +#define PORTRANGE 265 +#define LESS 266 +#define GREATER 267 +#define PROTO 268 +#define PROTOCHAIN 269 +#define CBYTE 270 +#define ARP 271 +#define RARP 272 +#define IP 273 +#define SCTP 274 +#define TCP 275 +#define UDP 276 +#define ICMP 277 +#define IGMP 278 +#define IGRP 279 +#define PIM 280 +#define VRRP 281 +#define CARP 282 +#define ATALK 283 +#define AARP 284 +#define DECNET 285 +#define LAT 286 +#define SCA 287 +#define MOPRC 288 +#define MOPDL 289 +#define TK_BROADCAST 290 +#define TK_MULTICAST 291 +#define NUM 292 +#define INBOUND 293 +#define OUTBOUND 294 +#define PF_IFNAME 295 +#define PF_RSET 296 +#define PF_RNR 297 +#define PF_SRNR 298 +#define PF_REASON 299 +#define PF_ACTION 300 +#define TYPE 301 +#define SUBTYPE 302 +#define DIR 303 +#define ADDR1 304 +#define ADDR2 305 +#define ADDR3 306 +#define ADDR4 307 +#define RA 308 +#define TA 309 +#define LINK 310 +#define GEQ 311 +#define LEQ 312 +#define NEQ 313 +#define ID 314 +#define EID 315 +#define HID 316 +#define HID6 317 +#define AID 318 +#define LSH 319 +#define RSH 320 +#define LEN 321 +#define IPV6 322 +#define ICMPV6 323 +#define AH 324 +#define ESP 325 +#define VLAN 326 +#define MPLS 327 +#define PPPOED 328 +#define PPPOES 329 +#define GENEVE 330 +#define ISO 331 +#define ESIS 332 +#define CLNP 333 +#define ISIS 334 +#define L1 335 +#define L2 336 +#define IIH 337 +#define LSP 338 +#define SNP 339 +#define CSNP 340 +#define PSNP 341 +#define STP 342 +#define IPX 343 +#define NETBEUI 344 +#define LANE 345 +#define LLC 346 +#define METAC 347 +#define BCC 348 +#define SC 349 +#define ILMIC 350 +#define OAMF4EC 351 +#define OAMF4SC 352 +#define OAM 353 +#define OAMF4 354 +#define CONNECTMSG 355 +#define METACONNECT 356 +#define VPI 357 +#define VCI 358 +#define RADIO 359 +#define FISU 360 +#define LSSU 361 +#define MSU 362 +#define HFISU 363 +#define HLSSU 364 +#define HMSU 365 +#define SIO 366 +#define OPC 367 +#define DPC 368 +#define SLS 369 +#define HSIO 370 +#define HOPC 371 +#define HDPC 372 +#define HSLS 373 +#define LEX_ERROR 374 +#define OR 375 +#define AND 376 +#define UMINUS 377 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 291 "grammar.y" /* yacc.c:355 */ + + int i; + bpf_u_int32 h; + char *s; + struct stmt *stmt; + struct arth *a; + struct { + struct qual q; + int atmfieldtype; + int mtp3fieldtype; + struct block *b; + } blk; + struct block *rblk; + +#line 636 "grammar.c" /* yacc.c:355 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +int pcap_parse (void *yyscanner, compiler_state_t *cstate); + +#endif /* !YY_PCAP_GRAMMAR_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 652 "grammar.c" /* yacc.c:358 */ + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 775 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 140 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 47 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 220 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 294 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 377 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 122, 2, 2, 2, 138, 124, 2, + 131, 130, 127, 125, 2, 126, 2, 128, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 137, 2, + 134, 133, 132, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 135, 2, 136, 139, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 123, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 129 +}; + +#if YYDEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 362, 362, 366, 368, 370, 371, 372, 373, 374, + 376, 378, 380, 381, 383, 385, 386, 388, 390, 409, + 420, 431, 432, 433, 435, 437, 439, 440, 441, 443, + 445, 447, 448, 450, 451, 452, 453, 454, 462, 464, + 465, 466, 467, 469, 471, 472, 473, 474, 475, 476, + 479, 480, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 497, 498, 499, 500, 503, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, + 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 566, 567, 568, + 569, 570, 571, 574, 579, 582, 586, 589, 590, 599, + 600, 623, 640, 641, 665, 668, 669, 685, 686, 689, + 692, 693, 694, 696, 697, 698, 700, 701, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 719, 720, 721, 722, 723, 725, 726, + 728, 729, 730, 731, 732, 733, 734, 736, 737, 738, + 739, 742, 743, 745, 746, 747, 748, 750, 757, 758, + 761, 762, 763, 764, 765, 766, 769, 770, 771, 772, + 773, 774, 775, 776, 778, 779, 780, 781, 783, 796, + 797 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "DST", "SRC", "HOST", "GATEWAY", "NET", + "NETMASK", "PORT", "PORTRANGE", "LESS", "GREATER", "PROTO", "PROTOCHAIN", + "CBYTE", "ARP", "RARP", "IP", "SCTP", "TCP", "UDP", "ICMP", "IGMP", + "IGRP", "PIM", "VRRP", "CARP", "ATALK", "AARP", "DECNET", "LAT", "SCA", + "MOPRC", "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND", + "OUTBOUND", "PF_IFNAME", "PF_RSET", "PF_RNR", "PF_SRNR", "PF_REASON", + "PF_ACTION", "TYPE", "SUBTYPE", "DIR", "ADDR1", "ADDR2", "ADDR3", + "ADDR4", "RA", "TA", "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID", + "HID6", "AID", "LSH", "RSH", "LEN", "IPV6", "ICMPV6", "AH", "ESP", + "VLAN", "MPLS", "PPPOED", "PPPOES", "GENEVE", "ISO", "ESIS", "CLNP", + "ISIS", "L1", "L2", "IIH", "LSP", "SNP", "CSNP", "PSNP", "STP", "IPX", + "NETBEUI", "LANE", "LLC", "METAC", "BCC", "SC", "ILMIC", "OAMF4EC", + "OAMF4SC", "OAM", "OAMF4", "CONNECTMSG", "METACONNECT", "VPI", "VCI", + "RADIO", "FISU", "LSSU", "MSU", "HFISU", "HLSSU", "HMSU", "SIO", "OPC", + "DPC", "SLS", "HSIO", "HOPC", "HDPC", "HSLS", "LEX_ERROR", "OR", "AND", + "'!'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS", "')'", "'('", + "'>'", "'='", "'<'", "'['", "']'", "':'", "'%'", "'^'", "$accept", + "prog", "null", "expr", "and", "or", "id", "nid", "not", "paren", "pid", + "qid", "term", "head", "rterm", "pqual", "dqual", "aqual", "ndaqual", + "pname", "other", "pfvar", "p80211", "type", "subtype", "type_subtype", + "pllc", "dir", "reason", "action", "relop", "irelop", "arth", "narth", + "byteop", "pnum", "atmtype", "atmmultitype", "atmfield", "atmvalue", + "atmfieldvalue", "atmlistvalue", "mtp2type", "mtp3field", "mtp3value", + "mtp3fieldvalue", "mtp3listvalue", YY_NULLPTR +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 33, 124, 38, 43, 45, 42, 47, 377, + 41, 40, 62, 61, 60, 91, 93, 58, 37, 94 +}; +# endif + +#define YYPACT_NINF -216 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-216))) + +#define YYTABLE_NINF -42 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + -216, 32, 257, -216, -1, 12, 28, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, 25, + 37, 31, 43, -25, 48, -216, -216, -216, -216, -216, + -216, -36, -36, -216, -36, -36, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -24, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + 607, -216, 54, 491, 491, -216, -34, -216, 721, 2, + -216, -216, -216, 105, -216, -216, -216, -216, 17, -216, + 21, -216, -216, 33, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -36, -216, -216, -216, -216, -216, -216, + 607, 6, 38, -216, -216, 374, 374, -216, -100, -20, + 29, -216, -216, 11, 8, -216, -216, -216, -34, -34, + -216, 60, 65, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -6, 109, 1, -216, -216, -216, -216, -216, + -216, 80, -216, -216, -216, 607, -216, -216, -216, 607, + 607, 607, 607, 607, 607, 607, 607, -216, -216, -216, + 607, 607, 607, 607, -216, 127, 135, 147, -216, -216, + -216, 156, 157, 158, -216, -216, -216, -216, -216, -216, + -216, 159, 29, 181, -216, 374, 374, -216, 10, -216, + -216, -216, -216, -216, 136, 161, 162, -216, -216, 74, + 54, 29, 201, 202, 204, 205, -216, -216, 163, -216, + -216, -216, -216, -216, -216, 64, -56, -56, 578, 582, + -77, -77, 38, 38, 181, 181, 181, 181, -216, -97, + -216, -216, -216, -83, -216, -216, -216, -54, -216, -216, + -216, -216, -34, -34, -216, -216, -216, -216, 4, -216, + 172, -216, 127, -216, 156, -216, -216, -216, -216, -216, + 75, -216, -216, -216 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 4, 0, 51, 1, 0, 0, 0, 71, 72, 70, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 88, 87, 178, 113, 114, 0, + 0, 0, 0, 0, 0, 69, 172, 89, 90, 91, + 92, 116, 118, 119, 121, 123, 93, 94, 103, 95, + 96, 97, 98, 99, 100, 102, 101, 104, 105, 106, + 180, 142, 181, 182, 185, 186, 183, 184, 187, 188, + 189, 190, 191, 192, 107, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 24, + 0, 25, 2, 51, 51, 5, 0, 31, 0, 50, + 44, 124, 126, 0, 157, 156, 45, 46, 0, 48, + 0, 110, 111, 0, 127, 128, 129, 130, 147, 148, + 131, 149, 132, 0, 115, 117, 120, 122, 144, 143, + 0, 0, 170, 11, 10, 51, 51, 32, 0, 157, + 156, 15, 21, 18, 20, 22, 39, 12, 0, 0, + 13, 53, 52, 64, 68, 65, 66, 67, 36, 37, + 108, 109, 0, 0, 0, 58, 59, 60, 61, 62, + 63, 34, 35, 38, 125, 0, 151, 153, 155, 0, + 0, 0, 0, 0, 0, 0, 0, 150, 152, 154, + 0, 0, 0, 0, 197, 0, 0, 0, 47, 193, + 218, 0, 0, 0, 49, 214, 174, 173, 176, 177, + 175, 0, 0, 0, 7, 51, 51, 6, 156, 9, + 8, 40, 171, 179, 0, 0, 0, 23, 26, 30, + 0, 29, 0, 0, 0, 0, 137, 138, 134, 141, + 135, 145, 146, 136, 33, 0, 168, 169, 166, 165, + 160, 161, 162, 163, 164, 167, 42, 43, 198, 0, + 194, 195, 219, 0, 215, 216, 112, 156, 17, 16, + 19, 14, 0, 0, 55, 57, 54, 56, 0, 158, + 0, 196, 0, 217, 0, 27, 28, 139, 140, 133, + 0, 199, 220, 159 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -216, -216, -216, 210, -15, -215, -90, -135, 7, -2, + -216, -216, -80, -216, -216, -216, -216, 45, -216, 9, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + 50, 63, -66, -78, -216, -37, -216, -216, -216, -216, + -178, -216, -216, -216, -216, -179, -216 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 2, 138, 135, 136, 227, 147, 148, 130, + 229, 230, 95, 96, 97, 98, 171, 172, 173, 131, + 100, 101, 174, 238, 289, 240, 102, 243, 120, 122, + 192, 193, 103, 104, 211, 105, 106, 107, 108, 198, + 199, 259, 109, 110, 204, 205, 263 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 94, 26, -41, 26, 124, 125, 146, 126, 127, 93, + -13, 99, 118, 137, 228, 273, 139, 258, 128, 224, + 133, 134, 262, 133, 132, 141, 142, 143, 144, 145, + 221, 236, 3, 281, 119, 129, 111, 133, 241, 123, + 123, 287, 123, 123, 282, 214, 219, 283, 284, 112, + 185, 186, 139, 237, 194, 217, 220, 140, 200, 150, + 242, 190, 191, 288, 213, 113, -29, -29, 116, 183, + 184, 185, 186, 176, 177, 178, 223, 176, 177, 178, + 117, 228, 190, 191, 114, 153, 212, 155, 89, 156, + 157, 94, 94, 140, 149, 91, 115, 91, 218, 218, + 93, 93, 99, 99, 291, 292, 195, 121, 201, 245, + 222, 150, 231, 246, 247, 248, 249, 250, 251, 252, + 253, 123, -41, -41, 254, 255, 256, 257, 179, 180, + -13, -13, -41, 216, 216, 137, 226, 175, 139, 225, + -13, 175, 215, 215, 99, 99, 149, 123, 91, 187, + 188, 189, 91, 187, 188, 189, 206, 207, 196, 223, + 202, 176, 177, 178, 194, 208, 209, 210, 239, 179, + 180, 197, 260, 203, 133, 134, 190, 191, 218, 267, + 232, 233, 285, 286, 261, 234, 235, 181, 182, 183, + 184, 185, 186, 200, 264, 265, 266, 268, 269, 270, + 279, 280, 190, 191, 271, 274, 275, 276, 277, 290, + 278, 293, 92, 216, 94, 272, 244, 0, 0, 0, + 0, 0, 215, 215, 99, 99, 0, 0, 181, 182, + 183, 184, 185, 186, 0, 150, 150, 187, 188, 189, + 0, 0, 0, 190, 191, 179, 180, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, + 149, 149, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 0, 0, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 0, 181, 182, 183, 184, 185, 186, + 0, 0, 35, 0, 0, 0, 0, 0, 0, 190, + 191, 0, 0, 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, 0, 0, 0, 89, + 0, 0, 0, 90, 0, 4, 5, 0, 91, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, + 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, + 0, 0, 0, 141, 142, 143, 144, 145, 0, 0, + 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, 0, 0, 0, 89, 0, 0, 0, + 90, 0, 4, 5, 0, 91, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 0, 0, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 89, 0, 0, 0, 90, 0, 0, + 0, 0, 91, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 179, 180, 26, 0, 179, 180, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 37, 38, 39, 40, 0, 0, + 0, 0, 0, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, + 0, 0, 182, 183, 184, 185, 186, 183, 184, 185, + 186, 74, 0, 0, 0, 0, 190, 191, 0, 0, + 190, 191, 0, 0, 151, 152, 153, 154, 155, 0, + 156, 157, 0, 90, 158, 159, 0, 0, 91, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 160, 161, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 162, 163, 164, + 165, 166, 167, 168, 169, 170 +}; + +static const yytype_int16 yycheck[] = +{ + 2, 37, 0, 37, 41, 42, 96, 44, 45, 2, + 0, 2, 37, 93, 149, 230, 94, 195, 42, 8, + 120, 121, 201, 120, 90, 59, 60, 61, 62, 63, + 130, 37, 0, 130, 59, 59, 37, 120, 37, 41, + 42, 37, 44, 45, 259, 135, 136, 130, 263, 37, + 127, 128, 130, 59, 37, 135, 136, 94, 37, 96, + 59, 138, 139, 59, 130, 37, 120, 121, 37, 125, + 126, 127, 128, 56, 57, 58, 130, 56, 57, 58, + 37, 216, 138, 139, 59, 5, 123, 7, 122, 9, + 10, 93, 94, 130, 96, 131, 59, 131, 135, 136, + 93, 94, 93, 94, 282, 284, 108, 59, 110, 175, + 130, 148, 149, 179, 180, 181, 182, 183, 184, 185, + 186, 123, 120, 121, 190, 191, 192, 193, 64, 65, + 120, 121, 130, 135, 136, 215, 128, 135, 216, 128, + 130, 135, 135, 136, 135, 136, 148, 149, 131, 132, + 133, 134, 131, 132, 133, 134, 123, 124, 108, 130, + 110, 56, 57, 58, 37, 132, 133, 134, 59, 64, + 65, 108, 37, 110, 120, 121, 138, 139, 215, 216, + 120, 121, 272, 273, 37, 120, 121, 123, 124, 125, + 126, 127, 128, 37, 37, 37, 37, 61, 37, 37, + 136, 137, 138, 139, 130, 4, 4, 3, 3, 37, + 47, 136, 2, 215, 216, 230, 171, -1, -1, -1, + -1, -1, 215, 216, 215, 216, -1, -1, 123, 124, + 125, 126, 127, 128, -1, 272, 273, 132, 133, 134, + -1, -1, -1, 138, 139, 64, 65, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, + 272, 273, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, -1, -1, 37, 38, 39, 40, 41, 42, + 43, 44, 45, -1, 123, 124, 125, 126, 127, 128, + -1, -1, 55, -1, -1, -1, -1, -1, -1, 138, + 139, -1, -1, 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, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, -1, -1, -1, 122, + -1, -1, -1, 126, -1, 11, 12, -1, 131, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, + -1, 37, 38, 39, 40, 41, 42, 43, 44, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, + -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, + 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, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, -1, -1, -1, 122, -1, -1, -1, + 126, -1, 11, 12, -1, 131, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, -1, -1, 37, 38, + 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 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, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, -1, -1, 122, -1, -1, -1, 126, -1, -1, + -1, -1, 131, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 64, 65, 37, -1, 64, 65, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 66, 67, 68, 69, 70, -1, -1, + -1, -1, -1, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, -1, -1, -1, + -1, -1, 124, 125, 126, 127, 128, 125, 126, 127, + 128, 104, -1, -1, -1, -1, 138, 139, -1, -1, + 138, 139, -1, -1, 3, 4, 5, 6, 7, -1, + 9, 10, -1, 126, 13, 14, -1, -1, 131, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 141, 142, 0, 11, 12, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 55, 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, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 122, + 126, 131, 143, 148, 149, 152, 153, 154, 155, 159, + 160, 161, 166, 172, 173, 175, 176, 177, 178, 182, + 183, 37, 37, 37, 59, 59, 37, 37, 37, 59, + 168, 59, 169, 149, 175, 175, 175, 175, 42, 59, + 149, 159, 172, 120, 121, 144, 145, 152, 143, 173, + 175, 59, 60, 61, 62, 63, 146, 147, 148, 149, + 175, 3, 4, 5, 6, 7, 9, 10, 13, 14, + 35, 36, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 156, 157, 158, 162, 135, 56, 57, 58, 64, + 65, 123, 124, 125, 126, 127, 128, 132, 133, 134, + 138, 139, 170, 171, 37, 149, 170, 171, 179, 180, + 37, 149, 170, 171, 184, 185, 123, 124, 132, 133, + 134, 174, 175, 172, 146, 148, 149, 152, 175, 146, + 152, 130, 130, 130, 8, 128, 128, 146, 147, 150, + 151, 175, 120, 121, 120, 121, 37, 59, 163, 59, + 165, 37, 59, 167, 157, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 180, 181, + 37, 37, 185, 186, 37, 37, 37, 175, 61, 37, + 37, 130, 144, 145, 4, 4, 3, 3, 47, 136, + 137, 130, 145, 130, 145, 146, 146, 37, 59, 164, + 37, 180, 185, 136 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 140, 141, 141, 142, 143, 143, 143, 143, 143, + 144, 145, 146, 146, 146, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 148, 149, 150, 150, 150, 151, + 151, 152, 152, 153, 153, 153, 153, 153, 153, 154, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 157, 157, 157, 157, 158, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, + 161, 161, 161, 162, 162, 162, 162, 163, 163, 164, + 164, 165, 166, 166, 166, 167, 167, 168, 168, 169, + 170, 170, 170, 171, 171, 171, 172, 172, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 174, 174, 174, 174, 175, 175, + 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, + 177, 178, 178, 179, 179, 179, 179, 180, 181, 181, + 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, + 183, 183, 183, 183, 184, 184, 184, 184, 185, 186, + 186 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 0, 1, 3, 3, 3, 3, + 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, + 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, + 1, 1, 2, 3, 2, 2, 2, 2, 2, 2, + 3, 1, 3, 3, 1, 1, 1, 2, 1, 2, + 1, 0, 1, 1, 3, 3, 3, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 4, 1, 1, 2, 1, 2, 1, 1, + 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, + 2, 2, 2, 4, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 6, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 3, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, + 3 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (yyscanner, cstate, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, yyscanner, cstate); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + YYUSE (yyscanner); + YYUSE (cstate); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, cstate); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void *yyscanner, compiler_state_t *cstate) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , yyscanner, cstate); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, yyscanner, cstate); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *yyscanner, compiler_state_t *cstate) +{ + YYUSE (yyvaluep); + YYUSE (yyscanner); + YYUSE (cstate); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void *yyscanner, compiler_state_t *cstate) +{ +/* The lookahead symbol. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (&yylval, yyscanner); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 363 "grammar.y" /* yacc.c:1646 */ + { + CHECK_INT_VAL(finish_parse(cstate, (yyvsp[0].blk).b)); +} +#line 2089 "grammar.c" /* yacc.c:1646 */ + break; + + case 4: +#line 368 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).q = qerr; } +#line 2095 "grammar.c" /* yacc.c:1646 */ + break; + + case 6: +#line 371 "grammar.y" /* yacc.c:1646 */ + { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2101 "grammar.c" /* yacc.c:1646 */ + break; + + case 7: +#line 372 "grammar.y" /* yacc.c:1646 */ + { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2107 "grammar.c" /* yacc.c:1646 */ + break; + + case 8: +#line 373 "grammar.y" /* yacc.c:1646 */ + { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2113 "grammar.c" /* yacc.c:1646 */ + break; + + case 9: +#line 374 "grammar.y" /* yacc.c:1646 */ + { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2119 "grammar.c" /* yacc.c:1646 */ + break; + + case 10: +#line 376 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[-1].blk); } +#line 2125 "grammar.c" /* yacc.c:1646 */ + break; + + case 11: +#line 378 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[-1].blk); } +#line 2131 "grammar.c" /* yacc.c:1646 */ + break; + + case 13: +#line 381 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i), + (yyval.blk).q = (yyvsp[-1].blk).q))); } +#line 2138 "grammar.c" /* yacc.c:1646 */ + break; + + case 14: +#line 383 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[-1].blk); } +#line 2144 "grammar.c" /* yacc.c:1646 */ + break; + + case 15: +#line 385 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_PTR_VAL(((yyval.blk).b = gen_scode(cstate, (yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q))); } +#line 2150 "grammar.c" /* yacc.c:1646 */ + break; + + case 16: +#line 386 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[-2].s)); CHECK_PTR_VAL(((yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i), + (yyval.blk).q = (yyvsp[-3].blk).q))); } +#line 2157 "grammar.c" /* yacc.c:1646 */ + break; + + case 17: +#line 388 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[-2].s)); CHECK_PTR_VAL(((yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), (yyvsp[0].s), 0, + (yyval.blk).q = (yyvsp[-3].blk).q))); } +#line 2164 "grammar.c" /* yacc.c:1646 */ + break; + + case 18: +#line 390 "grammar.y" /* yacc.c:1646 */ + { + CHECK_PTR_VAL((yyvsp[0].s)); + /* Decide how to parse HID based on proto */ + (yyval.blk).q = (yyvsp[-1].blk).q; + if ((yyval.blk).q.addr == Q_PORT) { + bpf_set_error(cstate, "'port' modifier applied to ip host"); + YYABORT; + } else if ((yyval.blk).q.addr == Q_PORTRANGE) { + bpf_set_error(cstate, "'portrange' modifier applied to ip host"); + YYABORT; + } else if ((yyval.blk).q.addr == Q_PROTO) { + bpf_set_error(cstate, "'proto' modifier applied to ip host"); + YYABORT; + } else if ((yyval.blk).q.addr == Q_PROTOCHAIN) { + bpf_set_error(cstate, "'protochain' modifier applied to ip host"); + YYABORT; + } + CHECK_PTR_VAL(((yyval.blk).b = gen_ncode(cstate, (yyvsp[0].s), 0, (yyval.blk).q))); + } +#line 2188 "grammar.c" /* yacc.c:1646 */ + break; + + case 19: +#line 409 "grammar.y" /* yacc.c:1646 */ + { + CHECK_PTR_VAL((yyvsp[-2].s)); +#ifdef INET6 + CHECK_PTR_VAL(((yyval.blk).b = gen_mcode6(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i), + (yyval.blk).q = (yyvsp[-3].blk).q))); +#else + bpf_set_error(cstate, "'ip6addr/prefixlen' not supported " + "in this configuration"); + YYABORT; +#endif /*INET6*/ + } +#line 2204 "grammar.c" /* yacc.c:1646 */ + break; + + case 20: +#line 420 "grammar.y" /* yacc.c:1646 */ + { + CHECK_PTR_VAL((yyvsp[0].s)); +#ifdef INET6 + CHECK_PTR_VAL(((yyval.blk).b = gen_mcode6(cstate, (yyvsp[0].s), 0, 128, + (yyval.blk).q = (yyvsp[-1].blk).q))); +#else + bpf_set_error(cstate, "'ip6addr' not supported " + "in this configuration"); + YYABORT; +#endif /*INET6*/ + } +#line 2220 "grammar.c" /* yacc.c:1646 */ + break; + + case 21: +#line 431 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_PTR_VAL(((yyval.blk).b = gen_ecode(cstate, (yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q))); } +#line 2226 "grammar.c" /* yacc.c:1646 */ + break; + + case 22: +#line 432 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_PTR_VAL(((yyval.blk).b = gen_acode(cstate, (yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q))); } +#line 2232 "grammar.c" /* yacc.c:1646 */ + break; + + case 23: +#line 433 "grammar.y" /* yacc.c:1646 */ + { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2238 "grammar.c" /* yacc.c:1646 */ + break; + + case 24: +#line 435 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[-1].blk); } +#line 2244 "grammar.c" /* yacc.c:1646 */ + break; + + case 25: +#line 437 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[-1].blk); } +#line 2250 "grammar.c" /* yacc.c:1646 */ + break; + + case 27: +#line 440 "grammar.y" /* yacc.c:1646 */ + { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2256 "grammar.c" /* yacc.c:1646 */ + break; + + case 28: +#line 441 "grammar.y" /* yacc.c:1646 */ + { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2262 "grammar.c" /* yacc.c:1646 */ + break; + + case 29: +#line 443 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i), + (yyval.blk).q = (yyvsp[-1].blk).q))); } +#line 2269 "grammar.c" /* yacc.c:1646 */ + break; + + case 32: +#line 448 "grammar.y" /* yacc.c:1646 */ + { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 2275 "grammar.c" /* yacc.c:1646 */ + break; + + case 33: +#line 450 "grammar.y" /* yacc.c:1646 */ + { QSET((yyval.blk).q, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i)); } +#line 2281 "grammar.c" /* yacc.c:1646 */ + break; + + case 34: +#line 451 "grammar.y" /* yacc.c:1646 */ + { QSET((yyval.blk).q, (yyvsp[-1].i), (yyvsp[0].i), Q_DEFAULT); } +#line 2287 "grammar.c" /* yacc.c:1646 */ + break; + + case 35: +#line 452 "grammar.y" /* yacc.c:1646 */ + { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } +#line 2293 "grammar.c" /* yacc.c:1646 */ + break; + + case 36: +#line 453 "grammar.y" /* yacc.c:1646 */ + { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTO); } +#line 2299 "grammar.c" /* yacc.c:1646 */ + break; + + case 37: +#line 454 "grammar.y" /* yacc.c:1646 */ + { +#ifdef NO_PROTOCHAIN + bpf_set_error(cstate, "protochain not supported"); + YYABORT; +#else + QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTOCHAIN); +#endif + } +#line 2312 "grammar.c" /* yacc.c:1646 */ + break; + + case 38: +#line 462 "grammar.y" /* yacc.c:1646 */ + { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } +#line 2318 "grammar.c" /* yacc.c:1646 */ + break; + + case 39: +#line 464 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk) = (yyvsp[0].blk); } +#line 2324 "grammar.c" /* yacc.c:1646 */ + break; + + case 40: +#line 465 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = (yyvsp[-2].blk).q; } +#line 2330 "grammar.c" /* yacc.c:1646 */ + break; + + case 41: +#line 466 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_proto_abbrev(cstate, (yyvsp[0].i)))); (yyval.blk).q = qerr; } +#line 2336 "grammar.c" /* yacc.c:1646 */ + break; + + case 42: +#line 467 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 0))); + (yyval.blk).q = qerr; } +#line 2343 "grammar.c" /* yacc.c:1646 */ + break; + + case 43: +#line 469 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 1))); + (yyval.blk).q = qerr; } +#line 2350 "grammar.c" /* yacc.c:1646 */ + break; + + case 44: +#line 471 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[0].rblk); (yyval.blk).q = qerr; } +#line 2356 "grammar.c" /* yacc.c:1646 */ + break; + + case 45: +#line 472 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_atmtype_abbrev(cstate, (yyvsp[0].i)))); (yyval.blk).q = qerr; } +#line 2362 "grammar.c" /* yacc.c:1646 */ + break; + + case 46: +#line 473 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_atmmulti_abbrev(cstate, (yyvsp[0].i)))); (yyval.blk).q = qerr; } +#line 2368 "grammar.c" /* yacc.c:1646 */ + break; + + case 47: +#line 474 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } +#line 2374 "grammar.c" /* yacc.c:1646 */ + break; + + case 48: +#line 475 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_mtp2type_abbrev(cstate, (yyvsp[0].i)))); (yyval.blk).q = qerr; } +#line 2380 "grammar.c" /* yacc.c:1646 */ + break; + + case 49: +#line 476 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } +#line 2386 "grammar.c" /* yacc.c:1646 */ + break; + + case 51: +#line 480 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_DEFAULT; } +#line 2392 "grammar.c" /* yacc.c:1646 */ + break; + + case 52: +#line 483 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_SRC; } +#line 2398 "grammar.c" /* yacc.c:1646 */ + break; + + case 53: +#line 484 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_DST; } +#line 2404 "grammar.c" /* yacc.c:1646 */ + break; + + case 54: +#line 485 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_OR; } +#line 2410 "grammar.c" /* yacc.c:1646 */ + break; + + case 55: +#line 486 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_OR; } +#line 2416 "grammar.c" /* yacc.c:1646 */ + break; + + case 56: +#line 487 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_AND; } +#line 2422 "grammar.c" /* yacc.c:1646 */ + break; + + case 57: +#line 488 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_AND; } +#line 2428 "grammar.c" /* yacc.c:1646 */ + break; + + case 58: +#line 489 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ADDR1; } +#line 2434 "grammar.c" /* yacc.c:1646 */ + break; + + case 59: +#line 490 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ADDR2; } +#line 2440 "grammar.c" /* yacc.c:1646 */ + break; + + case 60: +#line 491 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ADDR3; } +#line 2446 "grammar.c" /* yacc.c:1646 */ + break; + + case 61: +#line 492 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ADDR4; } +#line 2452 "grammar.c" /* yacc.c:1646 */ + break; + + case 62: +#line 493 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_RA; } +#line 2458 "grammar.c" /* yacc.c:1646 */ + break; + + case 63: +#line 494 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_TA; } +#line 2464 "grammar.c" /* yacc.c:1646 */ + break; + + case 64: +#line 497 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_HOST; } +#line 2470 "grammar.c" /* yacc.c:1646 */ + break; + + case 65: +#line 498 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_NET; } +#line 2476 "grammar.c" /* yacc.c:1646 */ + break; + + case 66: +#line 499 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_PORT; } +#line 2482 "grammar.c" /* yacc.c:1646 */ + break; + + case 67: +#line 500 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_PORTRANGE; } +#line 2488 "grammar.c" /* yacc.c:1646 */ + break; + + case 68: +#line 503 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_GATEWAY; } +#line 2494 "grammar.c" /* yacc.c:1646 */ + break; + + case 69: +#line 505 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_LINK; } +#line 2500 "grammar.c" /* yacc.c:1646 */ + break; + + case 70: +#line 506 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_IP; } +#line 2506 "grammar.c" /* yacc.c:1646 */ + break; + + case 71: +#line 507 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ARP; } +#line 2512 "grammar.c" /* yacc.c:1646 */ + break; + + case 72: +#line 508 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_RARP; } +#line 2518 "grammar.c" /* yacc.c:1646 */ + break; + + case 73: +#line 509 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_SCTP; } +#line 2524 "grammar.c" /* yacc.c:1646 */ + break; + + case 74: +#line 510 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_TCP; } +#line 2530 "grammar.c" /* yacc.c:1646 */ + break; + + case 75: +#line 511 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_UDP; } +#line 2536 "grammar.c" /* yacc.c:1646 */ + break; + + case 76: +#line 512 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ICMP; } +#line 2542 "grammar.c" /* yacc.c:1646 */ + break; + + case 77: +#line 513 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_IGMP; } +#line 2548 "grammar.c" /* yacc.c:1646 */ + break; + + case 78: +#line 514 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_IGRP; } +#line 2554 "grammar.c" /* yacc.c:1646 */ + break; + + case 79: +#line 515 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_PIM; } +#line 2560 "grammar.c" /* yacc.c:1646 */ + break; + + case 80: +#line 516 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_VRRP; } +#line 2566 "grammar.c" /* yacc.c:1646 */ + break; + + case 81: +#line 517 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_CARP; } +#line 2572 "grammar.c" /* yacc.c:1646 */ + break; + + case 82: +#line 518 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ATALK; } +#line 2578 "grammar.c" /* yacc.c:1646 */ + break; + + case 83: +#line 519 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_AARP; } +#line 2584 "grammar.c" /* yacc.c:1646 */ + break; + + case 84: +#line 520 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_DECNET; } +#line 2590 "grammar.c" /* yacc.c:1646 */ + break; + + case 85: +#line 521 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_LAT; } +#line 2596 "grammar.c" /* yacc.c:1646 */ + break; + + case 86: +#line 522 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_SCA; } +#line 2602 "grammar.c" /* yacc.c:1646 */ + break; + + case 87: +#line 523 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_MOPDL; } +#line 2608 "grammar.c" /* yacc.c:1646 */ + break; + + case 88: +#line 524 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_MOPRC; } +#line 2614 "grammar.c" /* yacc.c:1646 */ + break; + + case 89: +#line 525 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_IPV6; } +#line 2620 "grammar.c" /* yacc.c:1646 */ + break; + + case 90: +#line 526 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ICMPV6; } +#line 2626 "grammar.c" /* yacc.c:1646 */ + break; + + case 91: +#line 527 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_AH; } +#line 2632 "grammar.c" /* yacc.c:1646 */ + break; + + case 92: +#line 528 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ESP; } +#line 2638 "grammar.c" /* yacc.c:1646 */ + break; + + case 93: +#line 529 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISO; } +#line 2644 "grammar.c" /* yacc.c:1646 */ + break; + + case 94: +#line 530 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ESIS; } +#line 2650 "grammar.c" /* yacc.c:1646 */ + break; + + case 95: +#line 531 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS; } +#line 2656 "grammar.c" /* yacc.c:1646 */ + break; + + case 96: +#line 532 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_L1; } +#line 2662 "grammar.c" /* yacc.c:1646 */ + break; + + case 97: +#line 533 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_L2; } +#line 2668 "grammar.c" /* yacc.c:1646 */ + break; + + case 98: +#line 534 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_IIH; } +#line 2674 "grammar.c" /* yacc.c:1646 */ + break; + + case 99: +#line 535 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_LSP; } +#line 2680 "grammar.c" /* yacc.c:1646 */ + break; + + case 100: +#line 536 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_SNP; } +#line 2686 "grammar.c" /* yacc.c:1646 */ + break; + + case 101: +#line 537 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_PSNP; } +#line 2692 "grammar.c" /* yacc.c:1646 */ + break; + + case 102: +#line 538 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_ISIS_CSNP; } +#line 2698 "grammar.c" /* yacc.c:1646 */ + break; + + case 103: +#line 539 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_CLNP; } +#line 2704 "grammar.c" /* yacc.c:1646 */ + break; + + case 104: +#line 540 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_STP; } +#line 2710 "grammar.c" /* yacc.c:1646 */ + break; + + case 105: +#line 541 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_IPX; } +#line 2716 "grammar.c" /* yacc.c:1646 */ + break; + + case 106: +#line 542 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_NETBEUI; } +#line 2722 "grammar.c" /* yacc.c:1646 */ + break; + + case 107: +#line 543 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = Q_RADIO; } +#line 2728 "grammar.c" /* yacc.c:1646 */ + break; + + case 108: +#line 545 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_broadcast(cstate, (yyvsp[-1].i)))); } +#line 2734 "grammar.c" /* yacc.c:1646 */ + break; + + case 109: +#line 546 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_multicast(cstate, (yyvsp[-1].i)))); } +#line 2740 "grammar.c" /* yacc.c:1646 */ + break; + + case 110: +#line 547 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_less(cstate, (yyvsp[0].i)))); } +#line 2746 "grammar.c" /* yacc.c:1646 */ + break; + + case 111: +#line 548 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_greater(cstate, (yyvsp[0].i)))); } +#line 2752 "grammar.c" /* yacc.c:1646 */ + break; + + case 112: +#line 549 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_byteop(cstate, (yyvsp[-1].i), (yyvsp[-2].i), (yyvsp[0].i)))); } +#line 2758 "grammar.c" /* yacc.c:1646 */ + break; + + case 113: +#line 550 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_inbound(cstate, 0))); } +#line 2764 "grammar.c" /* yacc.c:1646 */ + break; + + case 114: +#line 551 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_inbound(cstate, 1))); } +#line 2770 "grammar.c" /* yacc.c:1646 */ + break; + + case 115: +#line 552 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_vlan(cstate, (bpf_u_int32)(yyvsp[0].i), 1))); } +#line 2776 "grammar.c" /* yacc.c:1646 */ + break; + + case 116: +#line 553 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_vlan(cstate, 0, 0))); } +#line 2782 "grammar.c" /* yacc.c:1646 */ + break; + + case 117: +#line 554 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_mpls(cstate, (bpf_u_int32)(yyvsp[0].i), 1))); } +#line 2788 "grammar.c" /* yacc.c:1646 */ + break; + + case 118: +#line 555 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_mpls(cstate, 0, 0))); } +#line 2794 "grammar.c" /* yacc.c:1646 */ + break; + + case 119: +#line 556 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pppoed(cstate))); } +#line 2800 "grammar.c" /* yacc.c:1646 */ + break; + + case 120: +#line 557 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pppoes(cstate, (bpf_u_int32)(yyvsp[0].i), 1))); } +#line 2806 "grammar.c" /* yacc.c:1646 */ + break; + + case 121: +#line 558 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pppoes(cstate, 0, 0))); } +#line 2812 "grammar.c" /* yacc.c:1646 */ + break; + + case 122: +#line 559 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_geneve(cstate, (bpf_u_int32)(yyvsp[0].i), 1))); } +#line 2818 "grammar.c" /* yacc.c:1646 */ + break; + + case 123: +#line 560 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_geneve(cstate, 0, 0))); } +#line 2824 "grammar.c" /* yacc.c:1646 */ + break; + + case 124: +#line 561 "grammar.y" /* yacc.c:1646 */ + { (yyval.rblk) = (yyvsp[0].rblk); } +#line 2830 "grammar.c" /* yacc.c:1646 */ + break; + + case 125: +#line 562 "grammar.y" /* yacc.c:1646 */ + { (yyval.rblk) = (yyvsp[0].rblk); } +#line 2836 "grammar.c" /* yacc.c:1646 */ + break; + + case 126: +#line 563 "grammar.y" /* yacc.c:1646 */ + { (yyval.rblk) = (yyvsp[0].rblk); } +#line 2842 "grammar.c" /* yacc.c:1646 */ + break; + + case 127: +#line 566 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_PTR_VAL(((yyval.rblk) = gen_pf_ifname(cstate, (yyvsp[0].s)))); } +#line 2848 "grammar.c" /* yacc.c:1646 */ + break; + + case 128: +#line 567 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_PTR_VAL(((yyval.rblk) = gen_pf_ruleset(cstate, (yyvsp[0].s)))); } +#line 2854 "grammar.c" /* yacc.c:1646 */ + break; + + case 129: +#line 568 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pf_rnr(cstate, (yyvsp[0].i)))); } +#line 2860 "grammar.c" /* yacc.c:1646 */ + break; + + case 130: +#line 569 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pf_srnr(cstate, (yyvsp[0].i)))); } +#line 2866 "grammar.c" /* yacc.c:1646 */ + break; + + case 131: +#line 570 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pf_reason(cstate, (yyvsp[0].i)))); } +#line 2872 "grammar.c" /* yacc.c:1646 */ + break; + + case 132: +#line 571 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_pf_action(cstate, (yyvsp[0].i)))); } +#line 2878 "grammar.c" /* yacc.c:1646 */ + break; + + case 133: +#line 575 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_p80211_type(cstate, (yyvsp[-2].i) | (yyvsp[0].i), + IEEE80211_FC0_TYPE_MASK | + IEEE80211_FC0_SUBTYPE_MASK))); + } +#line 2887 "grammar.c" /* yacc.c:1646 */ + break; + + case 134: +#line 579 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i), + IEEE80211_FC0_TYPE_MASK))); + } +#line 2895 "grammar.c" /* yacc.c:1646 */ + break; + + case 135: +#line 582 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i), + IEEE80211_FC0_TYPE_MASK | + IEEE80211_FC0_SUBTYPE_MASK))); + } +#line 2904 "grammar.c" /* yacc.c:1646 */ + break; + + case 136: +#line 586 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_p80211_fcdir(cstate, (yyvsp[0].i)))); } +#line 2910 "grammar.c" /* yacc.c:1646 */ + break; + + case 138: +#line 590 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); + (yyval.i) = str2tok((yyvsp[0].s), ieee80211_types); + if ((yyval.i) == -1) { + bpf_set_error(cstate, "unknown 802.11 type name"); + YYABORT; + } + } +#line 2922 "grammar.c" /* yacc.c:1646 */ + break; + + case 140: +#line 600 "grammar.y" /* yacc.c:1646 */ + { const struct tok *types = NULL; + int i; + CHECK_PTR_VAL((yyvsp[0].s)); + for (i = 0;; i++) { + if (ieee80211_type_subtypes[i].tok == NULL) { + /* Ran out of types */ + bpf_set_error(cstate, "unknown 802.11 type"); + YYABORT; + } + if ((yyvsp[(-1) - (1)].i) == ieee80211_type_subtypes[i].type) { + types = ieee80211_type_subtypes[i].tok; + break; + } + } + + (yyval.i) = str2tok((yyvsp[0].s), types); + if ((yyval.i) == -1) { + bpf_set_error(cstate, "unknown 802.11 subtype name"); + YYABORT; + } + } +#line 2948 "grammar.c" /* yacc.c:1646 */ + break; + + case 141: +#line 623 "grammar.y" /* yacc.c:1646 */ + { int i; + CHECK_PTR_VAL((yyvsp[0].s)); + for (i = 0;; i++) { + if (ieee80211_type_subtypes[i].tok == NULL) { + /* Ran out of types */ + bpf_set_error(cstate, "unknown 802.11 type name"); + YYABORT; + } + (yyval.i) = str2tok((yyvsp[0].s), ieee80211_type_subtypes[i].tok); + if ((yyval.i) != -1) { + (yyval.i) |= ieee80211_type_subtypes[i].type; + break; + } + } + } +#line 2968 "grammar.c" /* yacc.c:1646 */ + break; + + case 142: +#line 640 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_llc(cstate))); } +#line 2974 "grammar.c" /* yacc.c:1646 */ + break; + + case 143: +#line 641 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); + if (pcap_strcasecmp((yyvsp[0].s), "i") == 0) { + CHECK_PTR_VAL(((yyval.rblk) = gen_llc_i(cstate))); + } else if (pcap_strcasecmp((yyvsp[0].s), "s") == 0) { + CHECK_PTR_VAL(((yyval.rblk) = gen_llc_s(cstate))); + } else if (pcap_strcasecmp((yyvsp[0].s), "u") == 0) { + CHECK_PTR_VAL(((yyval.rblk) = gen_llc_u(cstate))); + } else { + int subtype; + + subtype = str2tok((yyvsp[0].s), llc_s_subtypes); + if (subtype != -1) { + CHECK_PTR_VAL(((yyval.rblk) = gen_llc_s_subtype(cstate, subtype))); + } else { + subtype = str2tok((yyvsp[0].s), llc_u_subtypes); + if (subtype == -1) { + bpf_set_error(cstate, "unknown LLC type name \"%s\"", (yyvsp[0].s)); + YYABORT; + } + CHECK_PTR_VAL(((yyval.rblk) = gen_llc_u_subtype(cstate, subtype))); + } + } + } +#line 3002 "grammar.c" /* yacc.c:1646 */ + break; + + case 144: +#line 665 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.rblk) = gen_llc_s_subtype(cstate, LLC_RNR))); } +#line 3008 "grammar.c" /* yacc.c:1646 */ + break; + + case 146: +#line 669 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); + if (pcap_strcasecmp((yyvsp[0].s), "nods") == 0) + (yyval.i) = IEEE80211_FC1_DIR_NODS; + else if (pcap_strcasecmp((yyvsp[0].s), "tods") == 0) + (yyval.i) = IEEE80211_FC1_DIR_TODS; + else if (pcap_strcasecmp((yyvsp[0].s), "fromds") == 0) + (yyval.i) = IEEE80211_FC1_DIR_FROMDS; + else if (pcap_strcasecmp((yyvsp[0].s), "dstods") == 0) + (yyval.i) = IEEE80211_FC1_DIR_DSTODS; + else { + bpf_set_error(cstate, "unknown 802.11 direction"); + YYABORT; + } + } +#line 3027 "grammar.c" /* yacc.c:1646 */ + break; + + case 147: +#line 685 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = (yyvsp[0].i); } +#line 3033 "grammar.c" /* yacc.c:1646 */ + break; + + case 148: +#line 686 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_INT_VAL(((yyval.i) = pfreason_to_num(cstate, (yyvsp[0].s)))); } +#line 3039 "grammar.c" /* yacc.c:1646 */ + break; + + case 149: +#line 689 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL((yyvsp[0].s)); CHECK_INT_VAL(((yyval.i) = pfaction_to_num(cstate, (yyvsp[0].s)))); } +#line 3045 "grammar.c" /* yacc.c:1646 */ + break; + + case 150: +#line 692 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JGT; } +#line 3051 "grammar.c" /* yacc.c:1646 */ + break; + + case 151: +#line 693 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JGE; } +#line 3057 "grammar.c" /* yacc.c:1646 */ + break; + + case 152: +#line 694 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JEQ; } +#line 3063 "grammar.c" /* yacc.c:1646 */ + break; + + case 153: +#line 696 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JGT; } +#line 3069 "grammar.c" /* yacc.c:1646 */ + break; + + case 154: +#line 697 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JGE; } +#line 3075 "grammar.c" /* yacc.c:1646 */ + break; + + case 155: +#line 698 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = BPF_JEQ; } +#line 3081 "grammar.c" /* yacc.c:1646 */ + break; + + case 156: +#line 700 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_loadi(cstate, (yyvsp[0].i)))); } +#line 3087 "grammar.c" /* yacc.c:1646 */ + break; + + case 158: +#line 703 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_load(cstate, (yyvsp[-3].i), (yyvsp[-1].a), 1))); } +#line 3093 "grammar.c" /* yacc.c:1646 */ + break; + + case 159: +#line 704 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_load(cstate, (yyvsp[-5].i), (yyvsp[-3].a), (yyvsp[-1].i)))); } +#line 3099 "grammar.c" /* yacc.c:1646 */ + break; + + case 160: +#line 705 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_ADD, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3105 "grammar.c" /* yacc.c:1646 */ + break; + + case 161: +#line 706 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_SUB, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3111 "grammar.c" /* yacc.c:1646 */ + break; + + case 162: +#line 707 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_MUL, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3117 "grammar.c" /* yacc.c:1646 */ + break; + + case 163: +#line 708 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_DIV, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3123 "grammar.c" /* yacc.c:1646 */ + break; + + case 164: +#line 709 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_MOD, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3129 "grammar.c" /* yacc.c:1646 */ + break; + + case 165: +#line 710 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_AND, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3135 "grammar.c" /* yacc.c:1646 */ + break; + + case 166: +#line 711 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_OR, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3141 "grammar.c" /* yacc.c:1646 */ + break; + + case 167: +#line 712 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_XOR, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3147 "grammar.c" /* yacc.c:1646 */ + break; + + case 168: +#line 713 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_LSH, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3153 "grammar.c" /* yacc.c:1646 */ + break; + + case 169: +#line 714 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_arth(cstate, BPF_RSH, (yyvsp[-2].a), (yyvsp[0].a)))); } +#line 3159 "grammar.c" /* yacc.c:1646 */ + break; + + case 170: +#line 715 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_neg(cstate, (yyvsp[0].a)))); } +#line 3165 "grammar.c" /* yacc.c:1646 */ + break; + + case 171: +#line 716 "grammar.y" /* yacc.c:1646 */ + { (yyval.a) = (yyvsp[-1].a); } +#line 3171 "grammar.c" /* yacc.c:1646 */ + break; + + case 172: +#line 717 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.a) = gen_loadlen(cstate))); } +#line 3177 "grammar.c" /* yacc.c:1646 */ + break; + + case 173: +#line 719 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = '&'; } +#line 3183 "grammar.c" /* yacc.c:1646 */ + break; + + case 174: +#line 720 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = '|'; } +#line 3189 "grammar.c" /* yacc.c:1646 */ + break; + + case 175: +#line 721 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = '<'; } +#line 3195 "grammar.c" /* yacc.c:1646 */ + break; + + case 176: +#line 722 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = '>'; } +#line 3201 "grammar.c" /* yacc.c:1646 */ + break; + + case 177: +#line 723 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = '='; } +#line 3207 "grammar.c" /* yacc.c:1646 */ + break; + + case 179: +#line 726 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = (yyvsp[-1].i); } +#line 3213 "grammar.c" /* yacc.c:1646 */ + break; + + case 180: +#line 728 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_LANE; } +#line 3219 "grammar.c" /* yacc.c:1646 */ + break; + + case 181: +#line 729 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_METAC; } +#line 3225 "grammar.c" /* yacc.c:1646 */ + break; + + case 182: +#line 730 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_BCC; } +#line 3231 "grammar.c" /* yacc.c:1646 */ + break; + + case 183: +#line 731 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_OAMF4EC; } +#line 3237 "grammar.c" /* yacc.c:1646 */ + break; + + case 184: +#line 732 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_OAMF4SC; } +#line 3243 "grammar.c" /* yacc.c:1646 */ + break; + + case 185: +#line 733 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_SC; } +#line 3249 "grammar.c" /* yacc.c:1646 */ + break; + + case 186: +#line 734 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_ILMIC; } +#line 3255 "grammar.c" /* yacc.c:1646 */ + break; + + case 187: +#line 736 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_OAM; } +#line 3261 "grammar.c" /* yacc.c:1646 */ + break; + + case 188: +#line 737 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_OAMF4; } +#line 3267 "grammar.c" /* yacc.c:1646 */ + break; + + case 189: +#line 738 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_CONNECTMSG; } +#line 3273 "grammar.c" /* yacc.c:1646 */ + break; + + case 190: +#line 739 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = A_METACONNECT; } +#line 3279 "grammar.c" /* yacc.c:1646 */ + break; + + case 191: +#line 742 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).atmfieldtype = A_VPI; } +#line 3285 "grammar.c" /* yacc.c:1646 */ + break; + + case 192: +#line 743 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).atmfieldtype = A_VCI; } +#line 3291 "grammar.c" /* yacc.c:1646 */ + break; + + case 194: +#line 746 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 0))); } +#line 3297 "grammar.c" /* yacc.c:1646 */ + break; + + case 195: +#line 747 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 1))); } +#line 3303 "grammar.c" /* yacc.c:1646 */ + break; + + case 196: +#line 748 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } +#line 3309 "grammar.c" /* yacc.c:1646 */ + break; + + case 197: +#line 750 "grammar.y" /* yacc.c:1646 */ + { + (yyval.blk).atmfieldtype = (yyvsp[-1].blk).atmfieldtype; + if ((yyval.blk).atmfieldtype == A_VPI || + (yyval.blk).atmfieldtype == A_VCI) + CHECK_PTR_VAL(((yyval.blk).b = gen_atmfield_code(cstate, (yyval.blk).atmfieldtype, (bpf_int32) (yyvsp[0].i), BPF_JEQ, 0))); + } +#line 3320 "grammar.c" /* yacc.c:1646 */ + break; + + case 199: +#line 758 "grammar.y" /* yacc.c:1646 */ + { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 3326 "grammar.c" /* yacc.c:1646 */ + break; + + case 200: +#line 761 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = M_FISU; } +#line 3332 "grammar.c" /* yacc.c:1646 */ + break; + + case 201: +#line 762 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = M_LSSU; } +#line 3338 "grammar.c" /* yacc.c:1646 */ + break; + + case 202: +#line 763 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = M_MSU; } +#line 3344 "grammar.c" /* yacc.c:1646 */ + break; + + case 203: +#line 764 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = MH_FISU; } +#line 3350 "grammar.c" /* yacc.c:1646 */ + break; + + case 204: +#line 765 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = MH_LSSU; } +#line 3356 "grammar.c" /* yacc.c:1646 */ + break; + + case 205: +#line 766 "grammar.y" /* yacc.c:1646 */ + { (yyval.i) = MH_MSU; } +#line 3362 "grammar.c" /* yacc.c:1646 */ + break; + + case 206: +#line 769 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = M_SIO; } +#line 3368 "grammar.c" /* yacc.c:1646 */ + break; + + case 207: +#line 770 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = M_OPC; } +#line 3374 "grammar.c" /* yacc.c:1646 */ + break; + + case 208: +#line 771 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = M_DPC; } +#line 3380 "grammar.c" /* yacc.c:1646 */ + break; + + case 209: +#line 772 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = M_SLS; } +#line 3386 "grammar.c" /* yacc.c:1646 */ + break; + + case 210: +#line 773 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = MH_SIO; } +#line 3392 "grammar.c" /* yacc.c:1646 */ + break; + + case 211: +#line 774 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = MH_OPC; } +#line 3398 "grammar.c" /* yacc.c:1646 */ + break; + + case 212: +#line 775 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = MH_DPC; } +#line 3404 "grammar.c" /* yacc.c:1646 */ + break; + + case 213: +#line 776 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).mtp3fieldtype = MH_SLS; } +#line 3410 "grammar.c" /* yacc.c:1646 */ + break; + + case 215: +#line 779 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 0))); } +#line 3416 "grammar.c" /* yacc.c:1646 */ + break; + + case 216: +#line 780 "grammar.y" /* yacc.c:1646 */ + { CHECK_PTR_VAL(((yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 1))); } +#line 3422 "grammar.c" /* yacc.c:1646 */ + break; + + case 217: +#line 781 "grammar.y" /* yacc.c:1646 */ + { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } +#line 3428 "grammar.c" /* yacc.c:1646 */ + break; + + case 218: +#line 783 "grammar.y" /* yacc.c:1646 */ + { + (yyval.blk).mtp3fieldtype = (yyvsp[-1].blk).mtp3fieldtype; + if ((yyval.blk).mtp3fieldtype == M_SIO || + (yyval.blk).mtp3fieldtype == M_OPC || + (yyval.blk).mtp3fieldtype == M_DPC || + (yyval.blk).mtp3fieldtype == M_SLS || + (yyval.blk).mtp3fieldtype == MH_SIO || + (yyval.blk).mtp3fieldtype == MH_OPC || + (yyval.blk).mtp3fieldtype == MH_DPC || + (yyval.blk).mtp3fieldtype == MH_SLS) + CHECK_PTR_VAL(((yyval.blk).b = gen_mtp3field_code(cstate, (yyval.blk).mtp3fieldtype, (u_int) (yyvsp[0].i), BPF_JEQ, 0))); + } +#line 3445 "grammar.c" /* yacc.c:1646 */ + break; + + case 220: +#line 797 "grammar.y" /* yacc.c:1646 */ + { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } +#line 3451 "grammar.c" /* yacc.c:1646 */ + break; + + +#line 3455 "grammar.c" /* yacc.c:1646 */ + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (yyscanner, cstate, YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yyscanner, cstate, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, yyscanner, cstate); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yyscanner, cstate); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (yyscanner, cstate, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, yyscanner, cstate); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, yyscanner, cstate); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +#line 799 "grammar.y" /* yacc.c:1906 */ + diff --git a/libraries/cmake/source/libpcap/generated/grammar.h b/libraries/cmake/source/libpcap/generated/grammar.h new file mode 100644 index 00000000000..a538f42a52a --- /dev/null +++ b/libraries/cmake/source/libpcap/generated/grammar.h @@ -0,0 +1,324 @@ +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + 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 3 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +#ifndef YY_PCAP_GRAMMAR_H_INCLUDED +# define YY_PCAP_GRAMMAR_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int pcap_debug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + DST = 258, + SRC = 259, + HOST = 260, + GATEWAY = 261, + NET = 262, + NETMASK = 263, + PORT = 264, + PORTRANGE = 265, + LESS = 266, + GREATER = 267, + PROTO = 268, + PROTOCHAIN = 269, + CBYTE = 270, + ARP = 271, + RARP = 272, + IP = 273, + SCTP = 274, + TCP = 275, + UDP = 276, + ICMP = 277, + IGMP = 278, + IGRP = 279, + PIM = 280, + VRRP = 281, + CARP = 282, + ATALK = 283, + AARP = 284, + DECNET = 285, + LAT = 286, + SCA = 287, + MOPRC = 288, + MOPDL = 289, + TK_BROADCAST = 290, + TK_MULTICAST = 291, + NUM = 292, + INBOUND = 293, + OUTBOUND = 294, + PF_IFNAME = 295, + PF_RSET = 296, + PF_RNR = 297, + PF_SRNR = 298, + PF_REASON = 299, + PF_ACTION = 300, + TYPE = 301, + SUBTYPE = 302, + DIR = 303, + ADDR1 = 304, + ADDR2 = 305, + ADDR3 = 306, + ADDR4 = 307, + RA = 308, + TA = 309, + LINK = 310, + GEQ = 311, + LEQ = 312, + NEQ = 313, + ID = 314, + EID = 315, + HID = 316, + HID6 = 317, + AID = 318, + LSH = 319, + RSH = 320, + LEN = 321, + IPV6 = 322, + ICMPV6 = 323, + AH = 324, + ESP = 325, + VLAN = 326, + MPLS = 327, + PPPOED = 328, + PPPOES = 329, + GENEVE = 330, + ISO = 331, + ESIS = 332, + CLNP = 333, + ISIS = 334, + L1 = 335, + L2 = 336, + IIH = 337, + LSP = 338, + SNP = 339, + CSNP = 340, + PSNP = 341, + STP = 342, + IPX = 343, + NETBEUI = 344, + LANE = 345, + LLC = 346, + METAC = 347, + BCC = 348, + SC = 349, + ILMIC = 350, + OAMF4EC = 351, + OAMF4SC = 352, + OAM = 353, + OAMF4 = 354, + CONNECTMSG = 355, + METACONNECT = 356, + VPI = 357, + VCI = 358, + RADIO = 359, + FISU = 360, + LSSU = 361, + MSU = 362, + HFISU = 363, + HLSSU = 364, + HMSU = 365, + SIO = 366, + OPC = 367, + DPC = 368, + SLS = 369, + HSIO = 370, + HOPC = 371, + HDPC = 372, + HSLS = 373, + LEX_ERROR = 374, + OR = 375, + AND = 376, + UMINUS = 377 + }; +#endif +/* Tokens. */ +#define DST 258 +#define SRC 259 +#define HOST 260 +#define GATEWAY 261 +#define NET 262 +#define NETMASK 263 +#define PORT 264 +#define PORTRANGE 265 +#define LESS 266 +#define GREATER 267 +#define PROTO 268 +#define PROTOCHAIN 269 +#define CBYTE 270 +#define ARP 271 +#define RARP 272 +#define IP 273 +#define SCTP 274 +#define TCP 275 +#define UDP 276 +#define ICMP 277 +#define IGMP 278 +#define IGRP 279 +#define PIM 280 +#define VRRP 281 +#define CARP 282 +#define ATALK 283 +#define AARP 284 +#define DECNET 285 +#define LAT 286 +#define SCA 287 +#define MOPRC 288 +#define MOPDL 289 +#define TK_BROADCAST 290 +#define TK_MULTICAST 291 +#define NUM 292 +#define INBOUND 293 +#define OUTBOUND 294 +#define PF_IFNAME 295 +#define PF_RSET 296 +#define PF_RNR 297 +#define PF_SRNR 298 +#define PF_REASON 299 +#define PF_ACTION 300 +#define TYPE 301 +#define SUBTYPE 302 +#define DIR 303 +#define ADDR1 304 +#define ADDR2 305 +#define ADDR3 306 +#define ADDR4 307 +#define RA 308 +#define TA 309 +#define LINK 310 +#define GEQ 311 +#define LEQ 312 +#define NEQ 313 +#define ID 314 +#define EID 315 +#define HID 316 +#define HID6 317 +#define AID 318 +#define LSH 319 +#define RSH 320 +#define LEN 321 +#define IPV6 322 +#define ICMPV6 323 +#define AH 324 +#define ESP 325 +#define VLAN 326 +#define MPLS 327 +#define PPPOED 328 +#define PPPOES 329 +#define GENEVE 330 +#define ISO 331 +#define ESIS 332 +#define CLNP 333 +#define ISIS 334 +#define L1 335 +#define L2 336 +#define IIH 337 +#define LSP 338 +#define SNP 339 +#define CSNP 340 +#define PSNP 341 +#define STP 342 +#define IPX 343 +#define NETBEUI 344 +#define LANE 345 +#define LLC 346 +#define METAC 347 +#define BCC 348 +#define SC 349 +#define ILMIC 350 +#define OAMF4EC 351 +#define OAMF4SC 352 +#define OAM 353 +#define OAMF4 354 +#define CONNECTMSG 355 +#define METACONNECT 356 +#define VPI 357 +#define VCI 358 +#define RADIO 359 +#define FISU 360 +#define LSSU 361 +#define MSU 362 +#define HFISU 363 +#define HLSSU 364 +#define HMSU 365 +#define SIO 366 +#define OPC 367 +#define DPC 368 +#define SLS 369 +#define HSIO 370 +#define HOPC 371 +#define HDPC 372 +#define HSLS 373 +#define LEX_ERROR 374 +#define OR 375 +#define AND 376 +#define UMINUS 377 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 291 "grammar.y" /* yacc.c:1909 */ + + int i; + bpf_u_int32 h; + char *s; + struct stmt *stmt; + struct arth *a; + struct { + struct qual q; + int atmfieldtype; + int mtp3fieldtype; + struct block *b; + } blk; + struct block *rblk; + +#line 313 "grammar.h" /* yacc.c:1909 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +int pcap_parse (void *yyscanner, compiler_state_t *cstate); + +#endif /* !YY_PCAP_GRAMMAR_H_INCLUDED */ diff --git a/libraries/cmake/source/libpcap/generated/scanner.c b/libraries/cmake/source/libpcap/generated/scanner.c new file mode 100644 index 00000000000..f7ee775bc83 --- /dev/null +++ b/libraries/cmake/source/libpcap/generated/scanner.c @@ -0,0 +1,5396 @@ +#line 2 "scanner.c" +/* Must come first for _LARGE_FILE_API on AIX. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +/* + * Must come first to avoid warnings on Windows. + * + * Flex-generated scanners may only include if __STDC_VERSION__ + * is defined with a value >= 199901, meaning "full C99", and MSVC may not + * define it with that value, because it isn't 100% C99-compliant, even + * though it has an capable of defining everything the Flex + * scanner needs. + * + * We, however, will include it if we know we have an MSVC version that has + * it; this means that we may define the INTn_MAX and UINTn_MAX values in + * scanner.c, and then include , which may define them differently + * (same value, but different string of characters), causing compiler warnings. + * + * If we include it here, and they're defined, that'll prevent scanner.c + * from defining them. So we include , to get + * if we have it. + */ +#include + +#include "diag-control.h" + +#line 30 "scanner.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE pcap_restart(yyin ,yyscanner ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via pcap_restart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void pcap_restart (FILE *input_file ,yyscan_t yyscanner ); +void pcap__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void pcap__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void pcap__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void pcap_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void pcap_pop_buffer_state (yyscan_t yyscanner ); + +static void pcap_ensure_buffer_stack (yyscan_t yyscanner ); +static void pcap__load_buffer_state (yyscan_t yyscanner ); +static void pcap__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + +#define YY_FLUSH_BUFFER pcap__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + +YY_BUFFER_STATE pcap__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); + +void *pcap_alloc (yy_size_t ,yyscan_t yyscanner ); +void *pcap_realloc (void *,yy_size_t ,yyscan_t yyscanner ); +void pcap_free (void * ,yyscan_t yyscanner ); + +#define yy_new_buffer pcap__create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + pcap_ensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + pcap__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + pcap_ensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + pcap__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define pcap_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static int yy_get_next_buffer (yyscan_t yyscanner ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif +static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 183 +#define YY_END_OF_BUFFER 184 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[1724] = + { 0, + 0, 0, 184, 182, 113, 113, 114, 182, 114, 114, + 123, 123, 114, 114, 114, 114, 180, 180, 182, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 114, + 117, 121, 67, 0, 180, 123, 0, 180, 180, 180, + 0, 125, 119, 116, 118, 115, 120, 180, 181, 180, + 180, 180, 20, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 7, 180, 34, 35, + + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 92, 180, 68, 180, 180, 180, + 180, 180, 180, 60, 180, 180, 180, 180, 86, 180, + 180, 180, 180, 180, 180, 61, 180, 4, 180, 180, + 180, 180, 180, 180, 180, 68, 121, 180, 124, 124, + 180, 123, 180, 0, 125, 123, 125, 125, 125, 180, + 180, 180, 67, 5, 180, 81, 180, 180, 180, 180, + 180, 180, 180, 55, 107, 1, 0, 180, 21, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 36, 180, 180, + + 18, 43, 0, 180, 29, 180, 25, 70, 180, 180, + 79, 37, 180, 100, 180, 180, 180, 180, 101, 180, + 46, 69, 82, 106, 180, 14, 180, 3, 180, 180, + 180, 180, 180, 94, 180, 180, 26, 180, 105, 180, + 108, 38, 2, 180, 42, 180, 9, 180, 10, 89, + 180, 88, 180, 180, 0, 180, 180, 124, 180, 180, + 180, 180, 123, 0, 180, 0, 126, 125, 125, 0, + 125, 0, 125, 0, 125, 0, 23, 180, 180, 180, + 180, 64, 16, 41, 180, 39, 180, 180, 180, 30, + 180, 98, 180, 180, 180, 111, 180, 180, 104, 110, + + 45, 109, 112, 11, 180, 12, 13, 180, 180, 180, + 32, 78, 180, 62, 3, 99, 47, 180, 180, 180, + 74, 180, 180, 180, 180, 48, 180, 180, 40, 180, + 6, 180, 93, 180, 8, 95, 180, 180, 0, 180, + 53, 73, 15, 180, 124, 124, 180, 124, 124, 124, + 180, 123, 180, 0, 125, 180, 0, 0, 125, 0, + 125, 126, 125, 0, 0, 0, 0, 125, 125, 125, + 125, 125, 0, 180, 56, 57, 58, 59, 180, 22, + 180, 180, 180, 180, 31, 180, 180, 180, 102, 103, + 0, 19, 180, 180, 180, 87, 180, 33, 180, 80, + + 28, 27, 180, 180, 83, 180, 180, 180, 50, 17, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 0, 180, 180, 124, 180, 180, + 180, 180, 124, 124, 180, 123, 180, 0, 0, 125, + 125, 125, 0, 0, 126, 125, 125, 126, 125, 0, + 0, 125, 125, 125, 125, 125, 0, 0, 0, 0, + 125, 125, 0, 125, 0, 125, 0, 97, 180, 180, + 180, 24, 180, 180, 77, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 0, 180, 180, 180, 180, 180, + 70, 180, 180, 180, 180, 180, 180, 180, 75, 76, + + 180, 96, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 124, 124, 180, 124, + 124, 124, 124, 180, 123, 180, 0, 125, 125, 0, + 125, 0, 0, 125, 0, 125, 126, 125, 0, 0, + 0, 125, 125, 0, 125, 126, 125, 0, 0, 0, + 0, 0, 0, 0, 125, 125, 125, 125, 125, 0, + 180, 180, 180, 180, 52, 63, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 71, 180, 180, + 44, 84, 85, 180, 180, 180, 180, 54, 176, 179, + + 178, 172, 180, 174, 173, 177, 180, 0, 180, 180, + 124, 180, 180, 180, 124, 180, 123, 180, 0, 0, + 125, 125, 125, 125, 125, 125, 0, 0, 126, 125, + 125, 125, 0, 0, 125, 125, 125, 125, 125, 0, + 0, 0, 0, 0, 0, 0, 125, 125, 125, 125, + 125, 0, 0, 0, 0, 0, 125, 125, 0, 125, + 0, 125, 0, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 128, 127, + 180, 180, 72, 180, 180, 180, 175, 171, 180, 180, + + 124, 124, 124, 124, 180, 123, 180, 0, 125, 125, + 0, 125, 125, 0, 125, 0, 0, 125, 0, 125, + 126, 125, 0, 0, 0, 125, 125, 0, 125, 126, + 125, 0, 0, 0, 0, 0, 125, 125, 0, 125, + 126, 125, 0, 125, 125, 0, 0, 0, 0, 0, + 0, 0, 125, 125, 125, 125, 125, 0, 65, 180, + 55, 133, 140, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 145, 144, 180, 66, 49, 180, 180, 0, 180, + 180, 180, 180, 180, 123, 180, 0, 0, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 0, 0, 126, + 125, 125, 125, 0, 0, 125, 125, 125, 125, 125, + 0, 0, 0, 0, 0, 0, 0, 125, 125, 125, + 125, 125, 0, 125, 125, 0, 0, 0, 0, 0, + 0, 0, 125, 125, 125, 125, 125, 0, 0, 0, + 0, 0, 0, 125, 125, 0, 125, 0, 125, 0, + 90, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 146, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 51, 122, 122, 124, 124, 180, 123, 180, + 0, 125, 125, 0, 125, 125, 0, 125, 125, 0, + + 125, 0, 122, 125, 0, 125, 126, 125, 0, 0, + 0, 125, 125, 0, 125, 126, 125, 0, 0, 0, + 0, 0, 125, 125, 0, 125, 126, 125, 0, 0, + 0, 0, 0, 0, 125, 125, 0, 125, 126, 125, + 0, 125, 125, 125, 0, 0, 0, 0, 0, 0, + 0, 125, 125, 125, 125, 125, 0, 180, 180, 180, + 180, 180, 180, 180, 180, 138, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 91, 122, 122, + 124, 180, 122, 122, 0, 0, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 0, 122, + + 126, 125, 125, 125, 0, 0, 125, 125, 125, 125, + 125, 0, 0, 0, 0, 0, 0, 0, 125, 125, + 125, 125, 125, 0, 125, 125, 0, 0, 0, 0, + 0, 0, 0, 125, 125, 125, 125, 125, 0, 125, + 125, 125, 0, 0, 0, 0, 0, 0, 0, 125, + 125, 125, 125, 125, 0, 0, 0, 0, 0, 0, + 125, 125, 0, 125, 0, 125, 0, 180, 180, 180, + 142, 180, 180, 180, 180, 180, 180, 180, 130, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 124, + 180, 123, 0, 125, 125, 0, 125, 125, 0, 125, + + 125, 0, 125, 125, 0, 125, 0, 0, 0, 125, + 0, 0, 125, 126, 125, 0, 0, 0, 125, 125, + 0, 125, 126, 125, 0, 0, 0, 0, 0, 125, + 125, 0, 125, 126, 125, 0, 0, 0, 0, 0, + 0, 125, 125, 0, 125, 126, 125, 0, 0, 0, + 0, 0, 0, 125, 125, 0, 125, 126, 125, 0, + 125, 125, 125, 0, 0, 0, 0, 0, 0, 0, + 125, 125, 125, 125, 125, 0, 180, 180, 180, 180, + 132, 180, 180, 180, 136, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 122, 0, + + 0, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 0, 0, 0, 126, + 0, 0, 125, 0, 0, 125, 125, 125, 0, 0, + 0, 0, 0, 0, 0, 125, 125, 125, 0, 125, + 125, 0, 0, 0, 0, 0, 0, 0, 125, 125, + 125, 0, 125, 125, 125, 0, 0, 0, 0, 0, + 0, 0, 125, 125, 125, 0, 125, 125, 125, 0, + 0, 0, 0, 0, 0, 0, 125, 125, 125, 0, + 0, 0, 0, 0, 0, 125, 125, 0, 125, 0, + 125, 0, 129, 141, 143, 137, 180, 180, 180, 180, + + 180, 180, 180, 180, 180, 180, 180, 180, 155, 180, + 180, 180, 0, 0, 125, 0, 125, 0, 125, 125, + 0, 125, 125, 0, 125, 125, 0, 125, 125, 0, + 125, 0, 0, 0, 0, 125, 125, 0, 125, 0, + 0, 125, 125, 125, 0, 0, 0, 0, 125, 125, + 125, 0, 0, 0, 0, 0, 125, 125, 125, 0, + 0, 0, 0, 0, 125, 125, 125, 0, 0, 0, + 0, 0, 125, 125, 125, 125, 125, 125, 0, 0, + 0, 0, 0, 0, 0, 125, 125, 125, 0, 180, + 180, 180, 180, 180, 180, 147, 180, 180, 180, 180, + + 180, 180, 180, 180, 180, 180, 0, 0, 0, 125, + 125, 125, 125, 125, 125, 0, 0, 0, 0, 125, + 125, 0, 0, 0, 0, 125, 125, 125, 0, 0, + 0, 0, 0, 125, 125, 125, 125, 0, 0, 0, + 0, 0, 125, 125, 125, 125, 0, 0, 0, 0, + 0, 125, 125, 125, 125, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 0, 0, 125, 125, 125, 180, + 180, 180, 139, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 125, 125, 125, 125, + 125, 125, 125, 125, 0, 0, 0, 0, 125, 125, + + 0, 0, 125, 0, 0, 0, 125, 0, 0, 0, + 125, 0, 0, 0, 125, 0, 0, 0, 125, 125, + 125, 125, 0, 0, 0, 0, 0, 125, 134, 180, + 131, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 156, 180, 125, 0, 0, 125, 125, 0, + 125, 125, 125, 0, 125, 125, 125, 0, 125, 125, + 125, 0, 125, 125, 125, 0, 0, 0, 0, 125, + 135, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 152, 180, 125, 125, 0, 0, 0, 0, 0, + 0, 125, 125, 125, 0, 180, 180, 180, 180, 180, + + 180, 180, 180, 180, 180, 180, 151, 0, 125, 125, + 125, 125, 125, 0, 167, 180, 180, 180, 180, 180, + 180, 180, 154, 180, 180, 125, 125, 166, 180, 180, + 180, 180, 180, 180, 153, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 165, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 164, 180, 180, 180, 180, 180, 170, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 157, 180, + 180, 180, 180, 180, 150, 180, 180, 168, 180, 180, + + 180, 180, 180, 180, 148, 180, 169, 180, 163, 180, + 180, 180, 180, 158, 180, 160, 180, 180, 162, 159, + 149, 161, 0 + } ; + +static yyconst YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 1, 1, 6, 7, 8, 1, 9, + 9, 7, 7, 1, 10, 11, 7, 12, 13, 14, + 15, 16, 17, 18, 17, 17, 17, 19, 1, 20, + 21, 22, 1, 1, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 25, 24, 24, + 7, 26, 7, 7, 27, 1, 28, 29, 30, 31, + + 32, 33, 34, 35, 36, 24, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 24, 1, 52, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst YY_CHAR yy_meta[53] = + { 0, + 1, 2, 2, 1, 2, 1, 1, 1, 2, 3, + 4, 5, 5, 5, 5, 5, 5, 5, 6, 1, + 1, 1, 7, 3, 8, 1, 3, 7, 7, 7, + 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, + 3, 1 + } ; + +static yyconst flex_uint16_t yy_base[2184] = + { 0, + 0, 0, 6066, 7626, 7626, 7626, 6044, 0, 7626, 6056, + 43, 70, 6044, 43, 6040, 75, 110, 151, 0, 70, + 85, 102, 67, 61, 77, 105, 113, 155, 158, 170, + 70, 176, 165, 110, 189, 148, 6025, 184, 6016, 6001, + 7626, 0, 7626, 225, 247, 270, 6030, 293, 0, 300, + 0, 322, 7626, 7626, 7626, 7626, 7626, 344, 0, 6003, + 6000, 6013, 0, 6008, 5996, 6007, 6001, 5986, 5960, 5946, + 5947, 5946, 5939, 5948, 5923, 5926, 5906, 284, 5907, 5907, + 5875, 5868, 5857, 5849, 5816, 5811, 5801, 5794, 89, 81, + 5765, 5752, 109, 5704, 5698, 5705, 123, 211, 0, 0, + + 99, 168, 5686, 5695, 204, 5676, 5656, 5659, 5635, 5624, + 5610, 5600, 5591, 5597, 0, 5584, 0, 5567, 5573, 5567, + 5568, 5567, 5567, 200, 5549, 5532, 5543, 5536, 131, 5532, + 327, 5519, 194, 5518, 5530, 0, 5513, 0, 5510, 5509, + 5514, 5488, 5479, 5467, 5482, 7626, 7626, 363, 386, 180, + 426, 449, 472, 5475, 479, 5482, 502, 241, 5472, 5446, + 5430, 5421, 0, 0, 5426, 0, 5435, 5430, 5419, 5413, + 5414, 5374, 5375, 5382, 0, 0, 5377, 5366, 0, 5378, + 5373, 5346, 5360, 5359, 5362, 5358, 5342, 5325, 5321, 5337, + 5319, 5304, 5299, 5300, 5294, 5277, 5257, 0, 5262, 5254, + + 0, 0, 5258, 5216, 0, 5226, 0, 5222, 5191, 5196, + 0, 0, 5166, 0, 5175, 5182, 201, 5163, 0, 5146, + 5161, 0, 5156, 0, 5138, 0, 5120, 5123, 5116, 5101, + 5085, 5076, 5053, 0, 5051, 5062, 0, 5051, 0, 5018, + 0, 0, 0, 5013, 0, 223, 240, 5023, 0, 0, + 5014, 0, 5011, 5001, 541, 5010, 563, 586, 5006, 593, + 352, 260, 616, 4996, 639, 4995, 4994, 647, 271, 4982, + 4961, 408, 687, 709, 4960, 0, 0, 4936, 374, 4937, + 4930, 0, 0, 0, 4927, 0, 4924, 4925, 4908, 0, + 4908, 0, 4900, 4900, 4901, 0, 4886, 4853, 0, 0, + + 0, 0, 0, 519, 4858, 0, 0, 4865, 4847, 4830, + 0, 0, 4825, 0, 0, 0, 0, 4825, 4789, 4790, + 0, 4783, 4765, 4780, 4751, 4727, 4737, 4726, 0, 4708, + 0, 4707, 0, 250, 0, 0, 4699, 4693, 715, 4688, + 0, 0, 0, 753, 776, 272, 816, 4714, 4712, 360, + 838, 861, 884, 4702, 891, 415, 4683, 4681, 913, 526, + 936, 958, 4661, 0, 4660, 423, 511, 981, 4658, 1004, + 294, 4657, 4664, 4602, 0, 0, 0, 0, 4596, 0, + 4609, 4586, 4548, 4528, 0, 4543, 4537, 4517, 0, 0, + 1023, 516, 4506, 4494, 4497, 0, 4487, 0, 4491, 4483, + + 0, 0, 4492, 4457, 515, 4455, 4456, 73, 4451, 0, + 4439, 4431, 4407, 4381, 4373, 4360, 4340, 4356, 4349, 4320, + 4320, 4311, 4299, 4314, 1059, 4328, 1081, 1104, 4313, 1111, + 669, 313, 1134, 324, 1173, 1195, 1218, 4295, 4286, 1226, + 357, 4257, 4198, 4197, 4194, 1266, 358, 4193, 4160, 663, + 683, 1306, 4159, 1329, 420, 4155, 4161, 4135, 737, 0, + 394, 4134, 798, 1369, 1391, 4131, 0, 0, 4104, 4088, + 4065, 0, 4055, 4039, 0, 4043, 4056, 4009, 4022, 4020, + 703, 4005, 728, 3990, 1008, 3987, 3974, 3993, 3981, 3960, + 0, 3948, 3958, 3949, 3954, 3942, 3911, 3908, 0, 0, + + 3911, 0, 3906, 3898, 3900, 3879, 3869, 3860, 3860, 3850, + 3807, 3804, 3806, 3787, 3786, 1415, 1438, 421, 1478, 3779, + 3765, 684, 1501, 1524, 1531, 1554, 3739, 1561, 1584, 1606, + 3737, 3734, 3689, 1628, 805, 1651, 1673, 3668, 0, 1156, + 0, 571, 3646, 1163, 1696, 1718, 3644, 0, 747, 750, + 3651, 601, 813, 832, 1741, 3625, 1764, 425, 3624, 3631, + 490, 3594, 3581, 3577, 0, 0, 3563, 3565, 3533, 3532, + 3544, 3526, 3506, 3494, 3485, 3484, 3476, 3476, 3463, 3448, + 227, 998, 1009, 3455, 3441, 3429, 3411, 0, 3398, 3371, + 0, 0, 0, 3384, 3362, 3367, 3353, 0, 0, 0, + + 0, 0, 3357, 0, 0, 0, 3346, 1803, 3358, 1825, + 1848, 3356, 1855, 330, 1878, 1901, 1908, 1931, 3347, 3346, + 1939, 426, 3343, 1979, 449, 3342, 3324, 3323, 3321, 2019, + 498, 3320, 1031, 1035, 2059, 3319, 2082, 538, 3318, 3295, + 1053, 1055, 3294, 3290, 1172, 1236, 2122, 3262, 2145, 564, + 3261, 3267, 1250, 0, 1257, 0, 624, 3237, 1288, 2185, + 2207, 3236, 0, 2229, 301, 407, 302, 246, 1012, 522, + 700, 3191, 539, 19, 538, 661, 569, 790, 650, 682, + 406, 757, 1015, 834, 887, 454, 999, 1054, 3189, 3188, + 1168, 3186, 3184, 1214, 1017, 571, 3166, 3164, 2266, 2289, + + 2311, 2346, 617, 2369, 625, 2377, 2400, 3178, 2407, 2430, + 2452, 3168, 2475, 2497, 3167, 3163, 3133, 2519, 1295, 2542, + 2564, 3130, 0, 1351, 0, 1119, 3105, 1358, 2587, 2609, + 3104, 0, 1460, 0, 1467, 0, 1142, 3103, 1786, 2632, + 2654, 3093, 0, 706, 1793, 3078, 1303, 1366, 3075, 3071, + 1385, 1415, 2677, 3052, 2700, 752, 3042, 3048, 518, 854, + 663, 1172, 1305, 1368, 1949, 1476, 907, 832, 930, 1974, + 702, 1477, 1803, 951, 1950, 1951, 1953, 974, 953, 1990, + 1993, 769, 831, 952, 997, 1074, 2013, 2018, 2741, 1127, + 2763, 1407, 2785, 2046, 2808, 2831, 3037, 3005, 2839, 810, + + 3004, 2879, 860, 3001, 2919, 861, 2986, 2985, 2983, 2964, + 2959, 862, 2961, 1600, 2016, 2999, 2960, 3022, 888, 2927, + 2932, 2054, 2056, 2930, 2929, 2092, 2097, 3062, 2920, 3085, + 978, 2908, 2895, 1058, 2111, 2892, 2119, 2155, 2890, 2889, + 2156, 2160, 3125, 2880, 3148, 1081, 2868, 2855, 0, 2174, + 0, 2251, 0, 1486, 2846, 2318, 3188, 3210, 2844, 0, + 1188, 1323, 1432, 1577, 2184, 1578, 1802, 1621, 1622, 2243, + 1645, 2244, 2058, 1666, 1689, 2155, 2329, 1870, 2710, 2246, + 1668, 2202, 1384, 3234, 3256, 3279, 1082, 3318, 3341, 3364, + 2842, 3371, 3394, 3416, 2841, 3439, 3461, 2840, 3484, 3506, + + 2815, 2813, 2811, 3528, 2328, 3551, 3573, 2810, 0, 2335, + 0, 1539, 2790, 2726, 3596, 3618, 2786, 0, 2861, 0, + 2868, 0, 1863, 2766, 2901, 3641, 3663, 2728, 0, 0, + 2908, 0, 2941, 0, 1916, 2708, 2948, 3686, 3708, 2707, + 0, 0, 1108, 2981, 2713, 2263, 2266, 2692, 2691, 2446, + 2491, 3731, 2682, 3754, 1110, 2680, 2686, 2245, 2328, 2958, + 2327, 1712, 2738, 2976, 1711, 2998, 2725, 1734, 1758, 1757, + 2777, 1818, 1955, 1431, 2694, 1871, 3016, 1956, 1995, 2121, + 3795, 3818, 3827, 2222, 2660, 2659, 3844, 1167, 2655, 3884, + 1169, 2637, 3924, 1170, 2635, 3964, 1301, 2616, 2614, 2592, + + 4003, 4026, 1306, 2572, 2711, 2738, 4066, 2570, 4089, 1365, + 2569, 2558, 2956, 2996, 2555, 2553, 3033, 3037, 4129, 2527, + 4152, 1412, 2525, 2513, 1475, 3051, 2510, 3059, 3095, 2508, + 2488, 3096, 3100, 4192, 2478, 4215, 1477, 2460, 2465, 0, + 1501, 3114, 2463, 3122, 3158, 2462, 2441, 3159, 3163, 4255, + 2413, 4278, 1503, 2412, 2418, 0, 3177, 0, 3301, 0, + 1962, 2409, 3308, 4318, 4340, 2408, 0, 3158, 3764, 3765, + 2223, 3078, 3317, 2283, 3204, 2735, 2423, 2424, 2224, 3768, + 3318, 2445, 2282, 3837, 2490, 3839, 2468, 2513, 3771, 4364, + 4387, 4396, 2384, 4412, 4435, 4457, 2383, 4480, 4502, 2380, + + 4525, 4547, 2349, 4570, 4592, 2348, 2347, 4615, 1530, 2296, + 2289, 3869, 4655, 2212, 2209, 0, 3906, 0, 1995, 2208, + 3913, 4678, 2188, 2164, 0, 3946, 0, 3953, 0, 2005, + 2160, 3986, 4701, 2153, 2130, 0, 0, 3993, 0, 4048, + 0, 2035, 2101, 4055, 4724, 2100, 2097, 0, 0, 4111, + 0, 4118, 0, 2385, 2067, 4174, 4747, 2064, 2037, 0, + 0, 1531, 4181, 2014, 3204, 3410, 2010, 2008, 3455, 3500, + 4770, 1996, 4793, 1532, 1960, 1964, 2512, 2535, 2557, 2580, + 2558, 2604, 4225, 2602, 2603, 4209, 2800, 4288, 3838, 4272, + 3861, 4002, 4065, 4608, 3843, 2626, 2648, 4609, 4834, 1955, + + 4850, 4873, 1558, 1915, 4913, 1602, 1914, 4953, 1648, 1913, + 4993, 1695, 1911, 5033, 1715, 1910, 1909, 4241, 5073, 1880, + 1806, 0, 1804, 3769, 4002, 5096, 1767, 1747, 1707, 4063, + 4126, 1706, 1686, 4189, 4250, 5119, 1658, 1652, 1622, 1738, + 4304, 1619, 4314, 4334, 1617, 1615, 4406, 4407, 5142, 1587, + 1567, 1574, 0, 1797, 4639, 1541, 4409, 4411, 1511, 1510, + 4451, 4496, 5165, 1480, 1479, 1446, 0, 1799, 4646, 121, + 4541, 4803, 145, 164, 4804, 4806, 5188, 168, 308, 373, + 0, 4820, 0, 4895, 0, 3038, 393, 4902, 5211, 0, + 450, 0, 2649, 2671, 2757, 2779, 2801, 4803, 4830, 4912, + + 4128, 3124, 4191, 4317, 3226, 4831, 4930, 4411, 2780, 3250, + 4832, 4924, 5234, 1802, 0, 505, 5274, 0, 532, 5297, + 0, 548, 5320, 0, 568, 5343, 0, 600, 5366, 0, + 618, 4849, 4910, 5389, 619, 621, 622, 657, 650, 4975, + 0, 3264, 672, 673, 4982, 0, 5015, 0, 3379, 692, + 755, 0, 5022, 0, 5055, 0, 3777, 759, 761, 0, + 5062, 0, 5256, 0, 3778, 779, 818, 0, 5263, 0, + 5411, 0, 3782, 821, 864, 0, 1826, 5418, 904, 5070, + 5271, 905, 924, 5426, 5427, 5467, 918, 0, 945, 5072, + 3410, 3455, 3249, 3272, 5429, 2878, 3387, 3432, 3454, 5430, + + 3499, 5431, 5432, 3409, 4313, 5433, 5490, 939, 983, 0, + 0, 0, 0, 0, 0, 5432, 0, 4230, 986, 987, + 0, 5442, 5462, 1014, 1015, 0, 1850, 5512, 1046, 5464, + 5506, 1068, 1091, 0, 0, 1852, 5520, 1125, 5528, 5529, + 1144, 1145, 0, 0, 1854, 5529, 1182, 5537, 5538, 1210, + 1237, 0, 0, 1993, 5552, 1239, 5546, 5547, 1241, 1242, + 0, 0, 5568, 0, 5577, 0, 4231, 1268, 0, 4927, + 5588, 5590, 2918, 3500, 5589, 5592, 5593, 5594, 5595, 5591, + 3545, 5596, 3567, 5273, 5599, 3522, 0, 7626, 0, 0, + 0, 0, 0, 0, 5622, 5624, 1277, 1279, 0, 7626, + + 5627, 0, 7626, 0, 5638, 0, 7626, 0, 5645, 0, + 7626, 0, 5652, 0, 7626, 0, 5663, 0, 7626, 0, + 2030, 5670, 1281, 5678, 5679, 1282, 4293, 0, 3544, 5681, + 3589, 3590, 5682, 5685, 5686, 3611, 5687, 5688, 3613, 5683, + 5690, 5695, 3656, 5684, 0, 5730, 0, 2059, 5737, 1316, + 0, 2093, 5744, 1319, 0, 2096, 5751, 1378, 0, 2159, + 5758, 1382, 0, 2347, 5765, 1402, 0, 5772, 0, 7626, + 3657, 5689, 3658, 3680, 3702, 5781, 5783, 5784, 5696, 3703, + 5785, 3679, 5786, 2348, 5785, 1425, 0, 0, 0, 0, + 0, 0, 2376, 5802, 1428, 5795, 5797, 5697, 5796, 3724, + + 5815, 3725, 4083, 5817, 5818, 5821, 3701, 0, 0, 0, + 0, 0, 0, 0, 3790, 5824, 4254, 4563, 5825, 5826, + 5828, 5830, 3841, 5833, 5840, 0, 0, 3881, 4356, 4450, + 4473, 5839, 4496, 5849, 3883, 5855, 5859, 5861, 5862, 4250, + 5873, 4406, 5851, 4540, 5874, 4585, 4541, 4586, 5877, 5875, + 5881, 5880, 5899, 5883, 4671, 5886, 5905, 5906, 3923, 5908, + 5909, 5912, 4672, 4695, 5919, 5930, 5920, 5931, 4718, 4741, + 5933, 3963, 5935, 4763, 5934, 5938, 4764, 4252, 5090, 5943, + 5953, 5956, 5961, 5112, 5958, 5962, 5967, 5971, 4587, 5981, + 5982, 5983, 5113, 5987, 4866, 5136, 5990, 4992, 5991, 5995, + + 5158, 5159, 6001, 5205, 5032, 6002, 5204, 5228, 5227, 6005, + 6006, 6015, 6009, 5291, 6014, 5313, 6016, 6045, 5314, 5336, + 5337, 5359, 7626, 6068, 6075, 6079, 6082, 6085, 6088, 6091, + 6094, 6097, 6100, 6103, 6106, 6109, 6112, 6115, 6118, 6121, + 6124, 6127, 6131, 6135, 6138, 6141, 6144, 6147, 6150, 6153, + 6156, 6159, 6163, 6167, 6170, 6173, 6177, 6179, 6182, 6185, + 6188, 6191, 6194, 6197, 6200, 6203, 6207, 6209, 6212, 6216, + 6221, 6225, 6228, 6232, 6235, 6238, 6241, 6244, 6247, 6250, + 6253, 6257, 6261, 6264, 6268, 6272, 6277, 6281, 6283, 6287, + 6290, 6294, 6297, 6300, 6304, 6306, 6309, 6312, 6315, 6318, + + 6321, 6324, 6327, 6330, 6333, 6337, 6339, 6342, 6345, 6348, + 6352, 6354, 6357, 6360, 6365, 6369, 6374, 6378, 6380, 6384, + 6387, 6391, 6396, 6400, 6403, 6406, 6409, 6412, 6415, 6418, + 6421, 6425, 6429, 6432, 6436, 6440, 6445, 6449, 6451, 6455, + 6458, 6462, 6465, 6470, 6474, 6479, 6483, 6485, 6489, 6492, + 6496, 6499, 6502, 6505, 6509, 6511, 6514, 6519, 6523, 6526, + 6529, 6532, 6535, 6538, 6541, 6544, 6547, 6551, 6553, 6556, + 6559, 6562, 6566, 6568, 6571, 6574, 6577, 6580, 6584, 6586, + 6589, 6592, 6595, 6600, 6604, 6609, 6613, 6615, 6619, 6622, + 6626, 6631, 6635, 6638, 6641, 6644, 6647, 6650, 6653, 6656, + + 6660, 6664, 6667, 6671, 6675, 6680, 6684, 6686, 6690, 6693, + 6697, 6700, 6705, 6709, 6714, 6718, 6720, 6724, 6727, 6731, + 6734, 6737, 6742, 6746, 6751, 6755, 6757, 6761, 6764, 6768, + 6771, 6774, 6777, 6781, 6783, 6786, 6791, 6795, 6798, 6801, + 6804, 6807, 6810, 6813, 6816, 6819, 6822, 6825, 6828, 6832, + 6834, 6837, 6840, 6843, 6846, 6850, 6852, 6855, 6858, 6861, + 6864, 6867, 6871, 6873, 6876, 6879, 6882, 6885, 6888, 6892, + 6894, 6897, 6900, 6903, 6906, 6911, 6915, 6920, 6924, 6926, + 6930, 6933, 6937, 6942, 6946, 6949, 6952, 6955, 6958, 6961, + 6964, 6967, 6970, 6973, 6977, 6981, 6984, 6988, 6992, 6997, + + 7001, 7003, 7007, 7010, 7014, 7017, 7022, 7026, 7031, 7035, + 7037, 7041, 7044, 7048, 7051, 7054, 7059, 7063, 7068, 7072, + 7074, 7078, 7081, 7085, 7088, 7091, 7096, 7100, 7105, 7109, + 7111, 7115, 7118, 7122, 7125, 7128, 7131, 7135, 7137, 7140, + 7143, 7148, 7152, 7155, 7158, 7161, 7164, 7167, 7170, 7173, + 7176, 7179, 7182, 7185, 7189, 7193, 7196, 7199, 7203, 7206, + 7209, 7213, 7215, 7218, 7221, 7225, 7227, 7230, 7233, 7236, + 7240, 7242, 7245, 7248, 7251, 7255, 7257, 7260, 7263, 7266, + 7270, 7272, 7275, 7278, 7283, 7287, 7292, 7296, 7298, 7302, + 7305, 7309, 7314, 7318, 7321, 7324, 7327, 7330, 7333, 7336, + + 7339, 7342, 7346, 7348, 7351, 7355, 7360, 7364, 7365, 7368, + 7373, 7377, 7382, 7386, 7387, 7390, 7393, 7398, 7402, 7407, + 7411, 7412, 7415, 7418, 7423, 7427, 7432, 7436, 7437, 7440, + 7443, 7448, 7452, 7457, 7461, 7462, 7465, 7468, 7471, 7475, + 7477, 7482, 7486, 7489, 7492, 7495, 7498, 7501, 7504, 7508, + 7513, 7517, 7518, 7521, 7524, 7527, 7530, 7533, 7536, 7539, + 7542, 7545, 7548, 7553, 7557, 7560, 7563, 7566, 7570, 7574, + 7578, 7582, 7586, 7589, 7592, 7596, 7599, 7602, 7605, 7608, + 7611, 7615, 7618 + } ; + +static yyconst flex_int16_t yy_def[2184] = + { 0, + 1723, 1, 1723, 1723, 1723, 1723, 1723, 1724, 1723, 1723, + 1723, 11, 1723, 1723, 1723, 1723, 11, 17, 1725, 17, + 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 1723, + 1723, 1726, 1723, 18, 18, 17, 1727, 46, 18, 18, + 18, 1723, 1723, 1723, 1723, 1723, 1723, 45, 1725, 48, + 48, 48, 18, 18, 18, 18, 48, 18, 18, 48, + 18, 18, 18, 48, 18, 18, 18, 18, 18, 48, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 1723, 1723, 18, 18, 149, + 18, 18, 152, 1728, 1723, 50, 1723, 157, 1729, 18, + 18, 153, 18, 18, 18, 153, 18, 18, 18, 18, + 18, 18, 153, 18, 18, 18, 18, 18, 18, 18, + 153, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 257, 258, 153, 1730, 263, 1731, 1732, 1723, 268, 1733, + 1734, 1723, 1723, 1723, 1735, 1736, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 345, 18, 258, 260, 258, + 260, 260, 352, 1737, 1723, 351, 1738, 1739, 1723, 1723, + 1723, 1723, 1740, 1741, 1742, 1743, 1743, 1723, 1744, 1723, + 370, 1745, 1736, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 427, 428, 428, 433, 427, 352, 436, 1746, 1747, 1723, + 440, 1748, 1723, 1749, 1750, 1723, 446, 1751, 1752, 1753, + 1753, 1723, 1754, 1723, 454, 1755, 1741, 1723, 1723, 1756, + 1757, 1723, 1723, 1723, 1723, 1758, 1759, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 517, 18, 428, + 430, 428, 428, 523, 436, 525, 1760, 1723, 1723, 1723, + 1761, 1762, 1763, 1723, 1723, 1723, 1723, 1764, 1765, 1723, + 1766, 1767, 1723, 1723, 1723, 1723, 1768, 1769, 1770, 1770, + 1756, 1757, 1771, 1771, 1723, 1772, 1723, 557, 1773, 1774, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 611, 611, 615, 525, 617, 1775, 1776, + 1723, 621, 1777, 1723, 624, 1778, 1723, 1779, 1780, 1723, + 630, 1781, 1782, 1782, 1723, 1783, 1723, 637, 1784, 1785, + 1786, 1786, 1787, 1788, 1789, 1789, 1723, 1790, 1723, 649, + 1791, 1792, 1723, 1793, 1723, 1794, 1795, 1723, 1723, 1723, + 1723, 1796, 1797, 618, 664, 664, 664, 664, 664, 664, + 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, + 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, + 664, 664, 664, 664, 664, 664, 664, 664, 618, 618, + + 664, 701, 701, 701, 664, 701, 706, 1798, 1723, 1723, + 1723, 1799, 1723, 1723, 1800, 1801, 1802, 1723, 1723, 1723, + 1723, 1803, 1804, 1723, 1805, 1806, 1723, 1723, 1723, 1723, + 1807, 1808, 1723, 1809, 1723, 1810, 1811, 1723, 1723, 1723, + 1723, 1812, 1813, 1814, 1723, 1815, 1816, 1816, 1817, 1818, + 1819, 1819, 1723, 1820, 1723, 755, 1821, 1822, 1823, 1823, + 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, + 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, + 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823, + 789, 1823, 789, 793, 793, 795, 1824, 1825, 1723, 799, + + 1826, 1723, 802, 1827, 1723, 805, 1828, 1723, 1829, 1830, + 1723, 811, 1831, 1832, 1832, 1723, 1833, 1723, 818, 1834, + 1835, 1836, 1836, 1837, 1838, 1839, 1839, 1723, 1840, 1723, + 830, 1841, 1842, 1843, 1723, 1844, 1845, 1845, 1846, 1847, + 1848, 1848, 1723, 1849, 1723, 845, 1850, 1851, 1852, 1723, + 1853, 1723, 1854, 1855, 1723, 1723, 1723, 1723, 1856, 1857, + 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, + 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, 1858, + 1858, 1858, 1858, 1858, 884, 884, 886, 884, 884, 889, + 1859, 1723, 1723, 1723, 1860, 1723, 1723, 1861, 1723, 1723, + + 1862, 1863, 1864, 1723, 1723, 1723, 1723, 1865, 1866, 1723, + 1867, 1868, 1723, 1723, 1723, 1723, 1869, 1870, 1723, 1871, + 1723, 1872, 1873, 1723, 1723, 1723, 1723, 1874, 1875, 1876, + 1723, 1877, 1723, 1878, 1879, 1723, 1723, 1723, 1723, 1880, + 1881, 1882, 1883, 1723, 1884, 1885, 1885, 1886, 1887, 1888, + 1888, 1723, 1889, 1723, 954, 1890, 1891, 1892, 1892, 1892, + 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, + 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, + 1892, 981, 1892, 1892, 1893, 1894, 1723, 987, 1895, 1723, + 990, 1896, 1723, 993, 1897, 1723, 996, 1898, 1723, 1899, + + 1723, 1723, 1002, 1900, 1901, 1901, 1723, 1902, 1723, 1009, + 1903, 1904, 1905, 1905, 1906, 1907, 1908, 1908, 1723, 1909, + 1723, 1021, 1910, 1911, 1912, 1723, 1913, 1914, 1914, 1915, + 1916, 1917, 1917, 1723, 1918, 1723, 1036, 1919, 1920, 1921, + 1922, 1723, 1923, 1924, 1924, 1925, 1926, 1927, 1927, 1723, + 1928, 1723, 1052, 1929, 1930, 1931, 1723, 1932, 1723, 1933, + 1934, 1723, 1723, 1723, 1723, 1935, 1936, 1937, 1937, 1937, + 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, + 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, + 1090, 1937, 1938, 1723, 1723, 1723, 1939, 1723, 1723, 1940, + + 1723, 1723, 1941, 1723, 1723, 1942, 1943, 1723, 1108, 1944, + 1945, 1723, 1723, 1946, 1947, 1948, 1723, 1949, 1950, 1723, + 1723, 1723, 1951, 1952, 1953, 1723, 1954, 1723, 1955, 1956, + 1723, 1723, 1723, 1957, 1958, 1959, 1960, 1723, 1961, 1723, + 1962, 1963, 1723, 1723, 1723, 1964, 1965, 1966, 1967, 1723, + 1968, 1723, 1969, 1970, 1723, 1723, 1723, 1971, 1972, 1973, + 1974, 1975, 1723, 1976, 1977, 1977, 1978, 1979, 1980, 1980, + 1723, 1981, 1723, 1173, 1982, 1983, 1984, 1984, 1984, 1984, + 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1984, + 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1984, 1985, + + 1723, 1723, 1202, 1986, 1723, 1205, 1987, 1723, 1208, 1988, + 1723, 1211, 1989, 1723, 1214, 1990, 1723, 1723, 1723, 1991, + 1992, 1993, 1994, 1995, 1995, 1723, 1996, 1997, 1998, 1999, + 1999, 2000, 2001, 2002, 2002, 1723, 2003, 2004, 2005, 2006, + 1723, 2007, 2008, 2008, 2009, 2010, 2011, 2011, 1723, 2012, + 2013, 2014, 2015, 2016, 1723, 2017, 2018, 2018, 2019, 2020, + 2021, 2021, 1723, 2022, 2023, 2024, 2025, 2026, 1723, 2027, + 2028, 2028, 2029, 2030, 2031, 2031, 1723, 2032, 2033, 2034, + 2035, 1723, 2036, 1723, 2037, 2038, 1723, 1723, 1723, 2039, + 2040, 2041, 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042, + + 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042, + 2042, 2042, 1723, 1313, 2043, 2044, 1723, 2045, 2046, 1723, + 2047, 2048, 1723, 2049, 2050, 1723, 2051, 2052, 1723, 2053, + 2054, 2055, 2055, 1723, 2056, 2057, 2058, 2059, 2060, 1723, + 2061, 2062, 1723, 2063, 1723, 2064, 1723, 2065, 2066, 1723, + 2067, 2068, 1723, 2069, 1723, 2070, 2071, 1723, 2072, 2073, + 1723, 2074, 1723, 2075, 2076, 1723, 2077, 2078, 1723, 2079, + 1723, 2080, 2081, 1723, 2082, 2083, 2084, 1723, 2085, 2086, + 2086, 2087, 2088, 2089, 2089, 1723, 2090, 2091, 2092, 2093, + 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, + + 2093, 2093, 2093, 2093, 2093, 2093, 1723, 2094, 2095, 2096, + 2097, 2098, 2099, 2100, 2101, 1723, 2102, 2103, 1723, 2104, + 2105, 2106, 2106, 2107, 2108, 2109, 2110, 1723, 2111, 2112, + 2112, 2113, 2114, 2115, 2116, 2117, 1723, 2118, 2119, 2119, + 2120, 2121, 2122, 2123, 2124, 1723, 2125, 2126, 2126, 2127, + 2128, 2129, 2130, 2131, 1723, 2132, 2133, 2133, 2134, 2135, + 2136, 2137, 1723, 2138, 1723, 2139, 2140, 1723, 2141, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2143, 1723, 2144, 2145, + 2146, 2147, 2148, 2149, 2150, 2150, 2151, 2152, 2153, 1723, + + 1723, 2154, 1723, 2155, 1723, 2156, 1723, 2157, 1723, 2158, + 1723, 2159, 1723, 2160, 1723, 2161, 1723, 2162, 1723, 2137, + 2163, 1723, 2138, 2164, 2164, 2139, 2140, 2165, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2166, 1723, 2167, 2168, 1723, 2154, + 2155, 2169, 1723, 2156, 2157, 2170, 1723, 2158, 2159, 2171, + 1723, 2160, 2161, 2172, 1723, 2162, 2173, 1723, 2174, 1723, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2175, 1723, 2167, 2176, 2177, 2178, 2179, + 2180, 2173, 2181, 1723, 2174, 2142, 2142, 2142, 2142, 2142, + + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2182, 2176, 2177, + 2178, 2179, 2180, 2183, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2182, 2183, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 0, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723 + } ; + +static yyconst flex_uint16_t yy_nxt[7679] = + { 0, + 4, 5, 6, 5, 7, 8, 9, 10, 9, 9, + 4, 11, 12, 12, 12, 12, 12, 12, 13, 14, + 15, 16, 17, 18, 18, 19, 4, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 18, 29, 30, 31, + 32, 33, 18, 34, 35, 36, 37, 38, 39, 18, + 18, 40, 44, 45, 46, 46, 46, 46, 46, 46, + 46, 47, 53, 54, 49, 48, 49, 50, 769, 51, + 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 50, 49, 49, 56, 57, 60, 74, 61, + + 62, 112, 75, 499, 63, 78, 79, 80, 76, 64, + 113, 77, 81, 65, 67, 66, 192, 500, 193, 49, + 58, 48, 48, 48, 48, 48, 48, 48, 68, 70, + 190, 1150, 82, 191, 49, 69, 83, 124, 206, 71, + 201, 125, 72, 85, 207, 86, 73, 196, 84, 126, + 87, 88, 197, 89, 127, 1152, 128, 90, 237, 49, + 51, 49, 49, 49, 49, 49, 49, 49, 49, 1723, + 99, 100, 202, 49, 937, 136, 238, 137, 49, 49, + 49, 49, 49, 49, 91, 101, 1330, 92, 93, 102, + 94, 138, 95, 103, 96, 104, 97, 106, 139, 98, + + 119, 107, 105, 114, 49, 120, 121, 208, 122, 123, + 108, 109, 209, 141, 110, 115, 111, 116, 129, 117, + 203, 142, 118, 243, 130, 143, 131, 144, 132, 49, + 231, 319, 133, 244, 134, 135, 148, 148, 148, 148, + 148, 148, 148, 232, 320, 212, 204, 148, 213, 339, + 214, 205, 148, 148, 148, 148, 148, 148, 149, 150, + 150, 150, 150, 150, 150, 1723, 337, 681, 338, 151, + 49, 350, 340, 682, 151, 151, 151, 151, 151, 151, + 45, 152, 152, 152, 152, 152, 152, 152, 763, 412, + 1723, 49, 153, 177, 413, 1723, 49, 153, 153, 153, + + 153, 153, 153, 58, 153, 153, 153, 153, 153, 153, + 153, 156, 156, 156, 156, 156, 156, 156, 1723, 178, + 1723, 49, 156, 49, 522, 179, 448, 156, 156, 156, + 156, 156, 156, 157, 158, 158, 158, 158, 158, 158, + 49, 703, 762, 1723, 159, 760, 49, 49, 49, 159, + 159, 159, 159, 159, 159, 151, 151, 151, 151, 151, + 151, 151, 240, 347, 347, 347, 347, 347, 347, 347, + 432, 241, 255, 49, 256, 256, 256, 256, 256, 256, + 256, 1723, 1723, 1156, 260, 256, 375, 376, 377, 378, + 256, 256, 256, 256, 256, 256, 257, 258, 258, 258, + + 258, 258, 258, 258, 272, 379, 1723, 1723, 259, 260, + 260, 1065, 274, 259, 259, 259, 259, 259, 259, 366, + 367, 367, 367, 367, 367, 367, 435, 435, 435, 435, + 435, 435, 435, 459, 776, 260, 261, 259, 259, 259, + 259, 259, 259, 259, 1723, 49, 761, 460, 259, 1723, + 1723, 49, 49, 259, 259, 259, 259, 259, 259, 262, + 263, 263, 263, 263, 263, 263, 263, 264, 1290, 1723, + 49, 265, 460, 1723, 1723, 1723, 265, 265, 265, 265, + 265, 265, 49, 265, 265, 265, 265, 265, 265, 265, + 268, 269, 269, 269, 269, 269, 269, 270, 1723, 49, + + 781, 271, 375, 376, 377, 378, 271, 271, 271, 271, + 271, 271, 272, 273, 273, 273, 273, 273, 273, 273, + 274, 459, 1723, 1408, 275, 485, 276, 51, 391, 275, + 275, 275, 275, 275, 275, 1723, 392, 450, 451, 451, + 451, 451, 451, 451, 51, 486, 495, 1723, 393, 765, + 1318, 276, 344, 344, 344, 344, 344, 344, 344, 496, + 1723, 487, 1723, 344, 394, 770, 1321, 49, 344, 344, + 344, 344, 344, 344, 345, 346, 346, 346, 346, 346, + 346, 360, 768, 49, 49, 347, 1324, 1723, 1723, 530, + 347, 347, 347, 347, 347, 347, 257, 348, 348, 348, + + 348, 348, 348, 348, 349, 349, 349, 349, 349, 349, + 349, 272, 772, 1723, 49, 349, 49, 788, 1327, 1723, + 349, 349, 349, 349, 349, 349, 351, 352, 352, 352, + 352, 352, 352, 352, 463, 794, 1330, 1408, 353, 448, + 448, 613, 465, 353, 353, 353, 353, 353, 353, 356, + 353, 353, 353, 353, 353, 353, 353, 360, 361, 361, + 361, 361, 361, 361, 361, 362, 613, 1218, 448, 363, + 49, 364, 51, 540, 363, 363, 363, 363, 363, 363, + 519, 519, 519, 519, 519, 519, 519, 541, 774, 51, + 1318, 448, 771, 540, 614, 49, 364, 272, 368, 368, + + 368, 368, 368, 368, 368, 274, 49, 1723, 430, 369, + 1321, 51, 541, 775, 369, 369, 369, 369, 369, 369, + 370, 371, 371, 371, 371, 371, 371, 49, 51, 871, + 849, 372, 1723, 430, 571, 766, 372, 372, 372, 372, + 372, 372, 416, 572, 417, 49, 418, 419, 549, 550, + 550, 550, 550, 550, 550, 849, 420, 653, 421, 422, + 653, 423, 425, 574, 426, 426, 426, 426, 426, 426, + 426, 654, 575, 448, 1723, 426, 1723, 1324, 51, 448, + 426, 426, 426, 426, 426, 426, 427, 428, 428, 428, + 428, 428, 428, 428, 777, 51, 654, 1327, 429, 1723, + + 430, 1723, 49, 429, 429, 429, 429, 429, 429, 553, + 554, 554, 554, 554, 554, 554, 633, 634, 634, 634, + 634, 634, 634, 655, 773, 430, 431, 429, 429, 429, + 429, 429, 429, 429, 1723, 49, 448, 656, 429, 1330, + 51, 51, 655, 429, 429, 429, 429, 429, 429, 433, + 434, 434, 434, 434, 434, 434, 1723, 51, 51, 1723, + 435, 868, 656, 51, 779, 435, 435, 435, 435, 435, + 435, 262, 436, 436, 436, 436, 436, 436, 436, 49, + 51, 1723, 448, 437, 1723, 1723, 1723, 861, 437, 437, + 437, 437, 437, 437, 49, 437, 437, 437, 437, 437, + + 437, 437, 440, 441, 441, 441, 441, 441, 441, 1723, + 1723, 1723, 1723, 442, 1282, 1284, 51, 780, 442, 442, + 442, 442, 442, 442, 446, 447, 447, 447, 447, 447, + 447, 448, 49, 51, 1063, 449, 1290, 1723, 867, 51, + 449, 449, 449, 449, 449, 449, 360, 452, 452, 452, + 452, 452, 452, 452, 362, 1288, 51, 1488, 453, 869, + 51, 51, 51, 453, 453, 453, 453, 453, 453, 454, + 455, 455, 455, 455, 455, 455, 448, 51, 51, 51, + 456, 882, 874, 51, 879, 456, 456, 456, 456, 456, + 456, 272, 461, 461, 461, 461, 461, 461, 461, 274, + + 51, 1408, 1723, 462, 1408, 448, 51, 878, 462, 462, + 462, 462, 462, 462, 463, 464, 464, 464, 464, 464, + 464, 464, 465, 51, 1340, 1112, 466, 1723, 467, 683, + 782, 466, 466, 466, 466, 466, 466, 577, 684, 578, + 685, 724, 579, 580, 49, 724, 581, 582, 764, 686, + 778, 583, 787, 467, 477, 725, 1345, 49, 478, 1723, + 49, 479, 49, 733, 480, 733, 481, 482, 483, 484, + 516, 516, 516, 516, 516, 516, 516, 734, 1347, 1723, + 725, 516, 930, 51, 1723, 783, 516, 516, 516, 516, + 516, 516, 517, 518, 518, 518, 518, 518, 518, 49, + + 51, 1121, 734, 519, 1723, 1723, 49, 930, 519, 519, + 519, 519, 519, 519, 427, 520, 520, 520, 520, 520, + 520, 520, 521, 521, 521, 521, 521, 521, 521, 535, + 1723, 49, 1056, 521, 1723, 1353, 789, 711, 521, 521, + 521, 521, 521, 521, 432, 523, 523, 523, 523, 523, + 523, 523, 544, 51, 1355, 1132, 524, 1056, 260, 1723, + 714, 524, 524, 524, 524, 524, 524, 641, 642, 642, + 642, 642, 642, 642, 645, 646, 646, 646, 646, 646, + 646, 51, 735, 260, 524, 524, 524, 524, 524, 524, + 524, 1723, 1361, 1723, 1723, 524, 736, 51, 51, 784, + + 524, 524, 524, 524, 524, 524, 525, 525, 525, 525, + 525, 525, 525, 49, 51, 862, 1723, 526, 1723, 1723, + 1363, 736, 526, 526, 526, 526, 526, 526, 49, 526, + 526, 526, 526, 526, 526, 526, 360, 529, 529, 529, + 529, 529, 529, 529, 530, 786, 735, 1144, 531, 1369, + 364, 1371, 1156, 531, 531, 531, 531, 531, 531, 49, + 1723, 744, 745, 745, 745, 745, 745, 745, 747, 748, + 748, 748, 748, 748, 748, 364, 535, 536, 536, 536, + 536, 536, 536, 536, 537, 1723, 1290, 1416, 538, 1218, + 539, 1463, 1465, 538, 538, 538, 538, 538, 538, 751, + + 752, 752, 752, 752, 752, 752, 814, 815, 815, 815, + 815, 815, 815, 850, 51, 539, 360, 542, 542, 542, + 542, 542, 542, 542, 530, 1723, 1501, 851, 543, 1505, + 1723, 51, 51, 543, 543, 543, 543, 543, 543, 544, + 545, 545, 545, 545, 545, 545, 545, 546, 863, 51, + 1723, 547, 851, 548, 958, 1723, 547, 547, 547, 547, + 547, 547, 822, 823, 823, 823, 823, 823, 823, 826, + 827, 827, 827, 827, 827, 827, 850, 51, 548, 463, + 555, 555, 555, 555, 555, 555, 555, 465, 1509, 1723, + 1723, 556, 1513, 51, 51, 852, 556, 556, 556, 556, + + 556, 556, 557, 558, 558, 558, 558, 558, 558, 853, + 51, 864, 1517, 559, 1723, 1723, 51, 791, 559, 559, + 559, 559, 559, 559, 608, 852, 609, 609, 609, 609, + 609, 609, 609, 51, 853, 1546, 1723, 609, 1568, 1723, + 51, 51, 609, 609, 609, 609, 609, 609, 610, 611, + 611, 611, 611, 611, 611, 611, 1144, 51, 51, 1086, + 612, 1723, 613, 959, 1723, 612, 612, 612, 612, 612, + 612, 834, 835, 835, 835, 835, 835, 835, 837, 838, + 838, 838, 838, 838, 838, 51, 51, 613, 610, 612, + 612, 612, 612, 612, 612, 612, 659, 448, 1327, 1137, + + 612, 1723, 51, 51, 661, 612, 612, 612, 612, 612, + 612, 432, 615, 615, 615, 615, 615, 615, 615, 866, + 925, 1140, 872, 616, 1137, 1149, 1723, 1723, 616, 616, + 616, 616, 616, 616, 49, 616, 616, 616, 616, 616, + 616, 616, 617, 617, 617, 617, 617, 617, 617, 719, + 1149, 1138, 1723, 618, 1723, 1281, 1723, 894, 618, 618, + 618, 618, 618, 618, 49, 618, 618, 618, 618, 618, + 618, 618, 621, 622, 622, 622, 622, 622, 622, 1723, + 1281, 1723, 1723, 623, 1132, 448, 51, 51, 623, 623, + 623, 623, 623, 623, 360, 452, 452, 452, 452, 452, + + 452, 452, 530, 51, 51, 1324, 453, 1723, 960, 962, + 910, 453, 453, 453, 453, 453, 453, 624, 625, 625, + 625, 625, 625, 625, 911, 914, 1723, 1128, 626, 1126, + 51, 51, 1121, 626, 626, 626, 626, 626, 626, 630, + 631, 631, 631, 631, 631, 631, 448, 51, 51, 911, + 632, 1723, 964, 965, 51, 632, 632, 632, 632, 632, + 632, 535, 635, 635, 635, 635, 635, 635, 635, 537, + 448, 51, 1723, 636, 967, 51, 1321, 51, 636, 636, + 636, 636, 636, 636, 637, 638, 638, 638, 638, 638, + 638, 448, 51, 970, 51, 639, 905, 1723, 51, 977, + + 639, 639, 639, 639, 639, 639, 544, 647, 647, 647, + 647, 647, 647, 647, 546, 51, 1117, 1112, 648, 1723, + 51, 51, 971, 648, 648, 648, 648, 648, 648, 649, + 650, 650, 650, 650, 650, 650, 448, 51, 51, 1723, + 651, 1073, 1077, 51, 1723, 651, 651, 651, 651, 651, + 651, 463, 657, 657, 657, 657, 657, 657, 657, 465, + 51, 1080, 1352, 658, 1723, 448, 51, 51, 658, 658, + 658, 658, 658, 658, 659, 660, 660, 660, 660, 660, + 660, 660, 661, 51, 51, 1318, 662, 1352, 663, 1081, + 1082, 662, 662, 662, 662, 662, 662, 841, 842, 842, + + 842, 842, 842, 842, 745, 745, 745, 745, 745, 745, + 745, 51, 51, 663, 699, 699, 699, 699, 699, 699, + 699, 1360, 448, 1368, 1220, 699, 1723, 51, 51, 51, + 699, 699, 699, 699, 699, 699, 700, 700, 700, 700, + 700, 700, 700, 873, 51, 963, 1360, 700, 1368, 1084, + 1462, 1723, 700, 700, 700, 700, 700, 700, 610, 701, + 701, 701, 701, 701, 701, 701, 702, 702, 702, 702, + 702, 702, 702, 728, 1504, 1462, 1508, 702, 1512, 51, + 51, 897, 702, 702, 702, 702, 702, 702, 432, 704, + 704, 704, 704, 704, 704, 704, 51, 51, 1337, 1504, + + 705, 1508, 1088, 1512, 974, 705, 705, 705, 705, 705, + 705, 49, 705, 705, 705, 705, 705, 705, 705, 706, + 706, 706, 706, 706, 706, 706, 739, 1201, 1330, 1327, + 707, 1324, 1321, 1318, 900, 707, 707, 707, 707, 707, + 707, 49, 707, 707, 707, 707, 707, 707, 707, 535, + 710, 710, 710, 710, 710, 710, 710, 711, 51, 51, + 51, 712, 51, 539, 51, 51, 712, 712, 712, 712, + 712, 712, 856, 1201, 1063, 51, 51, 51, 1290, 51, + 858, 51, 51, 51, 1085, 875, 876, 865, 539, 544, + 713, 713, 713, 713, 713, 713, 713, 714, 877, 51, + + 51, 715, 51, 548, 51, 905, 715, 715, 715, 715, + 715, 715, 870, 1096, 1065, 914, 51, 1516, 856, 51, + 1059, 51, 51, 1099, 1057, 880, 910, 51, 548, 719, + 720, 720, 720, 720, 720, 720, 720, 721, 881, 51, + 1723, 722, 1516, 723, 51, 925, 722, 722, 722, 722, + 722, 722, 883, 1102, 1567, 1158, 336, 888, 888, 888, + 888, 888, 888, 888, 919, 1723, 919, 51, 723, 535, + 726, 726, 726, 726, 726, 726, 726, 711, 920, 1567, + 1723, 727, 448, 1587, 51, 1105, 727, 727, 727, 727, + 727, 727, 728, 729, 729, 729, 729, 729, 729, 729, + + 730, 969, 921, 920, 731, 1723, 732, 921, 1587, 731, + 731, 731, 731, 731, 731, 1146, 922, 1588, 448, 1102, + 1589, 1723, 835, 835, 835, 835, 835, 835, 835, 931, + 51, 732, 544, 737, 737, 737, 737, 737, 737, 737, + 714, 922, 1588, 932, 738, 1589, 1723, 51, 1134, 738, + 738, 738, 738, 738, 738, 739, 740, 740, 740, 740, + 740, 740, 740, 741, 51, 931, 933, 742, 932, 743, + 933, 448, 742, 742, 742, 742, 742, 742, 1099, 1723, + 934, 51, 1123, 1590, 1723, 943, 944, 944, 944, 944, + 944, 944, 972, 51, 743, 659, 753, 753, 753, 753, + + 753, 753, 753, 661, 1723, 934, 448, 754, 1590, 1723, + 51, 51, 754, 754, 754, 754, 754, 754, 755, 756, + 756, 756, 756, 756, 756, 961, 1096, 1114, 51, 757, + 448, 51, 51, 51, 757, 757, 757, 757, 757, 757, + 49, 49, 49, 49, 49, 49, 49, 978, 51, 51, + 51, 49, 51, 51, 51, 51, 49, 49, 49, 49, + 49, 49, 946, 947, 947, 947, 947, 947, 947, 51, + 51, 51, 51, 1057, 759, 789, 1057, 790, 790, 790, + 790, 790, 790, 790, 966, 968, 1068, 1058, 790, 976, + 1723, 51, 51, 790, 790, 790, 790, 790, 790, 791, + + 792, 792, 792, 792, 792, 792, 792, 1220, 51, 51, + 1190, 792, 1058, 1182, 448, 1723, 792, 792, 792, 792, + 792, 792, 701, 701, 701, 701, 701, 701, 701, 950, + 951, 951, 951, 951, 951, 951, 51, 51, 51, 1005, + 1006, 1006, 1006, 1006, 1006, 1006, 1013, 1014, 1014, 1014, + 1014, 1014, 1014, 51, 51, 51, 49, 702, 702, 702, + 702, 702, 702, 702, 973, 1201, 1105, 1102, 702, 1069, + 1072, 1591, 1608, 702, 702, 702, 702, 702, 702, 793, + 348, 348, 348, 348, 348, 348, 348, 262, 795, 795, + 795, 795, 795, 795, 795, 937, 1591, 1608, 1099, 796, + + 1614, 1096, 1201, 1105, 796, 796, 796, 796, 796, 796, + 49, 796, 796, 796, 796, 796, 796, 796, 799, 800, + 800, 800, 800, 800, 800, 1614, 1065, 858, 937, 801, + 1158, 1105, 51, 51, 801, 801, 801, 801, 801, 801, + 535, 635, 635, 635, 635, 635, 635, 635, 711, 51, + 51, 739, 636, 1185, 51, 1186, 1059, 636, 636, 636, + 636, 636, 636, 802, 803, 803, 803, 803, 803, 803, + 1060, 51, 933, 931, 804, 925, 1189, 51, 1146, 804, + 804, 804, 804, 804, 804, 544, 647, 647, 647, 647, + 647, 647, 647, 714, 51, 1060, 1102, 648, 728, 51, + + 1194, 1059, 648, 648, 648, 648, 648, 648, 805, 806, + 806, 806, 806, 806, 806, 1723, 51, 1192, 921, 807, + 919, 51, 51, 914, 807, 807, 807, 807, 807, 807, + 811, 812, 812, 812, 812, 812, 812, 448, 51, 51, + 1723, 813, 1195, 1134, 51, 1099, 813, 813, 813, 813, + 813, 813, 719, 816, 816, 816, 816, 816, 816, 816, + 721, 51, 1293, 719, 817, 910, 51, 51, 905, 817, + 817, 817, 817, 817, 817, 818, 819, 819, 819, 819, + 819, 819, 448, 51, 51, 1294, 820, 1123, 1096, 51, + 1114, 820, 820, 820, 820, 820, 820, 728, 828, 828, + + 828, 828, 828, 828, 828, 730, 51, 1295, 1296, 829, + 1001, 51, 51, 51, 829, 829, 829, 829, 829, 829, + 830, 831, 831, 831, 831, 831, 831, 448, 51, 51, + 51, 832, 986, 1299, 1105, 51, 832, 832, 832, 832, + 832, 832, 739, 843, 843, 843, 843, 843, 843, 843, + 741, 1297, 51, 1102, 844, 1099, 1310, 51, 51, 844, + 844, 844, 844, 844, 844, 845, 846, 846, 846, 846, + 846, 846, 448, 1096, 51, 51, 847, 1094, 986, 1311, + 51, 847, 847, 847, 847, 847, 847, 659, 854, 854, + 854, 854, 854, 854, 854, 661, 856, 51, 1065, 855, + + 858, 659, 852, 51, 855, 855, 855, 855, 855, 855, + 856, 857, 857, 857, 857, 857, 857, 857, 858, 51, + 51, 1117, 859, 850, 860, 939, 900, 859, 859, 859, + 859, 859, 859, 1087, 51, 1118, 51, 1017, 1018, 1018, + 1018, 1018, 1018, 1018, 51, 975, 927, 51, 1117, 860, + 51, 51, 884, 884, 884, 884, 884, 884, 884, 1079, + 1118, 51, 1723, 884, 51, 1074, 51, 51, 884, 884, + 884, 884, 884, 884, 885, 885, 885, 885, 885, 885, + 885, 1184, 1075, 51, 897, 885, 51, 1723, 51, 51, + 885, 885, 885, 885, 885, 885, 886, 887, 887, 887, + + 887, 887, 887, 51, 916, 51, 51, 888, 894, 51, + 51, 1083, 888, 888, 888, 888, 888, 888, 262, 889, + 889, 889, 889, 889, 889, 889, 51, 51, 907, 1001, + 890, 986, 1390, 900, 1301, 890, 890, 890, 890, 890, + 890, 49, 890, 890, 890, 890, 890, 890, 890, 719, + 893, 893, 893, 893, 893, 893, 893, 894, 897, 894, + 986, 895, 858, 723, 661, 739, 895, 895, 895, 895, + 895, 895, 1025, 1026, 1026, 1026, 1026, 1026, 1026, 1028, + 1029, 1029, 1029, 1029, 1029, 1029, 939, 51, 723, 728, + 896, 896, 896, 896, 896, 896, 896, 897, 900, 544, + + 735, 898, 733, 732, 51, 728, 898, 898, 898, 898, + 898, 898, 1032, 1033, 1033, 1033, 1033, 1033, 1033, 1041, + 1042, 1042, 1042, 1042, 1042, 1042, 927, 51, 732, 739, + 899, 899, 899, 899, 899, 899, 899, 900, 897, 535, + 724, 901, 719, 743, 51, 916, 901, 901, 901, 901, + 901, 901, 1044, 1045, 1045, 1045, 1045, 1045, 1045, 1048, + 1049, 1049, 1049, 1049, 1049, 1049, 1126, 51, 743, 905, + 906, 906, 906, 906, 906, 906, 906, 907, 894, 907, + 1127, 908, 904, 909, 51, 51, 908, 908, 908, 908, + 908, 908, 944, 944, 944, 944, 944, 944, 944, 1070, + + 1071, 810, 51, 798, 900, 1127, 1126, 51, 909, 719, + 912, 912, 912, 912, 912, 912, 912, 894, 1076, 897, + 1723, 913, 894, 892, 51, 51, 913, 913, 913, 913, + 913, 913, 914, 915, 915, 915, 915, 915, 915, 915, + 916, 1078, 51, 1128, 917, 1723, 918, 1128, 1063, 917, + 917, 917, 917, 917, 917, 798, 1065, 1129, 659, 1089, + 858, 1723, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1138, + 661, 918, 728, 923, 923, 923, 923, 923, 923, 923, + 897, 463, 1129, 1139, 924, 655, 1723, 51, 653, 924, + 924, 924, 924, 924, 924, 925, 926, 926, 926, 926, + + 926, 926, 926, 927, 51, 1138, 1140, 928, 1139, 929, + 1140, 741, 928, 928, 928, 928, 928, 928, 1180, 1723, + 1141, 714, 730, 711, 1723, 1042, 1042, 1042, 1042, 1042, + 1042, 1042, 1150, 51, 929, 739, 935, 935, 935, 935, + 935, 935, 935, 900, 1723, 1141, 1151, 936, 721, 1723, + 51, 810, 936, 936, 936, 936, 936, 936, 937, 938, + 938, 938, 938, 938, 938, 938, 939, 51, 1150, 1152, + 940, 1151, 941, 1152, 1396, 940, 940, 940, 940, 940, + 940, 798, 1723, 1153, 51, 714, 711, 1723, 1162, 1163, + 1163, 1163, 1163, 1163, 1163, 1177, 798, 941, 856, 952, + + 952, 952, 952, 952, 952, 952, 858, 1723, 1153, 49, + 953, 49, 1723, 51, 1282, 953, 953, 953, 953, 953, + 953, 954, 955, 955, 955, 955, 955, 955, 1283, 49, + 51, 785, 956, 49, 49, 51, 767, 956, 956, 956, + 956, 956, 956, 51, 1183, 979, 979, 979, 979, 979, + 979, 979, 51, 1283, 661, 465, 979, 1399, 51, 51, + 51, 979, 979, 979, 979, 979, 979, 980, 980, 980, + 980, 980, 980, 980, 1112, 51, 51, 544, 980, 741, + 714, 51, 1318, 980, 980, 980, 980, 980, 980, 614, + 981, 981, 981, 981, 981, 981, 981, 1404, 51, 1473, + + 360, 982, 1474, 430, 540, 535, 982, 982, 982, 982, + 982, 982, 1165, 1166, 1166, 1166, 1166, 1166, 1166, 1169, + 1170, 1170, 1170, 1170, 1170, 1170, 51, 51, 430, 982, + 982, 982, 982, 982, 982, 982, 730, 711, 721, 718, + 982, 629, 620, 51, 51, 982, 982, 982, 982, 982, + 982, 262, 983, 983, 983, 983, 983, 983, 983, 1188, + 714, 711, 1181, 984, 709, 620, 610, 608, 984, 984, + 984, 984, 984, 984, 49, 984, 984, 984, 984, 984, + 984, 984, 987, 988, 988, 988, 988, 988, 988, 1121, + 698, 697, 696, 989, 695, 694, 51, 1321, 989, 989, + + 989, 989, 989, 989, 719, 816, 816, 816, 816, 816, + 816, 816, 894, 51, 693, 692, 817, 1476, 51, 51, + 1282, 817, 817, 817, 817, 817, 817, 990, 991, 991, + 991, 991, 991, 991, 1723, 51, 51, 691, 992, 1471, + 1484, 51, 690, 992, 992, 992, 992, 992, 992, 728, + 828, 828, 828, 828, 828, 828, 828, 897, 51, 1723, + 689, 829, 1477, 51, 51, 1284, 829, 829, 829, 829, + 829, 829, 993, 994, 994, 994, 994, 994, 994, 1285, + 51, 51, 688, 995, 1472, 687, 1478, 680, 995, 995, + 995, 995, 995, 995, 739, 843, 843, 843, 843, 843, + + 843, 843, 900, 679, 1285, 678, 844, 677, 51, 51, + 1284, 844, 844, 844, 844, 844, 844, 996, 997, 997, + 997, 997, 997, 997, 1723, 51, 51, 676, 998, 1481, + 675, 51, 674, 998, 998, 998, 998, 998, 998, 1002, + 1003, 1003, 1003, 1003, 1003, 1003, 448, 1532, 51, 1723, + 1004, 1544, 673, 51, 51, 1004, 1004, 1004, 1004, 1004, + 1004, 905, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 907, + 51, 51, 672, 1008, 671, 670, 51, 669, 1008, 1008, + 1008, 1008, 1008, 1008, 1009, 1010, 1010, 1010, 1010, 1010, + 1010, 448, 1539, 51, 1541, 1011, 668, 667, 51, 51, + + 1011, 1011, 1011, 1011, 1011, 1011, 914, 1019, 1019, 1019, + 1019, 1019, 1019, 1019, 916, 51, 51, 666, 1020, 665, + 51, 1572, 51, 1020, 1020, 1020, 1020, 1020, 1020, 1021, + 1022, 1022, 1022, 1022, 1022, 1022, 448, 51, 664, 51, + 1023, 463, 661, 465, 1579, 1023, 1023, 1023, 1023, 1023, + 1023, 925, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 927, + 1576, 459, 546, 1035, 530, 51, 51, 51, 1035, 1035, + 1035, 1035, 1035, 1035, 1036, 1037, 1037, 1037, 1037, 1037, + 1037, 448, 51, 51, 51, 1038, 537, 1597, 51, 51, + 1038, 1038, 1038, 1038, 1038, 1038, 937, 1050, 1050, 1050, + + 1050, 1050, 1050, 1050, 939, 51, 51, 629, 1051, 1598, + 51, 51, 51, 1051, 1051, 1051, 1051, 1051, 1051, 1052, + 1053, 1053, 1053, 1053, 1053, 1053, 448, 51, 51, 51, + 1054, 1599, 1605, 51, 51, 1054, 1054, 1054, 1054, 1054, + 1054, 856, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 858, + 51, 51, 620, 1062, 1619, 530, 1621, 620, 1062, 1062, + 1062, 1062, 1062, 1062, 1063, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1065, 51, 51, 614, 1066, 51, 1067, 1340, + 51, 1066, 1066, 1066, 1066, 1066, 1066, 1132, 1144, 614, + 51, 51, 1156, 1341, 51, 1324, 1327, 51, 1196, 51, + + 1330, 1178, 1179, 1067, 51, 614, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1187, 1197, 1198, 51, 1091, 1341, 607, + 606, 51, 1091, 1091, 1091, 1091, 1091, 1091, 49, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 51, 262, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 605, 51, 51, 51, 604, + 51, 603, 51, 51, 905, 1095, 1095, 1095, 1095, 1095, + 1095, 1095, 1096, 51, 51, 51, 1097, 51, 909, 51, + 51, 1097, 1097, 1097, 1097, 1097, 1097, 1303, 1191, 1193, + 1224, 1225, 1225, 1225, 1225, 1225, 1225, 51, 1309, 602, + 51, 601, 51, 909, 914, 1098, 1098, 1098, 1098, 1098, + + 1098, 1098, 1099, 600, 1305, 599, 1100, 51, 918, 51, + 598, 1100, 1100, 1100, 1100, 1100, 1100, 1230, 1231, 1231, + 1231, 1231, 1231, 1231, 1234, 1235, 1235, 1235, 1235, 1235, + 1235, 597, 51, 918, 925, 1101, 1101, 1101, 1101, 1101, + 1101, 1101, 1102, 333, 234, 596, 1103, 595, 929, 51, + 594, 1103, 1103, 1103, 1103, 1103, 1103, 1240, 1241, 1241, + 1241, 1241, 1241, 1241, 1243, 1244, 1244, 1244, 1244, 1244, + 1244, 593, 51, 929, 937, 1104, 1104, 1104, 1104, 1104, + 1104, 1104, 1105, 592, 591, 590, 1106, 589, 941, 51, + 588, 1106, 1106, 1106, 1106, 1106, 1106, 1247, 1248, 1248, + + 1248, 1248, 1248, 1248, 1254, 1255, 1255, 1255, 1255, 1255, + 1255, 51, 1340, 941, 1108, 1109, 1109, 1109, 1109, 1109, + 1109, 1110, 587, 586, 585, 1111, 1723, 584, 51, 576, + 1111, 1111, 1111, 1111, 1111, 1111, 1112, 1113, 1113, 1113, + 1113, 1113, 1113, 1113, 1114, 573, 1306, 570, 1115, 569, + 1116, 1723, 568, 1115, 1115, 1115, 1115, 1115, 1115, 1257, + 1258, 1258, 1258, 1258, 1258, 1258, 1261, 1262, 1262, 1262, + 1262, 1262, 1262, 1345, 51, 1116, 905, 1119, 1119, 1119, + 1119, 1119, 1119, 1119, 1096, 567, 566, 1346, 1120, 565, + 564, 51, 51, 1120, 1120, 1120, 1120, 1120, 1120, 1121, + + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1123, 1307, 51, + 563, 1124, 1346, 1125, 1622, 562, 1124, 1124, 1124, 1124, + 1124, 1124, 1268, 1269, 1269, 1269, 1269, 1269, 1269, 1271, + 1272, 1272, 1272, 1272, 1272, 1272, 1345, 51, 1125, 914, + 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1099, 561, 465, + 1723, 1131, 274, 448, 51, 1394, 1131, 1131, 1131, 1131, + 1131, 1131, 1132, 1133, 1133, 1133, 1133, 1133, 1133, 1133, + 1134, 360, 1395, 546, 1135, 1723, 1136, 530, 537, 1135, + 1135, 1135, 1135, 1135, 1135, 1275, 1276, 1276, 1276, 1276, + 1276, 1276, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1347, + + 51, 1136, 925, 1142, 1142, 1142, 1142, 1142, 1142, 1142, + 1102, 448, 534, 1348, 1143, 445, 439, 51, 51, 1143, + 1143, 1143, 1143, 1143, 1143, 1144, 1145, 1145, 1145, 1145, + 1145, 1145, 1145, 1146, 51, 51, 1397, 1147, 1348, 1148, + 1218, 1288, 1147, 1147, 1147, 1147, 1147, 1147, 1408, 1290, + 1300, 51, 1332, 1333, 1333, 1333, 1333, 1333, 1333, 51, + 1347, 51, 1298, 51, 1148, 937, 1154, 1154, 1154, 1154, + 1154, 1154, 1154, 1105, 1723, 530, 51, 1155, 51, 1650, + 51, 51, 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1157, + 1157, 1157, 1157, 1157, 1157, 1157, 1158, 51, 51, 1723, + + 1159, 1629, 1160, 1288, 528, 1159, 1159, 1159, 1159, 1159, + 1159, 1723, 1304, 439, 51, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 51, 431, 1353, 1302, 51, 1160, 1063, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1065, 425, 1354, 51, + 1172, 515, 514, 51, 1353, 1172, 1172, 1172, 1172, 1172, + 1172, 1173, 1174, 1174, 1174, 1174, 1174, 1174, 1723, 1485, + 1398, 513, 1175, 1354, 512, 51, 511, 1175, 1175, 1175, + 1175, 1175, 1175, 51, 614, 1199, 1199, 1199, 1199, 1199, + 1199, 1199, 51, 1723, 510, 509, 984, 1637, 508, 507, + 51, 984, 984, 984, 984, 984, 984, 49, 984, 984, + + 984, 984, 984, 984, 984, 51, 262, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 506, 51, 1355, 1355, 505, 1361, + 51, 1361, 51, 1202, 1203, 1203, 1203, 1203, 1203, 1203, + 1356, 1723, 51, 1362, 1204, 1723, 1652, 51, 504, 1204, + 1204, 1204, 1204, 1204, 1204, 905, 1007, 1007, 1007, 1007, + 1007, 1007, 1007, 1096, 1403, 1356, 1723, 1008, 1362, 51, + 1723, 1363, 1008, 1008, 1008, 1008, 1008, 1008, 1205, 1206, + 1206, 1206, 1206, 1206, 1206, 1364, 51, 503, 502, 1207, + 501, 1638, 51, 498, 1207, 1207, 1207, 1207, 1207, 1207, + 914, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1099, 51, + + 1364, 497, 1020, 494, 1639, 51, 1363, 1020, 1020, 1020, + 1020, 1020, 1020, 1208, 1209, 1209, 1209, 1209, 1209, 1209, + 1723, 493, 51, 492, 1210, 491, 490, 1641, 115, 1210, + 1210, 1210, 1210, 1210, 1210, 925, 1034, 1034, 1034, 1034, + 1034, 1034, 1034, 1102, 489, 1723, 488, 1035, 476, 51, + 51, 1369, 1035, 1035, 1035, 1035, 1035, 1035, 1211, 1212, + 1212, 1212, 1212, 1212, 1212, 1370, 51, 51, 475, 1213, + 474, 1654, 51, 473, 1213, 1213, 1213, 1213, 1213, 1213, + 937, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1105, 51, + 1370, 1657, 1051, 472, 51, 51, 51, 1051, 1051, 1051, + + 1051, 1051, 1051, 1214, 1215, 1215, 1215, 1215, 1215, 1215, + 1630, 51, 51, 51, 1216, 471, 1656, 51, 51, 1216, + 1216, 1216, 1216, 1216, 1216, 1218, 1219, 1219, 1219, 1219, + 1219, 1219, 1219, 1220, 51, 51, 1658, 1221, 470, 1222, + 469, 468, 1221, 1221, 1221, 1221, 1221, 1221, 1308, 1312, + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1269, 1269, 1269, + 1269, 1269, 1269, 1269, 1222, 1112, 1226, 1226, 1226, 1226, + 1226, 1226, 1226, 1114, 272, 465, 274, 1227, 448, 362, + 51, 51, 1227, 1227, 1227, 1227, 1227, 1227, 1121, 1236, + 1236, 1236, 1236, 1236, 1236, 1236, 1123, 51, 51, 445, + + 1237, 439, 1667, 1675, 51, 1237, 1237, 1237, 1237, 1237, + 1237, 1132, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1134, + 439, 51, 432, 1250, 432, 424, 1676, 51, 1250, 1250, + 1250, 1250, 1250, 1250, 1144, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1146, 415, 51, 414, 1264, 411, 410, 1681, + 51, 1264, 1264, 1264, 1264, 1264, 1264, 1156, 1277, 1277, + 1277, 1277, 1277, 1277, 1277, 1158, 409, 51, 408, 1278, + 407, 1682, 51, 51, 1278, 1278, 1278, 1278, 1278, 1278, + 1063, 1286, 1286, 1286, 1286, 1286, 1286, 1286, 1065, 51, + 51, 406, 1287, 1688, 1685, 405, 404, 1287, 1287, 1287, + + 1287, 1287, 1287, 1288, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1290, 51, 1369, 1371, 1291, 1371, 1292, 403, 402, + 1291, 1291, 1291, 1291, 1291, 1291, 401, 1723, 1372, 51, + 1723, 1377, 1378, 1378, 1378, 1378, 1378, 1378, 1391, 51, + 51, 51, 1292, 51, 614, 520, 520, 520, 520, 520, + 520, 520, 1723, 1372, 400, 1723, 51, 51, 51, 1416, + 51, 1313, 1314, 1314, 1314, 1314, 1314, 1314, 1315, 1392, + 399, 1405, 1316, 1417, 398, 51, 1400, 1316, 1316, 1316, + 1316, 1316, 1316, 1112, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1318, 51, 397, 396, 1319, 395, 1116, 1417, 390, + + 1319, 1319, 1319, 1319, 1319, 1319, 1380, 1381, 1381, 1381, + 1381, 1381, 1381, 1384, 1385, 1385, 1385, 1385, 1385, 1385, + 1416, 51, 1116, 1121, 1320, 1320, 1320, 1320, 1320, 1320, + 1320, 1321, 389, 51, 1723, 1322, 51, 1125, 51, 51, + 1322, 1322, 1322, 1322, 1322, 1322, 388, 387, 386, 1393, + 51, 315, 385, 51, 384, 383, 51, 1401, 382, 1723, + 381, 1406, 1125, 1132, 1323, 1323, 1323, 1323, 1323, 1323, + 1323, 1324, 1529, 380, 1402, 1325, 374, 1136, 274, 362, + 1325, 1325, 1325, 1325, 1325, 1325, 1422, 1423, 1423, 1423, + 1423, 1423, 1423, 1427, 1428, 1428, 1428, 1428, 1428, 1428, + + 270, 51, 1136, 1144, 1326, 1326, 1326, 1326, 1326, 1326, + 1326, 1327, 359, 267, 355, 1328, 261, 1148, 51, 255, + 1328, 1328, 1328, 1328, 1328, 1328, 1430, 1431, 1431, 1431, + 1431, 1431, 1431, 1436, 1437, 1437, 1437, 1437, 1437, 1437, + 138, 51, 1148, 1156, 1329, 1329, 1329, 1329, 1329, 1329, + 1329, 1330, 343, 342, 341, 1331, 336, 1160, 51, 315, + 1331, 1331, 1331, 1331, 1331, 1331, 1439, 1440, 1440, 1440, + 1440, 1440, 1440, 1445, 1446, 1446, 1446, 1446, 1446, 1446, + 1463, 51, 1160, 1218, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1220, 335, 334, 1464, 1335, 333, 332, 51, 51, + + 1335, 1335, 1335, 1335, 1335, 1335, 1112, 1342, 1342, 1342, + 1342, 1342, 1342, 1342, 1318, 1470, 51, 331, 1343, 1464, + 330, 51, 51, 1343, 1343, 1343, 1343, 1343, 1343, 1121, + 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1321, 51, 51, + 1689, 1350, 329, 1695, 1703, 51, 1350, 1350, 1350, 1350, + 1350, 1350, 1132, 1357, 1357, 1357, 1357, 1357, 1357, 1357, + 1324, 328, 51, 327, 1358, 326, 325, 51, 51, 1358, + 1358, 1358, 1358, 1358, 1358, 1144, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1327, 51, 51, 1705, 1366, 324, 323, + 1710, 322, 1366, 1366, 1366, 1366, 1366, 1366, 1156, 1373, + + 1373, 1373, 1373, 1373, 1373, 1373, 1330, 321, 1709, 318, + 1374, 317, 316, 51, 51, 1374, 1374, 1374, 1374, 1374, + 1374, 1288, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1290, + 51, 51, 315, 1387, 1712, 314, 51, 51, 1387, 1387, + 1387, 1387, 1387, 1387, 1218, 1407, 1407, 1407, 1407, 1407, + 1407, 1407, 1408, 51, 51, 313, 1409, 312, 1222, 1714, + 311, 1409, 1409, 1409, 1409, 1409, 1409, 1448, 1449, 1449, + 1449, 1449, 1449, 1449, 1454, 1455, 1455, 1455, 1455, 1455, + 1455, 1463, 51, 1222, 1112, 1226, 1226, 1226, 1226, 1226, + 1226, 1226, 1318, 310, 309, 1723, 1227, 308, 307, 51, + + 51, 1227, 1227, 1227, 1227, 1227, 1227, 1121, 1236, 1236, + 1236, 1236, 1236, 1236, 1236, 1321, 1542, 51, 306, 1237, + 1723, 305, 51, 51, 1237, 1237, 1237, 1237, 1237, 1237, + 1132, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1324, 51, + 51, 304, 1250, 303, 302, 51, 51, 1250, 1250, 1250, + 1250, 1250, 1250, 1144, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1327, 51, 51, 301, 1264, 300, 299, 51, 298, + 1264, 1264, 1264, 1264, 1264, 1264, 1156, 1277, 1277, 1277, + 1277, 1277, 1277, 1277, 1330, 51, 297, 296, 1278, 295, + 294, 293, 292, 1278, 1278, 1278, 1278, 1278, 1278, 1218, + + 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1408, 138, 291, + 290, 1419, 289, 288, 287, 286, 1419, 1419, 1419, 1419, + 1419, 1419, 1457, 1458, 1458, 1458, 1458, 1458, 1458, 1378, + 1378, 1378, 1378, 1378, 1378, 1378, 1465, 1465, 51, 51, + 51, 51, 51, 1495, 1496, 1496, 1496, 1496, 1496, 1496, + 1466, 1723, 1501, 285, 284, 51, 51, 51, 51, 51, + 283, 282, 281, 280, 279, 278, 1502, 1479, 1486, 1475, + 1483, 1482, 1501, 1480, 1505, 1466, 1723, 1288, 1467, 1467, + 1467, 1467, 1467, 1467, 1467, 1290, 1723, 277, 1506, 1468, + 274, 1502, 262, 267, 1468, 1468, 1468, 1468, 1468, 1468, + + 1218, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1408, 254, + 253, 1723, 1335, 1506, 252, 251, 1505, 1335, 1335, 1335, + 1335, 1335, 1335, 1428, 1428, 1428, 1428, 1428, 1428, 1428, + 1723, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1509, 1509, + 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1513, 1513, 250, + 249, 248, 1510, 1723, 247, 1723, 1517, 1517, 246, 245, + 242, 1514, 1723, 1455, 1455, 1455, 1455, 1455, 1455, 1455, + 1518, 1723, 239, 236, 235, 234, 233, 1510, 1723, 1521, + 1522, 1522, 1522, 1522, 1522, 1522, 1514, 1723, 1524, 1525, + 1525, 1525, 1525, 1525, 1525, 1518, 1723, 51, 51, 51, + + 51, 51, 51, 51, 51, 51, 230, 229, 51, 228, + 227, 226, 225, 224, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 1530, 1531, 51, 1533, 1534, 1535, 1536, + 1537, 1538, 1546, 1540, 1546, 223, 222, 1543, 1548, 1549, + 1549, 1549, 1549, 1549, 1549, 221, 1547, 220, 1723, 1552, + 1553, 1553, 1553, 1553, 1553, 1553, 1556, 1557, 1557, 1557, + 1557, 1557, 1557, 1560, 1561, 1561, 1561, 1561, 1561, 1561, + 219, 1547, 218, 1723, 1564, 1565, 1565, 1565, 1565, 1565, + 1565, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1568, 1568, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + + 217, 216, 1569, 1723, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 1573, 1580, 1583, + 215, 51, 51, 51, 211, 210, 1571, 1569, 1723, 1574, + 1575, 1577, 1596, 200, 1578, 1581, 199, 1617, 198, 1604, + 1582, 1584, 1585, 1585, 1585, 1585, 1585, 1585, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1553, 1553, 1553, 1553, 1553, + 1553, 1553, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1561, + 1561, 1561, 1561, 1561, 1561, 1561, 1565, 1565, 1565, 1565, + 1565, 1565, 1565, 1593, 1594, 1594, 1594, 1594, 1594, 1594, + 51, 195, 51, 51, 51, 51, 1585, 1585, 1585, 1585, + + 1585, 1585, 1585, 194, 51, 51, 51, 51, 1600, 51, + 51, 51, 51, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + 1606, 51, 51, 51, 51, 1601, 51, 51, 1602, 1603, + 51, 1607, 1616, 51, 51, 51, 1618, 51, 189, 51, + 1615, 51, 51, 51, 51, 188, 187, 51, 51, 51, + 51, 51, 51, 1624, 51, 1620, 51, 186, 51, 51, + 51, 1625, 1623, 1632, 51, 51, 51, 1633, 51, 1628, + 51, 51, 1631, 1634, 1640, 51, 1642, 51, 1635, 1636, + 185, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 1653, 51, 1643, 1644, 51, 184, 1645, 1646, 51, + + 51, 51, 1647, 51, 1648, 1649, 51, 51, 51, 51, + 1660, 1661, 51, 183, 51, 51, 1651, 51, 51, 182, + 1655, 51, 1659, 1662, 1663, 51, 1666, 1664, 51, 51, + 1668, 51, 51, 1670, 51, 51, 1665, 181, 51, 51, + 51, 180, 51, 51, 51, 51, 51, 51, 1669, 1673, + 1671, 176, 51, 1672, 1677, 175, 51, 51, 1674, 51, + 51, 51, 51, 1679, 51, 51, 174, 51, 1678, 51, + 51, 51, 1680, 1683, 1684, 1686, 51, 173, 172, 51, + 51, 1687, 51, 1690, 51, 171, 170, 51, 51, 169, + 51, 51, 51, 51, 1691, 1692, 51, 51, 1694, 51, + + 51, 1696, 1697, 1693, 51, 168, 1699, 51, 51, 51, + 51, 51, 1698, 51, 51, 51, 51, 51, 51, 1701, + 1700, 51, 1704, 51, 51, 51, 167, 51, 51, 1702, + 166, 51, 51, 1706, 165, 51, 1707, 164, 163, 1708, + 51, 51, 51, 162, 1711, 161, 160, 1713, 155, 1715, + 1717, 1716, 146, 145, 51, 140, 1718, 1721, 1722, 1719, + 55, 1720, 52, 43, 41, 1723, 1723, 1723, 1723, 1723, + 1723, 51, 42, 1723, 42, 59, 1723, 59, 59, 59, + 59, 59, 59, 147, 1723, 147, 154, 154, 154, 266, + 266, 266, 275, 275, 275, 354, 354, 354, 357, 357, + + 357, 358, 358, 358, 365, 365, 365, 363, 363, 363, + 369, 369, 369, 373, 1723, 373, 438, 438, 438, 443, + 443, 443, 444, 444, 444, 453, 453, 453, 457, 1723, + 457, 458, 458, 458, 367, 367, 1723, 1723, 367, 462, + 462, 462, 466, 466, 466, 357, 357, 357, 527, 527, + 527, 531, 531, 531, 532, 532, 532, 533, 533, 533, + 365, 365, 365, 538, 538, 538, 451, 451, 1723, 1723, + 451, 543, 543, 543, 547, 547, 547, 551, 1723, 551, + 552, 552, 552, 556, 556, 556, 560, 1723, 560, 619, + 619, 619, 453, 453, 453, 627, 627, 627, 628, 628, + + 628, 636, 636, 636, 640, 1723, 640, 643, 1723, 643, + 644, 644, 644, 648, 648, 648, 652, 1723, 652, 550, + 550, 1723, 1723, 550, 554, 554, 1723, 1723, 554, 658, + 658, 658, 662, 662, 662, 560, 560, 1723, 560, 532, + 532, 532, 708, 708, 708, 712, 712, 712, 715, 715, + 715, 716, 716, 716, 717, 717, 717, 722, 722, 722, + 634, 634, 1723, 1723, 634, 727, 727, 727, 731, 731, + 731, 640, 640, 1723, 640, 642, 642, 1723, 1723, 642, + 643, 643, 1723, 643, 644, 644, 646, 646, 1723, 1723, + 646, 738, 738, 738, 742, 742, 742, 652, 652, 1723, + + 652, 746, 1723, 746, 749, 1723, 749, 750, 750, 750, + 754, 754, 754, 758, 1723, 758, 797, 797, 797, 636, + 636, 636, 648, 648, 648, 808, 808, 808, 809, 809, + 809, 817, 817, 817, 821, 1723, 821, 824, 1723, 824, + 825, 825, 825, 829, 829, 829, 833, 1723, 833, 836, + 1723, 836, 839, 1723, 839, 840, 840, 840, 844, 844, + 844, 848, 1723, 848, 745, 1723, 1723, 745, 746, 746, + 1723, 746, 748, 748, 1723, 1723, 748, 749, 749, 1723, + 749, 750, 750, 752, 752, 1723, 1723, 752, 855, 855, + 855, 859, 859, 859, 758, 758, 1723, 758, 49, 49, + + 49, 1723, 49, 49, 716, 716, 716, 891, 891, 891, + 895, 895, 895, 898, 898, 898, 901, 901, 901, 902, + 902, 902, 903, 903, 903, 908, 908, 908, 815, 815, + 1723, 1723, 815, 913, 913, 913, 917, 917, 917, 821, + 821, 1723, 821, 823, 823, 1723, 1723, 823, 824, 824, + 1723, 824, 825, 825, 827, 827, 1723, 1723, 827, 924, + 924, 924, 928, 928, 928, 833, 833, 1723, 833, 835, + 1723, 1723, 835, 836, 836, 1723, 836, 838, 838, 1723, + 1723, 838, 839, 839, 1723, 839, 840, 840, 842, 842, + 1723, 1723, 842, 936, 936, 936, 940, 940, 940, 848, + + 848, 1723, 848, 942, 1723, 942, 945, 1723, 945, 948, + 1723, 948, 949, 949, 949, 953, 953, 953, 957, 1723, + 957, 49, 49, 49, 1723, 49, 49, 985, 985, 985, + 817, 817, 817, 829, 829, 829, 844, 844, 844, 999, + 999, 999, 1000, 1000, 1000, 1008, 1008, 1008, 1012, 1723, + 1012, 1015, 1723, 1015, 1016, 1016, 1016, 1020, 1020, 1020, + 1024, 1723, 1024, 1027, 1723, 1027, 1030, 1723, 1030, 1031, + 1031, 1031, 1035, 1035, 1035, 1039, 1723, 1039, 1040, 1723, + 1040, 1043, 1723, 1043, 1046, 1723, 1046, 1047, 1047, 1047, + 1051, 1051, 1051, 1055, 1723, 1055, 942, 1723, 942, 944, + + 1723, 1723, 944, 945, 945, 1723, 945, 947, 947, 1723, + 1723, 947, 948, 948, 1723, 948, 949, 949, 951, 951, + 1723, 1723, 951, 1062, 1062, 1062, 1066, 1066, 1066, 957, + 957, 1723, 957, 49, 49, 49, 1723, 49, 49, 902, + 902, 902, 1093, 1093, 1093, 1097, 1097, 1097, 1100, 1100, + 1100, 1103, 1103, 1103, 1106, 1106, 1106, 1107, 1107, 1107, + 1115, 1115, 1115, 1006, 1006, 1723, 1723, 1006, 1120, 1120, + 1120, 1124, 1124, 1124, 1012, 1012, 1723, 1012, 1014, 1014, + 1723, 1723, 1014, 1015, 1015, 1723, 1015, 1016, 1016, 1018, + 1018, 1723, 1723, 1018, 1131, 1131, 1131, 1135, 1135, 1135, + + 1024, 1024, 1723, 1024, 1026, 1723, 1723, 1026, 1027, 1027, + 1723, 1027, 1029, 1029, 1723, 1723, 1029, 1030, 1030, 1723, + 1030, 1031, 1031, 1033, 1033, 1723, 1723, 1033, 1143, 1143, + 1143, 1147, 1147, 1147, 1039, 1039, 1723, 1039, 1040, 1723, + 1040, 1042, 1723, 1723, 1042, 1043, 1043, 1723, 1043, 1045, + 1045, 1723, 1723, 1045, 1046, 1046, 1723, 1046, 1047, 1047, + 1049, 1049, 1723, 1723, 1049, 1155, 1155, 1155, 1159, 1159, + 1159, 1055, 1055, 1723, 1055, 1161, 1723, 1161, 1164, 1723, + 1164, 1167, 1723, 1167, 1168, 1168, 1168, 1172, 1172, 1172, + 1176, 1723, 1176, 49, 49, 49, 1723, 49, 49, 1200, + + 1200, 1200, 1008, 1008, 1008, 1020, 1020, 1020, 1035, 1035, + 1035, 1051, 1051, 1051, 1217, 1217, 1217, 1223, 1223, 1223, + 1221, 1221, 1221, 1228, 1228, 1228, 1227, 1227, 1227, 1229, + 1723, 1229, 1232, 1723, 1232, 1233, 1233, 1233, 1238, 1238, + 1238, 1237, 1237, 1237, 1239, 1723, 1239, 1242, 1723, 1242, + 1245, 1723, 1245, 1246, 1246, 1246, 1251, 1251, 1251, 1250, + 1250, 1250, 1252, 1723, 1252, 1253, 1723, 1253, 1256, 1723, + 1256, 1259, 1723, 1259, 1260, 1260, 1260, 1265, 1265, 1265, + 1264, 1264, 1264, 1266, 1723, 1266, 1267, 1723, 1267, 1270, + 1723, 1270, 1273, 1723, 1273, 1274, 1274, 1274, 1279, 1279, + + 1279, 1278, 1278, 1278, 1280, 1723, 1280, 1161, 1723, 1161, + 1163, 1723, 1723, 1163, 1164, 1164, 1723, 1164, 1166, 1166, + 1723, 1723, 1166, 1167, 1167, 1723, 1167, 1168, 1168, 1170, + 1170, 1723, 1723, 1170, 1287, 1287, 1287, 1291, 1291, 1291, + 1176, 1176, 1723, 1176, 49, 49, 49, 1723, 49, 49, + 1107, 1107, 1107, 1319, 1319, 1319, 1322, 1322, 1322, 1325, + 1325, 1325, 1328, 1328, 1328, 1331, 1331, 1331, 1336, 1336, + 1336, 1335, 1335, 1335, 1338, 1723, 1338, 1339, 1339, 1339, + 1225, 1225, 1723, 1723, 1225, 1343, 1343, 1343, 1344, 1344, + 1344, 1229, 1229, 1723, 1229, 1231, 1231, 1723, 1723, 1231, + + 1232, 1232, 1723, 1232, 1233, 1233, 1235, 1235, 1723, 1723, + 1235, 1350, 1350, 1350, 1351, 1351, 1351, 1239, 1239, 1723, + 1239, 1241, 1723, 1723, 1241, 1242, 1242, 1723, 1242, 1244, + 1244, 1723, 1723, 1244, 1245, 1245, 1723, 1245, 1246, 1246, + 1248, 1248, 1723, 1723, 1248, 1358, 1358, 1358, 1359, 1359, + 1359, 1252, 1252, 1723, 1252, 1253, 1723, 1253, 1255, 1723, + 1723, 1255, 1256, 1256, 1723, 1256, 1258, 1258, 1723, 1723, + 1258, 1259, 1259, 1723, 1259, 1260, 1260, 1262, 1262, 1723, + 1723, 1262, 1366, 1366, 1366, 1367, 1367, 1367, 1266, 1266, + 1723, 1266, 1267, 1723, 1267, 1269, 1723, 1723, 1269, 1270, + + 1270, 1723, 1270, 1272, 1272, 1723, 1723, 1272, 1273, 1273, + 1723, 1273, 1274, 1274, 1276, 1276, 1723, 1723, 1276, 1374, + 1374, 1374, 1375, 1375, 1375, 1280, 1280, 1723, 1280, 1376, + 1723, 1376, 1379, 1723, 1379, 1382, 1723, 1382, 1383, 1383, + 1383, 1388, 1723, 1388, 1387, 1387, 1387, 1389, 1723, 1389, + 49, 49, 49, 1723, 49, 49, 1410, 1723, 1410, 1409, + 1409, 1409, 1411, 1723, 1411, 1227, 1227, 1227, 1412, 1723, + 1412, 1237, 1237, 1237, 1413, 1723, 1413, 1250, 1250, 1250, + 1414, 1723, 1414, 1264, 1264, 1264, 1415, 1723, 1415, 1278, + 1278, 1278, 1333, 1333, 1723, 1723, 1333, 1419, 1419, 1419, + + 1420, 1420, 1420, 365, 365, 365, 1338, 1338, 1723, 1338, + 1421, 1421, 1421, 1424, 1723, 1424, 1425, 1425, 1425, 1426, + 1426, 1426, 1429, 1723, 1429, 1432, 1723, 1432, 1433, 1433, + 1433, 1434, 1434, 1434, 1435, 1723, 1435, 1438, 1723, 1438, + 1441, 1723, 1441, 1442, 1442, 1442, 1443, 1443, 1443, 1444, + 1723, 1444, 1447, 1723, 1447, 1450, 1723, 1450, 1451, 1451, + 1451, 1452, 1452, 1452, 1453, 1723, 1453, 1456, 1723, 1456, + 1459, 1723, 1459, 1460, 1460, 1460, 1461, 1461, 1461, 1376, + 1723, 1376, 1378, 1723, 1723, 1378, 1379, 1379, 1723, 1379, + 1381, 1381, 1723, 1723, 1381, 1382, 1382, 1723, 1382, 1383, + + 1383, 1385, 1385, 1723, 1723, 1385, 1468, 1468, 1468, 1469, + 1723, 1469, 1389, 1389, 1723, 1389, 49, 49, 49, 1723, + 49, 49, 1487, 1487, 1487, 1335, 1335, 1335, 1489, 1723, + 1489, 1490, 1723, 1490, 1491, 1723, 1491, 1492, 1723, 1492, + 1493, 1723, 1493, 1494, 1723, 1494, 1497, 1723, 1497, 1498, + 1498, 1498, 1499, 1499, 1499, 1500, 1723, 1500, 1423, 1423, + 1723, 1723, 1423, 1424, 1424, 1723, 1424, 1425, 1425, 1503, + 1723, 1503, 1428, 1723, 1723, 1428, 1429, 1429, 1723, 1429, + 1431, 1431, 1723, 1723, 1431, 1432, 1432, 1723, 1432, 1433, + 1433, 1507, 1723, 1507, 1435, 1723, 1435, 1437, 1723, 1723, + + 1437, 1438, 1438, 1723, 1438, 1440, 1440, 1723, 1723, 1440, + 1441, 1441, 1723, 1441, 1442, 1442, 1511, 1723, 1511, 1444, + 1723, 1444, 1446, 1723, 1723, 1446, 1447, 1447, 1723, 1447, + 1449, 1449, 1723, 1723, 1449, 1450, 1450, 1723, 1450, 1451, + 1451, 1515, 1723, 1515, 1453, 1723, 1453, 1455, 1723, 1723, + 1455, 1456, 1456, 1723, 1456, 1458, 1458, 1723, 1723, 1458, + 1459, 1459, 1723, 1459, 1460, 1460, 1519, 1723, 1519, 1520, + 1723, 1520, 1523, 1723, 1523, 1526, 1723, 1526, 1527, 1527, + 1527, 1528, 1723, 1528, 49, 49, 49, 1723, 49, 49, + 1545, 1723, 1545, 1421, 1723, 1421, 1426, 1723, 1426, 1434, + + 1723, 1434, 1443, 1723, 1443, 1452, 1723, 1452, 1461, 1723, + 1461, 1496, 1496, 1723, 1723, 1496, 1497, 1497, 1723, 1497, + 1498, 1498, 1488, 1723, 1488, 1550, 1723, 1550, 1551, 1723, + 1551, 1554, 1723, 1554, 1555, 1723, 1555, 1558, 1723, 1558, + 1559, 1723, 1559, 1562, 1723, 1562, 1563, 1723, 1563, 1566, + 1723, 1566, 1522, 1723, 1723, 1522, 1525, 1525, 1723, 1723, + 1525, 1570, 1723, 1570, 1499, 1723, 1499, 1586, 1723, 1586, + 1549, 1723, 1723, 1549, 1553, 1723, 1723, 1553, 1557, 1723, + 1723, 1557, 1561, 1723, 1723, 1561, 1565, 1723, 1723, 1565, + 1592, 1723, 1592, 1595, 1723, 1595, 1585, 1723, 1723, 1585, + + 1609, 1723, 1609, 1610, 1723, 1610, 1611, 1723, 1611, 1612, + 1723, 1612, 1613, 1723, 1613, 1594, 1723, 1723, 1594, 1626, + 1723, 1626, 1627, 1723, 1627, 3, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723 + } ; + +static yyconst flex_int16_t yy_chk[7679] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 14, 14, 674, 11, 11, 11, 674, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 16, 16, 20, 23, 20, + + 20, 31, 23, 408, 20, 24, 24, 25, 23, 20, + 31, 23, 25, 20, 21, 20, 90, 408, 90, 12, + 17, 17, 17, 17, 17, 17, 17, 17, 21, 22, + 89, 1270, 26, 89, 17, 21, 26, 34, 101, 22, + 97, 34, 22, 27, 101, 27, 22, 93, 26, 34, + 27, 27, 93, 27, 34, 1273, 34, 27, 129, 17, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 29, 29, 97, 18, 1274, 36, 129, 36, 18, 18, + 18, 18, 18, 18, 28, 29, 1278, 28, 28, 29, + 28, 36, 28, 29, 28, 29, 28, 30, 36, 28, + + 33, 30, 29, 32, 150, 33, 33, 102, 33, 33, + 30, 30, 102, 38, 30, 32, 30, 32, 35, 32, + 98, 38, 32, 133, 35, 38, 35, 38, 35, 150, + 124, 217, 35, 133, 35, 35, 44, 44, 44, 44, + 44, 44, 44, 124, 217, 105, 98, 44, 105, 247, + 105, 98, 44, 44, 44, 44, 44, 44, 45, 45, + 45, 45, 45, 45, 45, 158, 246, 581, 246, 45, + 262, 262, 247, 581, 45, 45, 45, 45, 45, 45, + 46, 46, 46, 46, 46, 46, 46, 46, 668, 334, + 158, 668, 46, 78, 334, 269, 346, 46, 46, 46, + + 46, 46, 46, 48, 48, 48, 48, 48, 48, 48, + 48, 50, 50, 50, 50, 50, 50, 50, 371, 78, + 269, 346, 50, 432, 432, 78, 1279, 50, 50, 50, + 50, 50, 50, 52, 52, 52, 52, 52, 52, 52, + 614, 614, 667, 371, 52, 665, 665, 667, 434, 52, + 52, 52, 52, 52, 52, 58, 58, 58, 58, 58, + 58, 58, 131, 261, 261, 261, 261, 261, 261, 261, + 350, 131, 148, 434, 148, 148, 148, 148, 148, 148, + 148, 441, 447, 1280, 350, 148, 279, 279, 279, 279, + 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, + + 149, 149, 149, 149, 461, 279, 441, 447, 149, 350, + 149, 1287, 461, 149, 149, 149, 149, 149, 149, 272, + 272, 272, 272, 272, 272, 272, 356, 356, 356, 356, + 356, 356, 356, 366, 681, 149, 151, 151, 151, 151, + 151, 151, 151, 151, 455, 518, 666, 366, 151, 558, + 622, 681, 666, 151, 151, 151, 151, 151, 151, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 1291, 455, + 518, 152, 366, 625, 558, 622, 152, 152, 152, 152, + 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, + 155, 155, 155, 155, 155, 155, 155, 155, 625, 686, + + 686, 155, 561, 561, 561, 561, 155, 155, 155, 155, + 155, 155, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 367, 631, 1316, 157, 392, 157, 759, 304, 157, + 157, 157, 157, 157, 157, 367, 304, 360, 360, 360, + 360, 360, 360, 360, 759, 392, 405, 631, 304, 670, + 1319, 157, 255, 255, 255, 255, 255, 255, 255, 405, + 367, 392, 638, 255, 304, 675, 1322, 670, 255, 255, + 255, 255, 255, 255, 257, 257, 257, 257, 257, 257, + 257, 542, 673, 675, 673, 257, 1325, 638, 650, 542, + 257, 257, 257, 257, 257, 257, 258, 258, 258, 258, + + 258, 258, 258, 258, 260, 260, 260, 260, 260, 260, + 260, 552, 677, 650, 677, 260, 696, 696, 1328, 552, + 260, 260, 260, 260, 260, 260, 263, 263, 263, 263, + 263, 263, 263, 263, 657, 705, 1331, 1335, 263, 1336, + 1337, 703, 657, 263, 263, 263, 263, 263, 263, 265, + 265, 265, 265, 265, 265, 265, 265, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 703, 1338, 1339, 268, + 705, 268, 761, 450, 268, 268, 268, 268, 268, 268, + 431, 431, 431, 431, 431, 431, 431, 450, 679, 761, + 1343, 1344, 676, 451, 522, 679, 268, 273, 273, 273, + + 273, 273, 273, 273, 273, 273, 676, 451, 522, 273, + 1350, 771, 450, 680, 273, 273, 273, 273, 273, 273, + 274, 274, 274, 274, 274, 274, 274, 680, 771, 771, + 744, 274, 451, 522, 481, 671, 274, 274, 274, 274, + 274, 274, 339, 481, 339, 671, 339, 339, 459, 459, + 459, 459, 459, 459, 459, 744, 339, 549, 339, 339, + 550, 339, 344, 483, 344, 344, 344, 344, 344, 344, + 344, 549, 483, 1351, 550, 344, 756, 1358, 782, 1359, + 344, 344, 344, 344, 344, 344, 345, 345, 345, 345, + 345, 345, 345, 345, 682, 782, 549, 1366, 345, 550, + + 345, 756, 682, 345, 345, 345, 345, 345, 345, 463, + 463, 463, 463, 463, 463, 463, 535, 535, 535, 535, + 535, 535, 535, 553, 678, 345, 347, 347, 347, 347, + 347, 347, 347, 347, 800, 678, 1367, 553, 347, 1374, + 783, 768, 554, 347, 347, 347, 347, 347, 347, 351, + 351, 351, 351, 351, 351, 351, 554, 783, 768, 800, + 351, 768, 553, 760, 684, 351, 351, 351, 351, 351, + 351, 352, 352, 352, 352, 352, 352, 352, 352, 684, + 760, 554, 1375, 352, 803, 806, 812, 760, 352, 352, + 352, 352, 352, 352, 353, 353, 353, 353, 353, 353, + + 353, 353, 355, 355, 355, 355, 355, 355, 355, 803, + 806, 812, 819, 355, 1379, 1382, 767, 685, 355, 355, + 355, 355, 355, 355, 359, 359, 359, 359, 359, 359, + 359, 359, 685, 767, 1383, 359, 1387, 819, 767, 769, + 359, 359, 359, 359, 359, 359, 361, 361, 361, 361, + 361, 361, 361, 361, 361, 1389, 769, 1408, 361, 769, + 774, 784, 779, 361, 361, 361, 361, 361, 361, 362, + 362, 362, 362, 362, 362, 362, 362, 774, 784, 779, + 362, 784, 774, 778, 779, 362, 362, 362, 362, 362, + 362, 368, 368, 368, 368, 368, 368, 368, 368, 368, + + 778, 1409, 831, 368, 1419, 1420, 785, 778, 368, 368, + 368, 368, 368, 368, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 785, 1424, 1425, 370, 831, 370, 582, + 687, 370, 370, 370, 370, 370, 370, 485, 582, 485, + 583, 633, 485, 485, 687, 634, 485, 485, 669, 583, + 683, 485, 695, 370, 391, 633, 1429, 669, 391, 634, + 683, 391, 695, 641, 391, 642, 391, 391, 391, 391, + 425, 425, 425, 425, 425, 425, 425, 641, 1432, 642, + 633, 425, 834, 786, 634, 688, 425, 425, 425, 425, + 425, 425, 427, 427, 427, 427, 427, 427, 427, 688, + + 786, 1433, 641, 427, 642, 846, 887, 834, 427, 427, + 427, 427, 427, 427, 428, 428, 428, 428, 428, 428, + 428, 428, 430, 430, 430, 430, 430, 430, 430, 726, + 846, 887, 943, 430, 955, 1438, 790, 726, 430, 430, + 430, 430, 430, 430, 433, 433, 433, 433, 433, 433, + 433, 433, 737, 790, 1441, 1442, 433, 943, 433, 955, + 737, 433, 433, 433, 433, 433, 433, 540, 540, 540, + 540, 540, 540, 540, 544, 544, 544, 544, 544, 544, + 544, 762, 645, 433, 435, 435, 435, 435, 435, 435, + 435, 988, 1447, 991, 994, 435, 645, 861, 762, 691, + + 435, 435, 435, 435, 435, 435, 436, 436, 436, 436, + 436, 436, 436, 691, 861, 762, 988, 436, 991, 994, + 1450, 645, 436, 436, 436, 436, 436, 436, 437, 437, + 437, 437, 437, 437, 437, 437, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 694, 646, 1451, 440, 1456, + 440, 1459, 1460, 440, 440, 440, 440, 440, 440, 694, + 646, 653, 653, 653, 653, 653, 653, 653, 655, 655, + 655, 655, 655, 655, 655, 440, 446, 446, 446, 446, + 446, 446, 446, 446, 446, 646, 1468, 1497, 446, 1498, + 446, 1523, 1526, 446, 446, 446, 446, 446, 446, 659, + + 659, 659, 659, 659, 659, 659, 719, 719, 719, 719, + 719, 719, 719, 747, 763, 446, 452, 452, 452, 452, + 452, 452, 452, 452, 452, 997, 1550, 747, 452, 1554, + 1003, 763, 862, 452, 452, 452, 452, 452, 452, 454, + 454, 454, 454, 454, 454, 454, 454, 454, 763, 862, + 997, 454, 747, 454, 862, 1003, 454, 454, 454, 454, + 454, 454, 724, 724, 724, 724, 724, 724, 724, 728, + 728, 728, 728, 728, 728, 728, 748, 764, 454, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 1558, 1010, + 748, 464, 1562, 883, 764, 751, 464, 464, 464, 464, + + 464, 464, 465, 465, 465, 465, 465, 465, 465, 751, + 883, 764, 1566, 465, 1010, 748, 792, 792, 465, 465, + 465, 465, 465, 465, 516, 752, 516, 516, 516, 516, + 516, 516, 516, 792, 751, 1586, 1022, 516, 1595, 752, + 974, 863, 516, 516, 516, 516, 516, 516, 517, 517, + 517, 517, 517, 517, 517, 517, 1266, 974, 863, 974, + 517, 1022, 517, 863, 752, 517, 517, 517, 517, 517, + 517, 733, 733, 733, 733, 733, 733, 733, 735, 735, + 735, 735, 735, 735, 735, 766, 772, 517, 519, 519, + 519, 519, 519, 519, 519, 519, 854, 1265, 1264, 1025, + + 519, 1037, 766, 772, 854, 519, 519, 519, 519, 519, + 519, 523, 523, 523, 523, 523, 523, 523, 523, 766, + 1260, 1259, 772, 523, 1025, 1041, 1037, 1053, 523, 523, + 523, 523, 523, 523, 524, 524, 524, 524, 524, 524, + 524, 524, 525, 525, 525, 525, 525, 525, 525, 912, + 1041, 1256, 1053, 525, 1109, 1162, 1174, 912, 525, 525, + 525, 525, 525, 525, 526, 526, 526, 526, 526, 526, + 526, 526, 528, 528, 528, 528, 528, 528, 528, 1109, + 1162, 1174, 1203, 528, 1252, 1251, 864, 866, 528, 528, + 528, 528, 528, 528, 529, 529, 529, 529, 529, 529, + + 529, 529, 529, 864, 866, 1250, 529, 1203, 864, 866, + 814, 529, 529, 529, 529, 529, 529, 530, 530, 530, + 530, 530, 530, 530, 814, 1246, 1206, 1245, 530, 1242, + 868, 869, 1239, 530, 530, 530, 530, 530, 530, 534, + 534, 534, 534, 534, 534, 534, 534, 868, 869, 814, + 534, 1206, 868, 869, 871, 534, 534, 534, 534, 534, + 534, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 1238, 871, 1209, 536, 871, 874, 1237, 881, 536, 536, + 536, 536, 536, 536, 537, 537, 537, 537, 537, 537, + 537, 537, 874, 874, 881, 537, 1233, 1209, 875, 881, + + 537, 537, 537, 537, 537, 537, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 875, 1232, 1229, 545, 1212, + 965, 962, 875, 545, 545, 545, 545, 545, 545, 546, + 546, 546, 546, 546, 546, 546, 546, 965, 962, 1215, + 546, 962, 965, 968, 1212, 546, 546, 546, 546, 546, + 546, 555, 555, 555, 555, 555, 555, 555, 555, 555, + 968, 968, 1240, 555, 1215, 1228, 970, 969, 555, 555, + 555, 555, 555, 555, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 970, 969, 1227, 557, 1240, 557, 969, + 970, 557, 557, 557, 557, 557, 557, 739, 739, 739, + + 739, 739, 739, 739, 745, 745, 745, 745, 745, 745, + 745, 867, 773, 557, 608, 608, 608, 608, 608, 608, + 608, 1254, 1223, 1268, 1221, 608, 1314, 972, 867, 773, + 608, 608, 608, 608, 608, 608, 610, 610, 610, 610, + 610, 610, 610, 773, 972, 867, 1254, 610, 1268, 972, + 1377, 1314, 610, 610, 610, 610, 610, 610, 611, 611, + 611, 611, 611, 611, 611, 611, 613, 613, 613, 613, + 613, 613, 613, 923, 1427, 1377, 1436, 613, 1445, 878, + 976, 923, 613, 613, 613, 613, 613, 613, 615, 615, + 615, 615, 615, 615, 615, 615, 878, 976, 1220, 1427, + + 615, 1436, 976, 1445, 878, 615, 615, 615, 615, 615, + 615, 616, 616, 616, 616, 616, 616, 616, 616, 617, + 617, 617, 617, 617, 617, 617, 935, 1217, 1216, 1213, + 617, 1210, 1207, 1204, 935, 617, 617, 617, 617, 617, + 617, 618, 618, 618, 618, 618, 618, 618, 618, 621, + 621, 621, 621, 621, 621, 621, 621, 621, 765, 775, + 776, 621, 777, 621, 973, 978, 621, 621, 621, 621, + 621, 621, 1061, 1200, 1176, 765, 775, 776, 1175, 777, + 1061, 973, 978, 770, 973, 775, 776, 765, 621, 624, + 624, 624, 624, 624, 624, 624, 624, 624, 777, 780, + + 770, 624, 781, 624, 979, 1119, 624, 624, 624, 624, + 624, 624, 770, 1119, 1172, 1130, 780, 1454, 1168, 781, + 1167, 979, 787, 1130, 1164, 780, 815, 788, 624, 630, + 630, 630, 630, 630, 630, 630, 630, 630, 781, 787, + 815, 630, 1454, 630, 788, 1142, 630, 630, 630, 630, + 630, 630, 787, 1142, 1521, 1159, 788, 794, 794, 794, + 794, 794, 794, 794, 822, 815, 823, 873, 630, 635, + 635, 635, 635, 635, 635, 635, 635, 635, 822, 1521, + 823, 635, 1158, 1548, 873, 1155, 635, 635, 635, 635, + 635, 635, 637, 637, 637, 637, 637, 637, 637, 637, + + 637, 873, 826, 822, 637, 823, 637, 827, 1548, 637, + 637, 637, 637, 637, 637, 1147, 826, 1552, 1146, 1143, + 1556, 827, 835, 835, 835, 835, 835, 835, 835, 837, + 980, 637, 647, 647, 647, 647, 647, 647, 647, 647, + 647, 826, 1552, 837, 647, 1556, 827, 980, 1135, 647, + 647, 647, 647, 647, 647, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 876, 838, 841, 649, 837, 649, + 842, 1134, 649, 649, 649, 649, 649, 649, 1131, 838, + 841, 876, 1124, 1560, 842, 850, 850, 850, 850, 850, + 850, 850, 876, 865, 649, 660, 660, 660, 660, 660, + + 660, 660, 660, 660, 838, 841, 1123, 660, 1560, 842, + 865, 882, 660, 660, 660, 660, 660, 660, 661, 661, + 661, 661, 661, 661, 661, 865, 1120, 1115, 882, 661, + 1114, 984, 1071, 1079, 661, 661, 661, 661, 661, 661, + 664, 664, 664, 664, 664, 664, 664, 882, 984, 1071, + 1079, 664, 870, 872, 958, 880, 664, 664, 664, 664, + 664, 664, 852, 852, 852, 852, 852, 852, 852, 870, + 872, 958, 880, 946, 664, 699, 947, 699, 699, 699, + 699, 699, 699, 699, 870, 872, 958, 946, 699, 880, + 947, 1083, 1074, 699, 699, 699, 699, 699, 699, 700, + + 700, 700, 700, 700, 700, 700, 700, 1111, 1083, 1074, + 1083, 700, 946, 1074, 1110, 947, 700, 700, 700, 700, + 700, 700, 701, 701, 701, 701, 701, 701, 701, 856, + 856, 856, 856, 856, 856, 856, 961, 959, 877, 905, + 905, 905, 905, 905, 905, 905, 910, 910, 910, 910, + 910, 910, 910, 961, 959, 877, 701, 702, 702, 702, + 702, 702, 702, 702, 877, 1107, 1106, 1103, 702, 959, + 961, 1564, 1584, 702, 702, 702, 702, 702, 702, 704, + 704, 704, 704, 704, 704, 704, 704, 706, 706, 706, + 706, 706, 706, 706, 706, 1154, 1564, 1584, 1100, 706, + + 1593, 1097, 1093, 1154, 706, 706, 706, 706, 706, 706, + 707, 707, 707, 707, 707, 707, 707, 707, 709, 709, + 709, 709, 709, 709, 709, 1593, 1066, 1062, 1055, 709, + 1054, 1051, 1077, 1078, 709, 709, 709, 709, 709, 709, + 710, 710, 710, 710, 710, 710, 710, 710, 710, 1077, + 1078, 1047, 710, 1077, 1082, 1078, 950, 710, 710, 710, + 710, 710, 710, 711, 711, 711, 711, 711, 711, 711, + 950, 1082, 1046, 1043, 711, 1039, 1082, 1087, 1038, 711, + 711, 711, 711, 711, 711, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 1087, 950, 1035, 713, 1031, 1085, + + 1087, 951, 713, 713, 713, 713, 713, 713, 714, 714, + 714, 714, 714, 714, 714, 951, 1085, 1085, 1030, 714, + 1027, 1177, 1088, 1024, 714, 714, 714, 714, 714, 714, + 718, 718, 718, 718, 718, 718, 718, 718, 1177, 1088, + 951, 718, 1088, 1023, 1178, 1020, 718, 718, 718, 718, + 718, 718, 720, 720, 720, 720, 720, 720, 720, 720, + 720, 1178, 1177, 1016, 720, 1015, 1179, 1181, 1012, 720, + 720, 720, 720, 720, 720, 721, 721, 721, 721, 721, + 721, 721, 721, 1179, 1181, 1178, 721, 1011, 1008, 1180, + 1004, 721, 721, 721, 721, 721, 721, 729, 729, 729, + + 729, 729, 729, 729, 729, 729, 1180, 1179, 1180, 729, + 1000, 1184, 1185, 1182, 729, 729, 729, 729, 729, 729, + 730, 730, 730, 730, 730, 730, 730, 730, 1184, 1185, + 1182, 730, 999, 1184, 998, 1196, 730, 730, 730, 730, + 730, 730, 740, 740, 740, 740, 740, 740, 740, 740, + 740, 1182, 1196, 995, 740, 992, 1196, 1197, 1293, 740, + 740, 740, 740, 740, 740, 741, 741, 741, 741, 741, + 741, 741, 741, 989, 1197, 1293, 741, 986, 985, 1197, + 1294, 741, 741, 741, 741, 741, 741, 753, 753, 753, + 753, 753, 753, 753, 753, 753, 957, 1294, 956, 753, + + 953, 949, 948, 975, 753, 753, 753, 753, 753, 753, + 755, 755, 755, 755, 755, 755, 755, 755, 755, 879, + 975, 1005, 755, 945, 755, 940, 936, 755, 755, 755, + 755, 755, 755, 975, 967, 1005, 879, 914, 914, 914, + 914, 914, 914, 914, 1076, 879, 928, 963, 1006, 755, + 789, 967, 789, 789, 789, 789, 789, 789, 789, 967, + 1005, 1076, 1006, 789, 963, 963, 1295, 789, 789, 789, + 789, 789, 789, 789, 791, 791, 791, 791, 791, 791, + 791, 1076, 963, 1295, 924, 791, 971, 1006, 1296, 1309, + 791, 791, 791, 791, 791, 791, 793, 793, 793, 793, + + 793, 793, 793, 971, 917, 1296, 1309, 793, 913, 1187, + 1297, 971, 793, 793, 793, 793, 793, 793, 795, 795, + 795, 795, 795, 795, 795, 795, 1187, 1297, 908, 903, + 795, 902, 1297, 901, 1187, 795, 795, 795, 795, 795, + 795, 796, 796, 796, 796, 796, 796, 796, 796, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 898, 895, + 891, 799, 859, 799, 855, 848, 799, 799, 799, 799, + 799, 799, 919, 919, 919, 919, 919, 919, 919, 921, + 921, 921, 921, 921, 921, 921, 847, 1396, 799, 802, + 802, 802, 802, 802, 802, 802, 802, 802, 844, 840, + + 839, 802, 836, 802, 1396, 833, 802, 802, 802, 802, + 802, 802, 925, 925, 925, 925, 925, 925, 925, 931, + 931, 931, 931, 931, 931, 931, 832, 1473, 802, 805, + 805, 805, 805, 805, 805, 805, 805, 805, 829, 825, + 824, 805, 821, 805, 1473, 820, 805, 805, 805, 805, + 805, 805, 933, 933, 933, 933, 933, 933, 933, 937, + 937, 937, 937, 937, 937, 937, 1013, 960, 805, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 817, 813, + 1013, 811, 810, 811, 960, 964, 811, 811, 811, 811, + 811, 811, 944, 944, 944, 944, 944, 944, 944, 960, + + 960, 809, 964, 808, 807, 1013, 1014, 966, 811, 816, + 816, 816, 816, 816, 816, 816, 816, 816, 964, 804, + 1014, 816, 801, 798, 966, 977, 816, 816, 816, 816, + 816, 816, 818, 818, 818, 818, 818, 818, 818, 818, + 818, 966, 977, 1017, 818, 1014, 818, 1018, 1286, 818, + 818, 818, 818, 818, 818, 797, 1286, 1017, 758, 977, + 757, 1018, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1028, + 754, 818, 828, 828, 828, 828, 828, 828, 828, 828, + 828, 750, 1017, 1028, 828, 749, 1018, 1072, 746, 828, + 828, 828, 828, 828, 828, 830, 830, 830, 830, 830, + + 830, 830, 830, 830, 1072, 1029, 1032, 830, 1028, 830, + 1033, 742, 830, 830, 830, 830, 830, 830, 1072, 1029, + 1032, 738, 731, 727, 1033, 1042, 1042, 1042, 1042, 1042, + 1042, 1042, 1044, 1302, 830, 843, 843, 843, 843, 843, + 843, 843, 843, 843, 1029, 1032, 1044, 843, 722, 1033, + 1302, 717, 843, 843, 843, 843, 843, 843, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 1068, 1045, 1048, + 845, 1044, 845, 1049, 1302, 845, 845, 845, 845, 845, + 845, 716, 1045, 1048, 1068, 715, 712, 1049, 1057, 1057, + 1057, 1057, 1057, 1057, 1057, 1068, 708, 845, 857, 857, + + 857, 857, 857, 857, 857, 857, 857, 1045, 1048, 698, + 857, 697, 1049, 1075, 1165, 857, 857, 857, 857, 857, + 857, 858, 858, 858, 858, 858, 858, 858, 1165, 693, + 1075, 692, 858, 690, 689, 1305, 672, 858, 858, 858, + 858, 858, 858, 884, 1075, 884, 884, 884, 884, 884, + 884, 884, 1305, 1165, 662, 658, 884, 1305, 1393, 1310, + 884, 884, 884, 884, 884, 884, 884, 885, 885, 885, + 885, 885, 885, 885, 1342, 1393, 1310, 652, 885, 651, + 648, 1394, 1342, 885, 885, 885, 885, 885, 885, 886, + 886, 886, 886, 886, 886, 886, 886, 1310, 1394, 1393, + + 644, 886, 1394, 886, 643, 640, 886, 886, 886, 886, + 886, 886, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1073, 1081, 886, 888, + 888, 888, 888, 888, 888, 888, 639, 636, 632, 629, + 888, 628, 627, 1073, 1081, 888, 888, 888, 888, 888, + 888, 889, 889, 889, 889, 889, 889, 889, 889, 1081, + 626, 623, 1073, 889, 620, 619, 612, 609, 889, 889, + 889, 889, 889, 889, 890, 890, 890, 890, 890, 890, + 890, 890, 892, 892, 892, 892, 892, 892, 892, 1349, + 607, 603, 597, 892, 596, 595, 1397, 1349, 892, 892, + + 892, 892, 892, 892, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 1397, 594, 590, 893, 1397, 1404, 1391, + 1166, 893, 893, 893, 893, 893, 893, 894, 894, 894, + 894, 894, 894, 894, 1166, 1404, 1391, 589, 894, 1391, + 1404, 1398, 587, 894, 894, 894, 894, 894, 894, 896, + 896, 896, 896, 896, 896, 896, 896, 896, 1398, 1166, + 586, 896, 1398, 1399, 1392, 1169, 896, 896, 896, 896, + 896, 896, 897, 897, 897, 897, 897, 897, 897, 1169, + 1399, 1392, 585, 897, 1392, 584, 1399, 580, 897, 897, + 897, 897, 897, 897, 899, 899, 899, 899, 899, 899, + + 899, 899, 899, 579, 1169, 578, 899, 577, 1401, 1474, + 1170, 899, 899, 899, 899, 899, 899, 900, 900, 900, + 900, 900, 900, 900, 1170, 1401, 1474, 576, 900, 1401, + 575, 1486, 574, 900, 900, 900, 900, 900, 900, 904, + 904, 904, 904, 904, 904, 904, 904, 1474, 1486, 1170, + 904, 1486, 573, 1529, 1481, 904, 904, 904, 904, 904, + 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, + 1529, 1481, 572, 906, 571, 570, 1483, 569, 906, 906, + 906, 906, 906, 906, 907, 907, 907, 907, 907, 907, + 907, 907, 1481, 1483, 1483, 907, 568, 567, 1531, 1532, + + 907, 907, 907, 907, 907, 907, 915, 915, 915, 915, + 915, 915, 915, 915, 915, 1531, 1532, 564, 915, 563, + 1536, 1532, 1539, 915, 915, 915, 915, 915, 915, 916, + 916, 916, 916, 916, 916, 916, 916, 1536, 562, 1539, + 916, 560, 559, 556, 1539, 916, 916, 916, 916, 916, + 916, 926, 926, 926, 926, 926, 926, 926, 926, 926, + 1536, 551, 547, 926, 543, 1543, 1571, 1573, 926, 926, + 926, 926, 926, 926, 927, 927, 927, 927, 927, 927, + 927, 927, 1543, 1571, 1573, 927, 538, 1573, 1582, 1574, + 927, 927, 927, 927, 927, 927, 938, 938, 938, 938, + + 938, 938, 938, 938, 938, 1582, 1574, 533, 938, 1574, + 1607, 1575, 1580, 938, 938, 938, 938, 938, 938, 939, + 939, 939, 939, 939, 939, 939, 939, 1607, 1575, 1580, + 939, 1575, 1580, 1600, 1602, 939, 939, 939, 939, 939, + 939, 952, 952, 952, 952, 952, 952, 952, 952, 952, + 1600, 1602, 532, 952, 1600, 531, 1602, 527, 952, 952, + 952, 952, 952, 952, 954, 954, 954, 954, 954, 954, + 954, 954, 954, 1069, 1070, 521, 954, 1080, 954, 1224, + 1089, 954, 954, 954, 954, 954, 954, 1357, 1365, 520, + 1069, 1070, 1373, 1224, 1080, 1357, 1365, 1089, 1089, 1615, + + 1373, 1069, 1070, 954, 981, 981, 981, 981, 981, 981, + 981, 981, 981, 1080, 1089, 1089, 1615, 981, 1224, 515, + 514, 981, 981, 981, 981, 981, 981, 981, 982, 982, + 982, 982, 982, 982, 982, 982, 983, 983, 983, 983, + 983, 983, 983, 983, 983, 513, 1084, 1189, 1086, 512, + 1623, 511, 1195, 983, 987, 987, 987, 987, 987, 987, + 987, 987, 987, 1084, 1189, 1086, 987, 1623, 987, 1195, + 1191, 987, 987, 987, 987, 987, 987, 1189, 1084, 1086, + 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1191, 1195, 510, + 1628, 509, 1635, 987, 990, 990, 990, 990, 990, 990, + + 990, 990, 990, 508, 1191, 507, 990, 1628, 990, 1635, + 506, 990, 990, 990, 990, 990, 990, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1121, 1121, 1121, 1121, 1121, 1121, + 1121, 505, 1659, 990, 993, 993, 993, 993, 993, 993, + 993, 993, 993, 504, 503, 501, 993, 498, 993, 1659, + 497, 993, 993, 993, 993, 993, 993, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1128, 1128, 1128, 1128, 1128, 1128, + 1128, 496, 1672, 993, 996, 996, 996, 996, 996, 996, + 996, 996, 996, 495, 494, 493, 996, 492, 996, 1672, + 490, 996, 996, 996, 996, 996, 996, 1132, 1132, 1132, + + 1132, 1132, 1132, 1132, 1138, 1138, 1138, 1138, 1138, 1138, + 1138, 1192, 1225, 996, 1001, 1001, 1001, 1001, 1001, 1001, + 1001, 1001, 489, 488, 487, 1001, 1225, 486, 1192, 484, + 1001, 1001, 1001, 1001, 1001, 1001, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 482, 1192, 480, 1002, 479, + 1002, 1225, 478, 1002, 1002, 1002, 1002, 1002, 1002, 1140, + 1140, 1140, 1140, 1140, 1140, 1140, 1144, 1144, 1144, 1144, + 1144, 1144, 1144, 1230, 1193, 1002, 1007, 1007, 1007, 1007, + 1007, 1007, 1007, 1007, 1007, 477, 476, 1230, 1007, 474, + 473, 1193, 1603, 1007, 1007, 1007, 1007, 1007, 1007, 1009, + + 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1193, 1603, + 471, 1009, 1230, 1009, 1603, 470, 1009, 1009, 1009, 1009, + 1009, 1009, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1152, + 1152, 1152, 1152, 1152, 1152, 1152, 1231, 1301, 1009, 1019, + 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 469, 466, + 1231, 1019, 462, 458, 1301, 1301, 1019, 1019, 1019, 1019, + 1019, 1019, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, + 1021, 457, 1301, 456, 1021, 1231, 1021, 453, 449, 1021, + 1021, 1021, 1021, 1021, 1021, 1156, 1156, 1156, 1156, 1156, + 1156, 1156, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1234, + + 1303, 1021, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, + 1034, 448, 445, 1234, 1034, 444, 443, 1303, 1186, 1034, + 1034, 1034, 1034, 1034, 1034, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1183, 1186, 1303, 1036, 1234, 1036, + 1418, 1467, 1036, 1036, 1036, 1036, 1036, 1036, 1418, 1467, + 1186, 1183, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1640, + 1235, 1678, 1183, 1617, 1036, 1050, 1050, 1050, 1050, 1050, + 1050, 1050, 1050, 1050, 1235, 442, 1640, 1050, 1678, 1640, + 1617, 1190, 1050, 1050, 1050, 1050, 1050, 1050, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1188, 1190, 1235, + + 1052, 1617, 1052, 1527, 439, 1052, 1052, 1052, 1052, 1052, + 1052, 1527, 1190, 438, 1188, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1405, 429, 1243, 1188, 1304, 1052, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 426, 1243, 1405, + 1064, 424, 423, 1304, 1244, 1064, 1064, 1064, 1064, 1064, + 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1244, 1405, + 1304, 422, 1065, 1243, 421, 1629, 420, 1065, 1065, 1065, + 1065, 1065, 1065, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1629, 1244, 419, 418, 1090, 1629, 417, 416, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1091, 1091, 1091, + + 1091, 1091, 1091, 1091, 1091, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 415, 1642, 1247, 1248, 414, 1257, + 1308, 1258, 1092, 1094, 1094, 1094, 1094, 1094, 1094, 1094, + 1247, 1248, 1642, 1257, 1094, 1258, 1642, 1308, 413, 1094, + 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, + 1095, 1095, 1095, 1095, 1308, 1247, 1248, 1095, 1257, 1630, + 1258, 1261, 1095, 1095, 1095, 1095, 1095, 1095, 1096, 1096, + 1096, 1096, 1096, 1096, 1096, 1261, 1630, 412, 411, 1096, + 409, 1630, 1631, 407, 1096, 1096, 1096, 1096, 1096, 1096, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1631, + + 1261, 406, 1098, 404, 1631, 1633, 1262, 1098, 1098, 1098, + 1098, 1098, 1098, 1099, 1099, 1099, 1099, 1099, 1099, 1099, + 1262, 403, 1633, 400, 1099, 399, 397, 1633, 395, 1099, + 1099, 1099, 1099, 1099, 1099, 1101, 1101, 1101, 1101, 1101, + 1101, 1101, 1101, 1101, 394, 1262, 393, 1101, 388, 1644, + 1647, 1271, 1101, 1101, 1101, 1101, 1101, 1101, 1102, 1102, + 1102, 1102, 1102, 1102, 1102, 1271, 1644, 1647, 387, 1102, + 386, 1644, 1618, 384, 1102, 1102, 1102, 1102, 1102, 1102, + 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1618, + 1271, 1647, 1104, 383, 1646, 1648, 1689, 1104, 1104, 1104, + + 1104, 1104, 1104, 1105, 1105, 1105, 1105, 1105, 1105, 1105, + 1618, 1646, 1648, 1689, 1105, 382, 1646, 1194, 1198, 1105, + 1105, 1105, 1105, 1105, 1105, 1108, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1194, 1198, 1648, 1108, 381, 1108, + 379, 374, 1108, 1108, 1108, 1108, 1108, 1108, 1194, 1198, + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1269, 1269, 1269, + 1269, 1269, 1269, 1269, 1108, 1113, 1113, 1113, 1113, 1113, + 1113, 1113, 1113, 1113, 373, 372, 369, 1113, 365, 363, + 1655, 1663, 1113, 1113, 1113, 1113, 1113, 1113, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1655, 1663, 358, + + 1122, 357, 1655, 1663, 1664, 1122, 1122, 1122, 1122, 1122, + 1122, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, + 354, 1664, 349, 1133, 348, 340, 1664, 1669, 1133, 1133, + 1133, 1133, 1133, 1133, 1145, 1145, 1145, 1145, 1145, 1145, + 1145, 1145, 1145, 338, 1669, 337, 1145, 332, 330, 1669, + 1670, 1145, 1145, 1145, 1145, 1145, 1145, 1157, 1157, 1157, + 1157, 1157, 1157, 1157, 1157, 1157, 328, 1670, 327, 1157, + 326, 1670, 1674, 1677, 1157, 1157, 1157, 1157, 1157, 1157, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1674, + 1677, 325, 1171, 1677, 1674, 324, 323, 1171, 1171, 1171, + + 1171, 1171, 1171, 1173, 1173, 1173, 1173, 1173, 1173, 1173, + 1173, 1173, 1298, 1272, 1275, 1173, 1276, 1173, 322, 320, + 1173, 1173, 1173, 1173, 1173, 1173, 319, 1272, 1275, 1298, + 1276, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1298, 1299, + 1306, 1311, 1173, 1199, 1199, 1199, 1199, 1199, 1199, 1199, + 1199, 1199, 1272, 1275, 318, 1276, 1299, 1306, 1311, 1332, + 1199, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1299, + 313, 1311, 1201, 1332, 310, 1695, 1306, 1201, 1201, 1201, + 1201, 1201, 1201, 1202, 1202, 1202, 1202, 1202, 1202, 1202, + 1202, 1202, 1695, 309, 308, 1202, 305, 1202, 1332, 298, + + 1202, 1202, 1202, 1202, 1202, 1202, 1284, 1284, 1284, 1284, + 1284, 1284, 1284, 1288, 1288, 1288, 1288, 1288, 1288, 1288, + 1333, 1300, 1202, 1205, 1205, 1205, 1205, 1205, 1205, 1205, + 1205, 1205, 297, 1312, 1333, 1205, 1470, 1205, 1300, 1307, + 1205, 1205, 1205, 1205, 1205, 1205, 295, 294, 293, 1300, + 1312, 291, 289, 1470, 288, 287, 1307, 1307, 285, 1333, + 281, 1312, 1205, 1208, 1208, 1208, 1208, 1208, 1208, 1208, + 1208, 1208, 1470, 280, 1307, 1208, 278, 1208, 275, 271, + 1208, 1208, 1208, 1208, 1208, 1208, 1340, 1340, 1340, 1340, + 1340, 1340, 1340, 1345, 1345, 1345, 1345, 1345, 1345, 1345, + + 270, 1698, 1208, 1211, 1211, 1211, 1211, 1211, 1211, 1211, + 1211, 1211, 267, 266, 264, 1211, 259, 1211, 1698, 256, + 1211, 1211, 1211, 1211, 1211, 1211, 1347, 1347, 1347, 1347, + 1347, 1347, 1347, 1353, 1353, 1353, 1353, 1353, 1353, 1353, + 254, 1705, 1211, 1214, 1214, 1214, 1214, 1214, 1214, 1214, + 1214, 1214, 253, 251, 248, 1214, 244, 1214, 1705, 240, + 1214, 1214, 1214, 1214, 1214, 1214, 1355, 1355, 1355, 1355, + 1355, 1355, 1355, 1361, 1361, 1361, 1361, 1361, 1361, 1361, + 1380, 1390, 1214, 1219, 1219, 1219, 1219, 1219, 1219, 1219, + 1219, 1219, 238, 236, 1380, 1219, 235, 233, 1390, 1679, + + 1219, 1219, 1219, 1219, 1219, 1219, 1226, 1226, 1226, 1226, + 1226, 1226, 1226, 1226, 1226, 1390, 1679, 232, 1226, 1380, + 231, 1684, 1693, 1226, 1226, 1226, 1226, 1226, 1226, 1236, + 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1684, 1693, + 1679, 1236, 230, 1684, 1693, 1696, 1236, 1236, 1236, 1236, + 1236, 1236, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, + 1249, 229, 1696, 228, 1249, 227, 225, 1701, 1702, 1249, + 1249, 1249, 1249, 1249, 1249, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1263, 1263, 1701, 1702, 1696, 1263, 223, 221, + 1702, 220, 1263, 1263, 1263, 1263, 1263, 1263, 1277, 1277, + + 1277, 1277, 1277, 1277, 1277, 1277, 1277, 218, 1701, 216, + 1277, 215, 213, 1707, 1704, 1277, 1277, 1277, 1277, 1277, + 1277, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1707, 1704, 210, 1289, 1704, 209, 1709, 1708, 1289, 1289, + 1289, 1289, 1289, 1289, 1313, 1313, 1313, 1313, 1313, 1313, + 1313, 1313, 1313, 1709, 1708, 208, 1313, 206, 1313, 1708, + 204, 1313, 1313, 1313, 1313, 1313, 1313, 1363, 1363, 1363, + 1363, 1363, 1363, 1363, 1369, 1369, 1369, 1369, 1369, 1369, + 1369, 1381, 1484, 1313, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 203, 200, 1381, 1317, 199, 197, 1484, + + 1714, 1317, 1317, 1317, 1317, 1317, 1317, 1320, 1320, 1320, + 1320, 1320, 1320, 1320, 1320, 1320, 1484, 1714, 196, 1320, + 1381, 195, 1716, 1719, 1320, 1320, 1320, 1320, 1320, 1320, + 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1716, + 1719, 194, 1323, 193, 192, 1720, 1721, 1323, 1323, 1323, + 1323, 1323, 1323, 1326, 1326, 1326, 1326, 1326, 1326, 1326, + 1326, 1326, 1720, 1721, 191, 1326, 190, 189, 1722, 188, + 1326, 1326, 1326, 1326, 1326, 1326, 1329, 1329, 1329, 1329, + 1329, 1329, 1329, 1329, 1329, 1722, 187, 186, 1329, 185, + 184, 183, 182, 1329, 1329, 1329, 1329, 1329, 1329, 1334, + + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 181, 180, + 178, 1334, 177, 174, 173, 172, 1334, 1334, 1334, 1334, + 1334, 1334, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1378, + 1378, 1378, 1378, 1378, 1378, 1378, 1384, 1385, 1395, 1400, + 1402, 1403, 1406, 1416, 1416, 1416, 1416, 1416, 1416, 1416, + 1384, 1385, 1422, 171, 170, 1395, 1400, 1402, 1403, 1406, + 169, 168, 167, 165, 162, 161, 1422, 1400, 1406, 1395, + 1403, 1402, 1423, 1400, 1430, 1384, 1385, 1386, 1386, 1386, + 1386, 1386, 1386, 1386, 1386, 1386, 1423, 160, 1430, 1386, + 159, 1422, 156, 154, 1386, 1386, 1386, 1386, 1386, 1386, + + 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 145, + 144, 1423, 1407, 1430, 143, 142, 1431, 1407, 1407, 1407, + 1407, 1407, 1407, 1428, 1428, 1428, 1428, 1428, 1428, 1428, + 1431, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1439, 1440, + 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1448, 1449, 141, + 140, 139, 1439, 1440, 137, 1431, 1457, 1458, 135, 134, + 132, 1448, 1449, 1455, 1455, 1455, 1455, 1455, 1455, 1455, + 1457, 1458, 130, 128, 127, 126, 125, 1439, 1440, 1463, + 1463, 1463, 1463, 1463, 1463, 1463, 1448, 1449, 1465, 1465, + 1465, 1465, 1465, 1465, 1465, 1457, 1458, 1471, 1475, 1472, + + 1480, 1476, 1477, 1478, 1479, 1482, 123, 122, 1485, 121, + 120, 119, 118, 116, 1471, 1475, 1472, 1480, 1476, 1477, + 1478, 1479, 1482, 1471, 1472, 1485, 1475, 1476, 1477, 1478, + 1479, 1480, 1495, 1482, 1496, 114, 113, 1485, 1501, 1501, + 1501, 1501, 1501, 1501, 1501, 112, 1495, 111, 1496, 1505, + 1505, 1505, 1505, 1505, 1505, 1505, 1509, 1509, 1509, 1509, + 1509, 1509, 1509, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 110, 1495, 109, 1496, 1517, 1517, 1517, 1517, 1517, 1517, + 1517, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1524, 1525, + 1530, 1533, 1540, 1544, 1534, 1535, 1537, 1538, 1572, 1541, + + 108, 107, 1524, 1525, 1542, 1579, 1598, 1530, 1533, 1540, + 1544, 1534, 1535, 1537, 1538, 1572, 1541, 1533, 1540, 1544, + 106, 1542, 1579, 1598, 104, 103, 1530, 1524, 1525, 1534, + 1535, 1537, 1572, 96, 1538, 1541, 95, 1598, 94, 1579, + 1542, 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1553, 1553, 1553, 1553, 1553, + 1553, 1553, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1561, + 1561, 1561, 1561, 1561, 1561, 1561, 1565, 1565, 1565, 1565, + 1565, 1565, 1565, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1576, 92, 1577, 1578, 1581, 1583, 1585, 1585, 1585, 1585, + + 1585, 1585, 1585, 91, 1596, 1599, 1597, 1576, 1576, 1577, + 1578, 1581, 1583, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + 1581, 1596, 1599, 1597, 1601, 1576, 1604, 1605, 1577, 1578, + 1606, 1583, 1597, 1616, 1619, 1620, 1599, 1621, 88, 1622, + 1596, 1601, 1624, 1604, 1605, 87, 86, 1606, 1632, 1625, + 1616, 1619, 1620, 1605, 1621, 1601, 1622, 85, 1634, 1624, + 1643, 1606, 1604, 1620, 1636, 1632, 1625, 1621, 1637, 1616, + 1638, 1639, 1619, 1622, 1632, 1634, 1634, 1643, 1624, 1625, + 84, 1636, 1641, 1645, 1650, 1637, 1649, 1638, 1639, 1652, + 1651, 1643, 1654, 1634, 1634, 1656, 83, 1636, 1636, 1641, + + 1645, 1650, 1637, 1649, 1638, 1639, 1652, 1651, 1653, 1654, + 1650, 1651, 1656, 82, 1657, 1658, 1641, 1660, 1661, 81, + 1645, 1662, 1649, 1651, 1651, 1653, 1654, 1652, 1665, 1667, + 1656, 1657, 1658, 1658, 1660, 1661, 1653, 80, 1662, 1666, + 1668, 79, 1671, 1675, 1673, 1665, 1667, 1676, 1657, 1661, + 1658, 77, 1680, 1660, 1665, 76, 1666, 1668, 1662, 1671, + 1675, 1673, 1681, 1667, 1676, 1682, 75, 1685, 1666, 1680, + 1683, 1686, 1668, 1671, 1673, 1675, 1687, 74, 73, 1681, + 1688, 1676, 1682, 1680, 1685, 72, 71, 1683, 1686, 70, + 1690, 1691, 1692, 1687, 1681, 1681, 1694, 1688, 1683, 1697, + + 1699, 1685, 1686, 1682, 1700, 69, 1688, 1690, 1691, 1692, + 1703, 1706, 1687, 1694, 1710, 1711, 1697, 1699, 1713, 1691, + 1690, 1700, 1694, 1715, 1712, 1717, 68, 1703, 1706, 1692, + 67, 1710, 1711, 1697, 66, 1713, 1699, 65, 64, 1700, + 1715, 1712, 1717, 62, 1703, 61, 60, 1706, 47, 1710, + 1712, 1711, 40, 39, 1718, 37, 1713, 1718, 1718, 1715, + 15, 1717, 13, 10, 7, 3, 0, 0, 0, 0, + 0, 1718, 1724, 0, 1724, 1725, 0, 1725, 1725, 1725, + 1725, 1725, 1725, 1726, 0, 1726, 1727, 1727, 1727, 1728, + 1728, 1728, 1729, 1729, 1729, 1730, 1730, 1730, 1731, 1731, + + 1731, 1732, 1732, 1732, 1733, 1733, 1733, 1734, 1734, 1734, + 1735, 1735, 1735, 1736, 0, 1736, 1737, 1737, 1737, 1738, + 1738, 1738, 1739, 1739, 1739, 1740, 1740, 1740, 1741, 0, + 1741, 1742, 1742, 1742, 1743, 1743, 0, 0, 1743, 1744, + 1744, 1744, 1745, 1745, 1745, 1746, 1746, 1746, 1747, 1747, + 1747, 1748, 1748, 1748, 1749, 1749, 1749, 1750, 1750, 1750, + 1751, 1751, 1751, 1752, 1752, 1752, 1753, 1753, 0, 0, + 1753, 1754, 1754, 1754, 1755, 1755, 1755, 1756, 0, 1756, + 1757, 1757, 1757, 1758, 1758, 1758, 1759, 0, 1759, 1760, + 1760, 1760, 1761, 1761, 1761, 1762, 1762, 1762, 1763, 1763, + + 1763, 1764, 1764, 1764, 1765, 0, 1765, 1766, 0, 1766, + 1767, 1767, 1767, 1768, 1768, 1768, 1769, 0, 1769, 1770, + 1770, 0, 0, 1770, 1771, 1771, 0, 0, 1771, 1772, + 1772, 1772, 1773, 1773, 1773, 1774, 1774, 0, 1774, 1775, + 1775, 1775, 1776, 1776, 1776, 1777, 1777, 1777, 1778, 1778, + 1778, 1779, 1779, 1779, 1780, 1780, 1780, 1781, 1781, 1781, + 1782, 1782, 0, 0, 1782, 1783, 1783, 1783, 1784, 1784, + 1784, 1785, 1785, 0, 1785, 1786, 1786, 0, 0, 1786, + 1787, 1787, 0, 1787, 1788, 1788, 1789, 1789, 0, 0, + 1789, 1790, 1790, 1790, 1791, 1791, 1791, 1792, 1792, 0, + + 1792, 1793, 0, 1793, 1794, 0, 1794, 1795, 1795, 1795, + 1796, 1796, 1796, 1797, 0, 1797, 1798, 1798, 1798, 1799, + 1799, 1799, 1800, 1800, 1800, 1801, 1801, 1801, 1802, 1802, + 1802, 1803, 1803, 1803, 1804, 0, 1804, 1805, 0, 1805, + 1806, 1806, 1806, 1807, 1807, 1807, 1808, 0, 1808, 1809, + 0, 1809, 1810, 0, 1810, 1811, 1811, 1811, 1812, 1812, + 1812, 1813, 0, 1813, 1814, 0, 0, 1814, 1815, 1815, + 0, 1815, 1816, 1816, 0, 0, 1816, 1817, 1817, 0, + 1817, 1818, 1818, 1819, 1819, 0, 0, 1819, 1820, 1820, + 1820, 1821, 1821, 1821, 1822, 1822, 0, 1822, 1823, 1823, + + 1823, 0, 1823, 1823, 1824, 1824, 1824, 1825, 1825, 1825, + 1826, 1826, 1826, 1827, 1827, 1827, 1828, 1828, 1828, 1829, + 1829, 1829, 1830, 1830, 1830, 1831, 1831, 1831, 1832, 1832, + 0, 0, 1832, 1833, 1833, 1833, 1834, 1834, 1834, 1835, + 1835, 0, 1835, 1836, 1836, 0, 0, 1836, 1837, 1837, + 0, 1837, 1838, 1838, 1839, 1839, 0, 0, 1839, 1840, + 1840, 1840, 1841, 1841, 1841, 1842, 1842, 0, 1842, 1843, + 0, 0, 1843, 1844, 1844, 0, 1844, 1845, 1845, 0, + 0, 1845, 1846, 1846, 0, 1846, 1847, 1847, 1848, 1848, + 0, 0, 1848, 1849, 1849, 1849, 1850, 1850, 1850, 1851, + + 1851, 0, 1851, 1852, 0, 1852, 1853, 0, 1853, 1854, + 0, 1854, 1855, 1855, 1855, 1856, 1856, 1856, 1857, 0, + 1857, 1858, 1858, 1858, 0, 1858, 1858, 1859, 1859, 1859, + 1860, 1860, 1860, 1861, 1861, 1861, 1862, 1862, 1862, 1863, + 1863, 1863, 1864, 1864, 1864, 1865, 1865, 1865, 1866, 0, + 1866, 1867, 0, 1867, 1868, 1868, 1868, 1869, 1869, 1869, + 1870, 0, 1870, 1871, 0, 1871, 1872, 0, 1872, 1873, + 1873, 1873, 1874, 1874, 1874, 1875, 0, 1875, 1876, 0, + 1876, 1877, 0, 1877, 1878, 0, 1878, 1879, 1879, 1879, + 1880, 1880, 1880, 1881, 0, 1881, 1882, 0, 1882, 1883, + + 0, 0, 1883, 1884, 1884, 0, 1884, 1885, 1885, 0, + 0, 1885, 1886, 1886, 0, 1886, 1887, 1887, 1888, 1888, + 0, 0, 1888, 1889, 1889, 1889, 1890, 1890, 1890, 1891, + 1891, 0, 1891, 1892, 1892, 1892, 0, 1892, 1892, 1893, + 1893, 1893, 1894, 1894, 1894, 1895, 1895, 1895, 1896, 1896, + 1896, 1897, 1897, 1897, 1898, 1898, 1898, 1899, 1899, 1899, + 1900, 1900, 1900, 1901, 1901, 0, 0, 1901, 1902, 1902, + 1902, 1903, 1903, 1903, 1904, 1904, 0, 1904, 1905, 1905, + 0, 0, 1905, 1906, 1906, 0, 1906, 1907, 1907, 1908, + 1908, 0, 0, 1908, 1909, 1909, 1909, 1910, 1910, 1910, + + 1911, 1911, 0, 1911, 1912, 0, 0, 1912, 1913, 1913, + 0, 1913, 1914, 1914, 0, 0, 1914, 1915, 1915, 0, + 1915, 1916, 1916, 1917, 1917, 0, 0, 1917, 1918, 1918, + 1918, 1919, 1919, 1919, 1920, 1920, 0, 1920, 1921, 0, + 1921, 1922, 0, 0, 1922, 1923, 1923, 0, 1923, 1924, + 1924, 0, 0, 1924, 1925, 1925, 0, 1925, 1926, 1926, + 1927, 1927, 0, 0, 1927, 1928, 1928, 1928, 1929, 1929, + 1929, 1930, 1930, 0, 1930, 1931, 0, 1931, 1932, 0, + 1932, 1933, 0, 1933, 1934, 1934, 1934, 1935, 1935, 1935, + 1936, 0, 1936, 1937, 1937, 1937, 0, 1937, 1937, 1938, + + 1938, 1938, 1939, 1939, 1939, 1940, 1940, 1940, 1941, 1941, + 1941, 1942, 1942, 1942, 1943, 1943, 1943, 1944, 1944, 1944, + 1945, 1945, 1945, 1946, 1946, 1946, 1947, 1947, 1947, 1948, + 0, 1948, 1949, 0, 1949, 1950, 1950, 1950, 1951, 1951, + 1951, 1952, 1952, 1952, 1953, 0, 1953, 1954, 0, 1954, + 1955, 0, 1955, 1956, 1956, 1956, 1957, 1957, 1957, 1958, + 1958, 1958, 1959, 0, 1959, 1960, 0, 1960, 1961, 0, + 1961, 1962, 0, 1962, 1963, 1963, 1963, 1964, 1964, 1964, + 1965, 1965, 1965, 1966, 0, 1966, 1967, 0, 1967, 1968, + 0, 1968, 1969, 0, 1969, 1970, 1970, 1970, 1971, 1971, + + 1971, 1972, 1972, 1972, 1973, 0, 1973, 1974, 0, 1974, + 1975, 0, 0, 1975, 1976, 1976, 0, 1976, 1977, 1977, + 0, 0, 1977, 1978, 1978, 0, 1978, 1979, 1979, 1980, + 1980, 0, 0, 1980, 1981, 1981, 1981, 1982, 1982, 1982, + 1983, 1983, 0, 1983, 1984, 1984, 1984, 0, 1984, 1984, + 1985, 1985, 1985, 1986, 1986, 1986, 1987, 1987, 1987, 1988, + 1988, 1988, 1989, 1989, 1989, 1990, 1990, 1990, 1991, 1991, + 1991, 1992, 1992, 1992, 1993, 0, 1993, 1994, 1994, 1994, + 1995, 1995, 0, 0, 1995, 1996, 1996, 1996, 1997, 1997, + 1997, 1998, 1998, 0, 1998, 1999, 1999, 0, 0, 1999, + + 2000, 2000, 0, 2000, 2001, 2001, 2002, 2002, 0, 0, + 2002, 2003, 2003, 2003, 2004, 2004, 2004, 2005, 2005, 0, + 2005, 2006, 0, 0, 2006, 2007, 2007, 0, 2007, 2008, + 2008, 0, 0, 2008, 2009, 2009, 0, 2009, 2010, 2010, + 2011, 2011, 0, 0, 2011, 2012, 2012, 2012, 2013, 2013, + 2013, 2014, 2014, 0, 2014, 2015, 0, 2015, 2016, 0, + 0, 2016, 2017, 2017, 0, 2017, 2018, 2018, 0, 0, + 2018, 2019, 2019, 0, 2019, 2020, 2020, 2021, 2021, 0, + 0, 2021, 2022, 2022, 2022, 2023, 2023, 2023, 2024, 2024, + 0, 2024, 2025, 0, 2025, 2026, 0, 0, 2026, 2027, + + 2027, 0, 2027, 2028, 2028, 0, 0, 2028, 2029, 2029, + 0, 2029, 2030, 2030, 2031, 2031, 0, 0, 2031, 2032, + 2032, 2032, 2033, 2033, 2033, 2034, 2034, 0, 2034, 2035, + 0, 2035, 2036, 0, 2036, 2037, 0, 2037, 2038, 2038, + 2038, 2039, 0, 2039, 2040, 2040, 2040, 2041, 0, 2041, + 2042, 2042, 2042, 0, 2042, 2042, 2043, 0, 2043, 2044, + 2044, 2044, 2045, 0, 2045, 2046, 2046, 2046, 2047, 0, + 2047, 2048, 2048, 2048, 2049, 0, 2049, 2050, 2050, 2050, + 2051, 0, 2051, 2052, 2052, 2052, 2053, 0, 2053, 2054, + 2054, 2054, 2055, 2055, 0, 0, 2055, 2056, 2056, 2056, + + 2057, 2057, 2057, 2058, 2058, 2058, 2059, 2059, 0, 2059, + 2060, 2060, 2060, 2061, 0, 2061, 2062, 2062, 2062, 2063, + 2063, 2063, 2064, 0, 2064, 2065, 0, 2065, 2066, 2066, + 2066, 2067, 2067, 2067, 2068, 0, 2068, 2069, 0, 2069, + 2070, 0, 2070, 2071, 2071, 2071, 2072, 2072, 2072, 2073, + 0, 2073, 2074, 0, 2074, 2075, 0, 2075, 2076, 2076, + 2076, 2077, 2077, 2077, 2078, 0, 2078, 2079, 0, 2079, + 2080, 0, 2080, 2081, 2081, 2081, 2082, 2082, 2082, 2083, + 0, 2083, 2084, 0, 0, 2084, 2085, 2085, 0, 2085, + 2086, 2086, 0, 0, 2086, 2087, 2087, 0, 2087, 2088, + + 2088, 2089, 2089, 0, 0, 2089, 2090, 2090, 2090, 2091, + 0, 2091, 2092, 2092, 0, 2092, 2093, 2093, 2093, 0, + 2093, 2093, 2094, 2094, 2094, 2095, 2095, 2095, 2096, 0, + 2096, 2097, 0, 2097, 2098, 0, 2098, 2099, 0, 2099, + 2100, 0, 2100, 2101, 0, 2101, 2102, 0, 2102, 2103, + 2103, 2103, 2104, 2104, 2104, 2105, 0, 2105, 2106, 2106, + 0, 0, 2106, 2107, 2107, 0, 2107, 2108, 2108, 2109, + 0, 2109, 2110, 0, 0, 2110, 2111, 2111, 0, 2111, + 2112, 2112, 0, 0, 2112, 2113, 2113, 0, 2113, 2114, + 2114, 2115, 0, 2115, 2116, 0, 2116, 2117, 0, 0, + + 2117, 2118, 2118, 0, 2118, 2119, 2119, 0, 0, 2119, + 2120, 2120, 0, 2120, 2121, 2121, 2122, 0, 2122, 2123, + 0, 2123, 2124, 0, 0, 2124, 2125, 2125, 0, 2125, + 2126, 2126, 0, 0, 2126, 2127, 2127, 0, 2127, 2128, + 2128, 2129, 0, 2129, 2130, 0, 2130, 2131, 0, 0, + 2131, 2132, 2132, 0, 2132, 2133, 2133, 0, 0, 2133, + 2134, 2134, 0, 2134, 2135, 2135, 2136, 0, 2136, 2137, + 0, 2137, 2138, 0, 2138, 2139, 0, 2139, 2140, 2140, + 2140, 2141, 0, 2141, 2142, 2142, 2142, 0, 2142, 2142, + 2143, 0, 2143, 2144, 0, 2144, 2145, 0, 2145, 2146, + + 0, 2146, 2147, 0, 2147, 2148, 0, 2148, 2149, 0, + 2149, 2150, 2150, 0, 0, 2150, 2151, 2151, 0, 2151, + 2152, 2152, 2153, 0, 2153, 2154, 0, 2154, 2155, 0, + 2155, 2156, 0, 2156, 2157, 0, 2157, 2158, 0, 2158, + 2159, 0, 2159, 2160, 0, 2160, 2161, 0, 2161, 2162, + 0, 2162, 2163, 0, 0, 2163, 2164, 2164, 0, 0, + 2164, 2165, 0, 2165, 2166, 0, 2166, 2167, 0, 2167, + 2168, 0, 0, 2168, 2169, 0, 0, 2169, 2170, 0, + 0, 2170, 2171, 0, 0, 2171, 2172, 0, 0, 2172, + 2173, 0, 2173, 2174, 0, 2174, 2175, 0, 0, 2175, + + 2176, 0, 2176, 2177, 0, 2177, 2178, 0, 2178, 2179, + 0, 2179, 2180, 0, 2180, 2181, 0, 0, 2181, 2182, + 0, 2182, 2183, 0, 2183, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, + 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "scanner.l" + +/* + * We want a reentrant scanner. + */ +/* + * And we need to pass the compiler state to the scanner. + */ +/* + * We don't use input, so don't generate code for it. + */ +#define YY_NO_INPUT 1 +/* + * We don't use unput, so don't generate code for it. + */ +/* + * We don't read from the terminal. + */ +/* + * We want to stop processing when we get to the end of the input. + */ +/* + * We want to generate code that can be used by a reentrant parser + * generated by Bison or Berkeley YACC. + */ +#line 67 "scanner.l" +/* + * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code distributions + * retain the above copyright notice and this paragraph in its entirety, (2) + * distributions including binary code include the above copyright notice and + * this paragraph in its entirety in the documentation or other materials + * provided with the distribution, and (3) all advertising materials mentioning + * features or use of this software display the following acknowledgement: + * ``This product includes software developed by the University of California, + * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of + * the University nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include + +#include "pcap-int.h" + +#include "gencode.h" + +#include "grammar.h" + +/* + * Earlier versions of Flex don't declare these, so we declare them + * ourselves to squelch warnings. + */ +int pcap_get_column(yyscan_t); +void pcap_set_column(int, yyscan_t); + +#ifdef INET6 + +#ifdef _WIN32 +#include +#include +/* + * To quote the MSDN page for getaddrinfo() at + * + * https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx + * + * "Support for getaddrinfo on Windows 2000 and older versions + * The getaddrinfo function was added to the Ws2_32.dll on Windows XP and + * later. To execute an application that uses this function on earlier + * versions of Windows, then you need to include the Ws2tcpip.h and + * Wspiapi.h files. When the Wspiapi.h include file is added, the + * getaddrinfo function is defined to the WspiapiGetAddrInfo inline + * function in the Wspiapi.h file. At runtime, the WspiapiGetAddrInfo + * function is implemented in such a way that if the Ws2_32.dll or the + * Wship6.dll (the file containing getaddrinfo in the IPv6 Technology + * Preview for Windows 2000) does not include getaddrinfo, then a + * version of getaddrinfo is implemented inline based on code in the + * Wspiapi.h header file. This inline code will be used on older Windows + * platforms that do not natively support the getaddrinfo function." + * + * We use getaddrinfo(), so we include Wspiapi.h here. + */ +#include +#else /* _WIN32 */ +#include /* for "struct sockaddr" in "struct addrinfo" */ +#include /* for "struct addrinfo" */ +#endif /* _WIN32 */ + +/* Workaround for AIX 4.3 */ +#if !defined(AI_NUMERICHOST) +#define AI_NUMERICHOST 0x04 +#endif + +#endif /*INET6*/ + +#include +#include "grammar.h" + +#ifdef HAVE_OS_PROTO_H +#include "os-proto.h" +#endif + +static int stoi(char *); +static inline int xdtoi(int); + +/* + * Disable diagnostics in the code generated by Flex. + */ +DIAG_OFF_FLEX + +#line 2945 "scanner.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#define YY_EXTRA_TYPE compiler_state_t * + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + yy_size_t yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + + }; /* end struct yyguts_t */ + +static int yy_init_globals (yyscan_t yyscanner ); + + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + +int pcap_lex_init (yyscan_t* scanner); + +int pcap_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int pcap_lex_destroy (yyscan_t yyscanner ); + +int pcap_get_debug (yyscan_t yyscanner ); + +void pcap_set_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE pcap_get_extra (yyscan_t yyscanner ); + +void pcap_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *pcap_get_in (yyscan_t yyscanner ); + +void pcap_set_in (FILE * _in_str ,yyscan_t yyscanner ); + +FILE *pcap_get_out (yyscan_t yyscanner ); + +void pcap_set_out (FILE * _out_str ,yyscan_t yyscanner ); + +yy_size_t pcap_get_leng (yyscan_t yyscanner ); + +char *pcap_get_text (yyscan_t yyscanner ); + +int pcap_get_lineno (yyscan_t yyscanner ); + +void pcap_set_lineno (int _line_number ,yyscan_t yyscanner ); + +int pcap_get_column (yyscan_t yyscanner ); + +void pcap_set_column (int _column_no ,yyscan_t yyscanner ); + +YYSTYPE * pcap_get_lval (yyscan_t yyscanner ); + +void pcap_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int pcap_wrap (yyscan_t yyscanner ); +#else +extern int pcap_wrap (yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (yyscan_t yyscanner ); +#else +static int input (yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int pcap_lex \ + (YYSTYPE * yylval_param ,yyscan_t yyscanner); + +#define YY_DECL int pcap_lex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yylval = yylval_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + pcap_ensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + pcap__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + pcap__load_buffer_state(yyscanner ); + } + + { +#line 254 "scanner.l" + +#line 3218 "scanner.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1724 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_current_state != 1723 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 255 "scanner.l" +return DST; + YY_BREAK +case 2: +YY_RULE_SETUP +#line 256 "scanner.l" +return SRC; + YY_BREAK +case 3: +YY_RULE_SETUP +#line 258 "scanner.l" +return LINK; + YY_BREAK +case 4: +YY_RULE_SETUP +#line 259 "scanner.l" +return LINK; + YY_BREAK +case 5: +YY_RULE_SETUP +#line 260 "scanner.l" +return ARP; + YY_BREAK +case 6: +YY_RULE_SETUP +#line 261 "scanner.l" +return RARP; + YY_BREAK +case 7: +YY_RULE_SETUP +#line 262 "scanner.l" +return IP; + YY_BREAK +case 8: +YY_RULE_SETUP +#line 263 "scanner.l" +return SCTP; + YY_BREAK +case 9: +YY_RULE_SETUP +#line 264 "scanner.l" +return TCP; + YY_BREAK +case 10: +YY_RULE_SETUP +#line 265 "scanner.l" +return UDP; + YY_BREAK +case 11: +YY_RULE_SETUP +#line 266 "scanner.l" +return ICMP; + YY_BREAK +case 12: +YY_RULE_SETUP +#line 267 "scanner.l" +return IGMP; + YY_BREAK +case 13: +YY_RULE_SETUP +#line 268 "scanner.l" +return IGRP; + YY_BREAK +case 14: +YY_RULE_SETUP +#line 269 "scanner.l" +return PIM; + YY_BREAK +case 15: +YY_RULE_SETUP +#line 270 "scanner.l" +return VRRP; + YY_BREAK +case 16: +YY_RULE_SETUP +#line 271 "scanner.l" +return CARP; + YY_BREAK +case 17: +YY_RULE_SETUP +#line 272 "scanner.l" +return RADIO; + YY_BREAK +case 18: +YY_RULE_SETUP +#line 274 "scanner.l" +return IPV6; + YY_BREAK +case 19: +YY_RULE_SETUP +#line 275 "scanner.l" +return ICMPV6; + YY_BREAK +case 20: +YY_RULE_SETUP +#line 276 "scanner.l" +return AH; + YY_BREAK +case 21: +YY_RULE_SETUP +#line 277 "scanner.l" +return ESP; + YY_BREAK +case 22: +YY_RULE_SETUP +#line 279 "scanner.l" +return ATALK; + YY_BREAK +case 23: +YY_RULE_SETUP +#line 280 "scanner.l" +return AARP; + YY_BREAK +case 24: +YY_RULE_SETUP +#line 281 "scanner.l" +return DECNET; + YY_BREAK +case 25: +YY_RULE_SETUP +#line 282 "scanner.l" +return LAT; + YY_BREAK +case 26: +YY_RULE_SETUP +#line 283 "scanner.l" +return SCA; + YY_BREAK +case 27: +YY_RULE_SETUP +#line 284 "scanner.l" +return MOPRC; + YY_BREAK +case 28: +YY_RULE_SETUP +#line 285 "scanner.l" +return MOPDL; + YY_BREAK +case 29: +YY_RULE_SETUP +#line 287 "scanner.l" +return ISO; + YY_BREAK +case 30: +YY_RULE_SETUP +#line 288 "scanner.l" +return ESIS; + YY_BREAK +case 31: +YY_RULE_SETUP +#line 289 "scanner.l" +return ESIS; + YY_BREAK +case 32: +YY_RULE_SETUP +#line 290 "scanner.l" +return ISIS; + YY_BREAK +case 33: +YY_RULE_SETUP +#line 291 "scanner.l" +return ISIS; + YY_BREAK +case 34: +YY_RULE_SETUP +#line 292 "scanner.l" +return L1; + YY_BREAK +case 35: +YY_RULE_SETUP +#line 293 "scanner.l" +return L2; + YY_BREAK +case 36: +YY_RULE_SETUP +#line 294 "scanner.l" +return IIH; + YY_BREAK +case 37: +YY_RULE_SETUP +#line 295 "scanner.l" +return LSP; + YY_BREAK +case 38: +YY_RULE_SETUP +#line 296 "scanner.l" +return SNP; + YY_BREAK +case 39: +YY_RULE_SETUP +#line 297 "scanner.l" +return CSNP; + YY_BREAK +case 40: +YY_RULE_SETUP +#line 298 "scanner.l" +return PSNP; + YY_BREAK +case 41: +YY_RULE_SETUP +#line 300 "scanner.l" +return CLNP; + YY_BREAK +case 42: +YY_RULE_SETUP +#line 302 "scanner.l" +return STP; + YY_BREAK +case 43: +YY_RULE_SETUP +#line 304 "scanner.l" +return IPX; + YY_BREAK +case 44: +YY_RULE_SETUP +#line 306 "scanner.l" +return NETBEUI; + YY_BREAK +case 45: +YY_RULE_SETUP +#line 308 "scanner.l" +return HOST; + YY_BREAK +case 46: +YY_RULE_SETUP +#line 309 "scanner.l" +return NET; + YY_BREAK +case 47: +YY_RULE_SETUP +#line 310 "scanner.l" +return NETMASK; + YY_BREAK +case 48: +YY_RULE_SETUP +#line 311 "scanner.l" +return PORT; + YY_BREAK +case 49: +YY_RULE_SETUP +#line 312 "scanner.l" +return PORTRANGE; + YY_BREAK +case 50: +YY_RULE_SETUP +#line 313 "scanner.l" +return PROTO; + YY_BREAK +case 51: +YY_RULE_SETUP +#line 314 "scanner.l" +return PROTOCHAIN; + YY_BREAK +case 52: +YY_RULE_SETUP +#line 316 "scanner.l" +return GATEWAY; + YY_BREAK +case 53: +YY_RULE_SETUP +#line 318 "scanner.l" +return TYPE; + YY_BREAK +case 54: +YY_RULE_SETUP +#line 319 "scanner.l" +return SUBTYPE; + YY_BREAK +case 55: +YY_RULE_SETUP +#line 320 "scanner.l" +return DIR; + YY_BREAK +case 56: +YY_RULE_SETUP +#line 321 "scanner.l" +return ADDR1; + YY_BREAK +case 57: +YY_RULE_SETUP +#line 322 "scanner.l" +return ADDR2; + YY_BREAK +case 58: +YY_RULE_SETUP +#line 323 "scanner.l" +return ADDR3; + YY_BREAK +case 59: +YY_RULE_SETUP +#line 324 "scanner.l" +return ADDR4; + YY_BREAK +case 60: +YY_RULE_SETUP +#line 325 "scanner.l" +return RA; + YY_BREAK +case 61: +YY_RULE_SETUP +#line 326 "scanner.l" +return TA; + YY_BREAK +case 62: +YY_RULE_SETUP +#line 328 "scanner.l" +return LESS; + YY_BREAK +case 63: +YY_RULE_SETUP +#line 329 "scanner.l" +return GREATER; + YY_BREAK +case 64: +YY_RULE_SETUP +#line 330 "scanner.l" +return CBYTE; + YY_BREAK +case 65: +YY_RULE_SETUP +#line 331 "scanner.l" +return TK_BROADCAST; + YY_BREAK +case 66: +YY_RULE_SETUP +#line 332 "scanner.l" +return TK_MULTICAST; + YY_BREAK +case 67: +YY_RULE_SETUP +#line 334 "scanner.l" +return AND; + YY_BREAK +case 68: +YY_RULE_SETUP +#line 335 "scanner.l" +return OR; + YY_BREAK +case 69: +YY_RULE_SETUP +#line 336 "scanner.l" +return '!'; + YY_BREAK +case 70: +YY_RULE_SETUP +#line 338 "scanner.l" +return LEN; + YY_BREAK +case 71: +YY_RULE_SETUP +#line 339 "scanner.l" +return INBOUND; + YY_BREAK +case 72: +YY_RULE_SETUP +#line 340 "scanner.l" +return OUTBOUND; + YY_BREAK +case 73: +YY_RULE_SETUP +#line 342 "scanner.l" +return VLAN; + YY_BREAK +case 74: +YY_RULE_SETUP +#line 343 "scanner.l" +return MPLS; + YY_BREAK +case 75: +YY_RULE_SETUP +#line 344 "scanner.l" +return PPPOED; + YY_BREAK +case 76: +YY_RULE_SETUP +#line 345 "scanner.l" +return PPPOES; + YY_BREAK +case 77: +YY_RULE_SETUP +#line 346 "scanner.l" +return GENEVE; + YY_BREAK +case 78: +YY_RULE_SETUP +#line 348 "scanner.l" +return LANE; + YY_BREAK +case 79: +YY_RULE_SETUP +#line 349 "scanner.l" +return LLC; + YY_BREAK +case 80: +YY_RULE_SETUP +#line 350 "scanner.l" +return METAC; + YY_BREAK +case 81: +YY_RULE_SETUP +#line 351 "scanner.l" +return BCC; + YY_BREAK +case 82: +YY_RULE_SETUP +#line 352 "scanner.l" +return OAM; + YY_BREAK +case 83: +YY_RULE_SETUP +#line 353 "scanner.l" +return OAMF4; + YY_BREAK +case 84: +YY_RULE_SETUP +#line 354 "scanner.l" +return OAMF4EC; + YY_BREAK +case 85: +YY_RULE_SETUP +#line 355 "scanner.l" +return OAMF4SC; + YY_BREAK +case 86: +YY_RULE_SETUP +#line 356 "scanner.l" +return SC; + YY_BREAK +case 87: +YY_RULE_SETUP +#line 357 "scanner.l" +return ILMIC; + YY_BREAK +case 88: +YY_RULE_SETUP +#line 358 "scanner.l" +return VPI; + YY_BREAK +case 89: +YY_RULE_SETUP +#line 359 "scanner.l" +return VCI; + YY_BREAK +case 90: +YY_RULE_SETUP +#line 360 "scanner.l" +return CONNECTMSG; + YY_BREAK +case 91: +YY_RULE_SETUP +#line 361 "scanner.l" +return METACONNECT; + YY_BREAK +case 92: +YY_RULE_SETUP +#line 363 "scanner.l" +return PF_IFNAME; + YY_BREAK +case 93: +YY_RULE_SETUP +#line 364 "scanner.l" +return PF_RSET; + YY_BREAK +case 94: +YY_RULE_SETUP +#line 365 "scanner.l" +return PF_RNR; + YY_BREAK +case 95: +YY_RULE_SETUP +#line 366 "scanner.l" +return PF_SRNR; + YY_BREAK +case 96: +YY_RULE_SETUP +#line 367 "scanner.l" +return PF_REASON; + YY_BREAK +case 97: +YY_RULE_SETUP +#line 368 "scanner.l" +return PF_ACTION; + YY_BREAK +case 98: +YY_RULE_SETUP +#line 370 "scanner.l" +return FISU; + YY_BREAK +case 99: +YY_RULE_SETUP +#line 371 "scanner.l" +return LSSU; + YY_BREAK +case 100: +YY_RULE_SETUP +#line 372 "scanner.l" +return LSSU; + YY_BREAK +case 101: +YY_RULE_SETUP +#line 373 "scanner.l" +return MSU; + YY_BREAK +case 102: +YY_RULE_SETUP +#line 374 "scanner.l" +return HFISU; + YY_BREAK +case 103: +YY_RULE_SETUP +#line 375 "scanner.l" +return HLSSU; + YY_BREAK +case 104: +YY_RULE_SETUP +#line 376 "scanner.l" +return HMSU; + YY_BREAK +case 105: +YY_RULE_SETUP +#line 377 "scanner.l" +return SIO; + YY_BREAK +case 106: +YY_RULE_SETUP +#line 378 "scanner.l" +return OPC; + YY_BREAK +case 107: +YY_RULE_SETUP +#line 379 "scanner.l" +return DPC; + YY_BREAK +case 108: +YY_RULE_SETUP +#line 380 "scanner.l" +return SLS; + YY_BREAK +case 109: +YY_RULE_SETUP +#line 381 "scanner.l" +return HSIO; + YY_BREAK +case 110: +YY_RULE_SETUP +#line 382 "scanner.l" +return HOPC; + YY_BREAK +case 111: +YY_RULE_SETUP +#line 383 "scanner.l" +return HDPC; + YY_BREAK +case 112: +YY_RULE_SETUP +#line 384 "scanner.l" +return HSLS; + YY_BREAK +case 113: +/* rule 113 can match eol */ +YY_RULE_SETUP +#line 386 "scanner.l" +; + YY_BREAK +case 114: +YY_RULE_SETUP +#line 387 "scanner.l" +return yytext[0]; + YY_BREAK +case 115: +YY_RULE_SETUP +#line 388 "scanner.l" +return GEQ; + YY_BREAK +case 116: +YY_RULE_SETUP +#line 389 "scanner.l" +return LEQ; + YY_BREAK +case 117: +YY_RULE_SETUP +#line 390 "scanner.l" +return NEQ; + YY_BREAK +case 118: +YY_RULE_SETUP +#line 391 "scanner.l" +return '='; + YY_BREAK +case 119: +YY_RULE_SETUP +#line 392 "scanner.l" +return LSH; + YY_BREAK +case 120: +YY_RULE_SETUP +#line 393 "scanner.l" +return RSH; + YY_BREAK +case 121: +YY_RULE_SETUP +#line 394 "scanner.l" +{ yylval->s = sdup(yyextra, yytext); return AID; } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 395 "scanner.l" +{ yylval->s = sdup(yyextra, yytext); return EID; } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 396 "scanner.l" +{ yylval->i = stoi((char *)yytext); return NUM; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 397 "scanner.l" +{ + yylval->s = sdup(yyextra, (char *)yytext); return HID; } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 399 "scanner.l" +{ +#ifdef INET6 + struct addrinfo hints, *res; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_flags = AI_NUMERICHOST; + if (getaddrinfo(yytext, NULL, &hints, &res)) { + bpf_set_error(yyextra, "bogus IPv6 address %s", yytext); + yylval->s = NULL; + } else { + freeaddrinfo(res); + yylval->s = sdup(yyextra, (char *)yytext); + } +#else + bpf_set_error(yyextra, "IPv6 address %s not supported", yytext); + yylval->s = NULL; +#endif /*INET6*/ + return HID6; + } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 418 "scanner.l" +{ bpf_set_error(yyextra, "bogus ethernet address %s", yytext); yylval->s = NULL; return EID; } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 419 "scanner.l" +{ yylval->i = 0; return NUM; } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 420 "scanner.l" +{ yylval->i = 1; return NUM; } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 421 "scanner.l" +{ yylval->i = 0; return NUM; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 422 "scanner.l" +{ yylval->i = 3; return NUM; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 423 "scanner.l" +{ yylval->i = 4; return NUM; } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 424 "scanner.l" +{ yylval->i = 5; return NUM; } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 425 "scanner.l" +{ yylval->i = 8; return NUM; } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 426 "scanner.l" +{ yylval->i = 9; return NUM; } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 427 "scanner.l" +{ yylval->i = 10; return NUM; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 428 "scanner.l" +{ yylval->i = 11; return NUM; } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 429 "scanner.l" +{ yylval->i = 12; return NUM; } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 430 "scanner.l" +{ yylval->i = 13; return NUM; } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 431 "scanner.l" +{ yylval->i = 14; return NUM; } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 432 "scanner.l" +{ yylval->i = 15; return NUM; } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 433 "scanner.l" +{ yylval->i = 16; return NUM; } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 434 "scanner.l" +{ yylval->i = 17; return NUM; } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 435 "scanner.l" +{ yylval->i = 18; return NUM; } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 437 "scanner.l" +{ yylval->i = 0; return NUM; } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 438 "scanner.l" +{ yylval->i = 1; return NUM; } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 440 "scanner.l" +{ yylval->i = 128; return NUM; } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 441 "scanner.l" +{ yylval->i = 129; return NUM; } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 442 "scanner.l" +{ yylval->i = 130; return NUM; } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 443 "scanner.l" +{ yylval->i = 131; return NUM; } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 444 "scanner.l" +{ yylval->i = 132; return NUM; } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 445 "scanner.l" +{ yylval->i = 133; return NUM; } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 446 "scanner.l" +{ yylval->i = 134; return NUM; } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 447 "scanner.l" +{ yylval->i = 135; return NUM; } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 448 "scanner.l" +{ yylval->i = 136; return NUM; } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 449 "scanner.l" +{ yylval->i = 137; return NUM; } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 450 "scanner.l" +{ yylval->i = 138; return NUM; } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 451 "scanner.l" +{ yylval->i = 139; return NUM; } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 452 "scanner.l" +{ yylval->i = 140; return NUM; } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 453 "scanner.l" +{ yylval->i = 141; return NUM; } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 454 "scanner.l" +{ yylval->i = 142; return NUM; } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 455 "scanner.l" +{ yylval->i = 143; return NUM; } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 456 "scanner.l" +{ yylval->i = 144; return NUM; } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 457 "scanner.l" +{ yylval->i = 145; return NUM; } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 458 "scanner.l" +{ yylval->i = 146; return NUM; } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 459 "scanner.l" +{ yylval->i = 147; return NUM; } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 460 "scanner.l" +{ yylval->i = 148; return NUM; } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 461 "scanner.l" +{ yylval->i = 149; return NUM; } + YY_BREAK +case 168: +YY_RULE_SETUP +#line 462 "scanner.l" +{ yylval->i = 151; return NUM; } + YY_BREAK +case 169: +YY_RULE_SETUP +#line 463 "scanner.l" +{ yylval->i = 152; return NUM; } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 464 "scanner.l" +{ yylval->i = 153; return NUM; } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 466 "scanner.l" +{ yylval->i = 13; return NUM; } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 467 "scanner.l" +{ yylval->i = 0x01; return NUM; } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 468 "scanner.l" +{ yylval->i = 0x02; return NUM; } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 469 "scanner.l" +{ yylval->i = 0x04; return NUM; } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 470 "scanner.l" +{ yylval->i = 0x08; return NUM; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 471 "scanner.l" +{ yylval->i = 0x10; return NUM; } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 472 "scanner.l" +{ yylval->i = 0x20; return NUM; } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 473 "scanner.l" +{ yylval->i = 0x40; return NUM; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 474 "scanner.l" +{ yylval->i = 0x80; return NUM; } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 475 "scanner.l" +{ + yylval->s = sdup(yyextra, (char *)yytext); return ID; } + YY_BREAK +case 181: +YY_RULE_SETUP +#line 477 "scanner.l" +{ yylval->s = sdup(yyextra, (char *)yytext + 1); return ID; } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 478 "scanner.l" +{ return LEX_ERROR; } + YY_BREAK +case 183: +YY_RULE_SETUP +#line 479 "scanner.l" +ECHO; + YY_BREAK +#line 4207 "scanner.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * pcap_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( pcap_wrap(yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of pcap_lex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + yy_size_t number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + pcap_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + pcap_restart(yyin ,yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pcap_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1724 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1724 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 1723); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + pcap_restart(yyin ,yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( pcap_wrap(yyscanner ) ) + return EOF; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void pcap_restart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + pcap_ensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + pcap__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + pcap__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + pcap__load_buffer_state(yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void pcap__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * pcap_pop_buffer_state(); + * pcap_push_buffer_state(new_buffer); + */ + pcap_ensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + pcap__load_buffer_state(yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (pcap_wrap()) processing, but the only time this flag + * is looked at is after pcap_wrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void pcap__load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE pcap__create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) pcap_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in pcap__create_buffer()" ); + + b->yy_buf_size = (yy_size_t)size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) pcap_alloc(b->yy_buf_size + 2 ,yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in pcap__create_buffer()" ); + + b->yy_is_our_buffer = 1; + + pcap__init_buffer(b,file ,yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with pcap__create_buffer() + * @param yyscanner The scanner object. + */ + void pcap__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + pcap_free((void *) b->yy_ch_buf ,yyscanner ); + + pcap_free((void *) b ,yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a pcap_restart() or at EOF. + */ + static void pcap__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + pcap__flush_buffer(b ,yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then pcap__init_buffer was _probably_ + * called from pcap_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void pcap__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + pcap__load_buffer_state(yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void pcap_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + pcap_ensure_buffer_stack(yyscanner); + + /* This block is copied from pcap__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from pcap__switch_to_buffer. */ + pcap__load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void pcap_pop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + pcap__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + pcap__load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void pcap_ensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)pcap_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in pcap_ensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)pcap_realloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in pcap_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE pcap__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) pcap_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in pcap__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + pcap__switch_to_buffer(b ,yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to pcap_lex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * pcap__scan_bytes() instead. + */ +YY_BUFFER_STATE pcap__scan_string (yyconst char * yystr , yyscan_t yyscanner) +{ + + return pcap__scan_bytes(yystr,strlen(yystr) ,yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to pcap_lex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE pcap__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) pcap_alloc(n ,yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in pcap__scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = pcap__scan_buffer(buf,n ,yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in pcap__scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE pcap_get_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int pcap_get_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int pcap_get_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *pcap_get_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *pcap_get_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +yy_size_t pcap_get_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *pcap_get_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void pcap_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void pcap_set_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "pcap_set_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void pcap_set_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "pcap_set_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see pcap__switch_to_buffer + */ +void pcap_set_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void pcap_set_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int pcap_get_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void pcap_set_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +YYSTYPE * pcap_get_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void pcap_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + +/* User-visible API */ + +/* pcap_lex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ + +int pcap_lex_init(yyscan_t* ptr_yy_globals) + +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) pcap_alloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* pcap_lex_init_extra has the same functionality as pcap_lex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to pcap_alloc in + * the yyextra field. + */ + +int pcap_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + +{ + struct yyguts_t dummy_yyguts; + + pcap_set_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) pcap_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + pcap_set_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from pcap_lex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = (char *) 0; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * pcap_lex_init() + */ + return 0; +} + +/* pcap_lex_destroy is for both reentrant and non-reentrant scanners. */ +int pcap_lex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + pcap__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + pcap_pop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + pcap_free(yyg->yy_buffer_stack ,yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + pcap_free(yyg->yy_start_stack ,yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * pcap_lex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + pcap_free ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *pcap_alloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return (void *) malloc( size ); +} + +void *pcap_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void pcap_free (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see pcap_realloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 479 "scanner.l" + + + +/* + * Turn diagnostics back on, so we check the code that we've written. + */ +DIAG_ON_FLEX + +/* Hex digit to integer. */ +static inline int +xdtoi(int c) +{ + if (isdigit(c)) + return c - '0'; + else if (islower(c)) + return c - 'a' + 10; + else + return c - 'A' + 10; +} + +/* + * Convert string to integer. Just like atoi(), but checks for + * preceding 0x or 0 and uses hex or octal instead of decimal. + */ +static int +stoi(char *s) +{ + int base = 10; + int n = 0; + + if (*s == '0') { + if (s[1] == 'x' || s[1] == 'X') { + s += 2; + base = 16; + } + else { + base = 8; + s += 1; + } + } + while (*s) + n = n * base + xdtoi(*s++); + + return n; +} + diff --git a/libraries/cmake/source/libpcap/generated/scanner.h b/libraries/cmake/source/libpcap/generated/scanner.h new file mode 100644 index 00000000000..5e666c3dd61 --- /dev/null +++ b/libraries/cmake/source/libpcap/generated/scanner.h @@ -0,0 +1,383 @@ +#ifndef pcap_HEADER_H +#define pcap_HEADER_H 1 +#define pcap_IN_HEADER 1 + +#line 6 "scanner.h" +/* Must come first for _LARGE_FILE_API on AIX. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +/* + * Must come first to avoid warnings on Windows. + * + * Flex-generated scanners may only include if __STDC_VERSION__ + * is defined with a value >= 199901, meaning "full C99", and MSVC may not + * define it with that value, because it isn't 100% C99-compliant, even + * though it has an capable of defining everything the Flex + * scanner needs. + * + * We, however, will include it if we know we have an MSVC version that has + * it; this means that we may define the INTn_MAX and UINTn_MAX values in + * scanner.c, and then include , which may define them differently + * (same value, but different string of characters), causing compiler warnings. + * + * If we include it here, and they're defined, that'll prevent scanner.c + * from defining them. So we include , to get + * if we have it. + */ +#include + +#include "diag-control.h" + +#line 34 "scanner.h" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void pcap_restart (FILE *input_file ,yyscan_t yyscanner ); +void pcap__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void pcap__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void pcap__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void pcap_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void pcap_pop_buffer_state (yyscan_t yyscanner ); + +YY_BUFFER_STATE pcap__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE pcap__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); + +void *pcap_alloc (yy_size_t ,yyscan_t yyscanner ); +void *pcap_realloc (void *,yy_size_t ,yyscan_t yyscanner ); +void pcap_free (void * ,yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define pcap_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#define YY_EXTRA_TYPE compiler_state_t * + +int pcap_lex_init (yyscan_t* scanner); + +int pcap_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int pcap_lex_destroy (yyscan_t yyscanner ); + +int pcap_get_debug (yyscan_t yyscanner ); + +void pcap_set_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE pcap_get_extra (yyscan_t yyscanner ); + +void pcap_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *pcap_get_in (yyscan_t yyscanner ); + +void pcap_set_in (FILE * _in_str ,yyscan_t yyscanner ); + +FILE *pcap_get_out (yyscan_t yyscanner ); + +void pcap_set_out (FILE * _out_str ,yyscan_t yyscanner ); + +yy_size_t pcap_get_leng (yyscan_t yyscanner ); + +char *pcap_get_text (yyscan_t yyscanner ); + +int pcap_get_lineno (yyscan_t yyscanner ); + +void pcap_set_lineno (int _line_number ,yyscan_t yyscanner ); + +int pcap_get_column (yyscan_t yyscanner ); + +void pcap_set_column (int _column_no ,yyscan_t yyscanner ); + +YYSTYPE * pcap_get_lval (yyscan_t yyscanner ); + +void pcap_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int pcap_wrap (yyscan_t yyscanner ); +#else +extern int pcap_wrap (yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int pcap_lex \ + (YYSTYPE * yylval_param ,yyscan_t yyscanner); + +#define YY_DECL int pcap_lex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#line 479 "scanner.l" + + +#line 382 "scanner.h" +#undef pcap_IN_HEADER +#endif /* pcap_HEADER_H */ diff --git a/libraries/cmake/source/libpcap/src b/libraries/cmake/source/libpcap/src new file mode 160000 index 00000000000..d396f255cf7 --- /dev/null +++ b/libraries/cmake/source/libpcap/src @@ -0,0 +1 @@ +Subproject commit d396f255cf7b96a09cf91d0e8cc94d23777d6986 diff --git a/libraries/cmake/source/modules/Findlibpcap.cmake b/libraries/cmake/source/modules/Findlibpcap.cmake new file mode 100644 index 00000000000..68e9dae7258 --- /dev/null +++ b/libraries/cmake/source/modules/Findlibpcap.cmake @@ -0,0 +1,15 @@ +# Copyright (c) 2014-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed in accordance with the terms specified in +# the LICENSE file found in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.14.6) +include("${CMAKE_CURRENT_LIST_DIR}/utils.cmake") + +importSourceSubmodule( + NAME "libpcap" + + SHALLOW_SUBMODULES + "src" +) diff --git a/osquery/events/CMakeLists.txt b/osquery/events/CMakeLists.txt index 449e85ed528..066ebb01f37 100644 --- a/osquery/events/CMakeLists.txt +++ b/osquery/events/CMakeLists.txt @@ -24,6 +24,7 @@ function(generateOsqueryEvents) linux/inotify.cpp linux/syslog.cpp linux/udev.cpp + linux/http_event_publisher.cpp ) elseif(DEFINED PLATFORM_MACOS) @@ -65,18 +66,25 @@ function(generateOsqueryEvents) thirdparty_boost ) + set(dependencies + thirdparty_libpcap + osquery_core + osquery_headers + ) + if(DEFINED PLATFORM_LINUX) target_link_libraries(osquery_events PUBLIC + osquery_headers thirdparty_libaudit thirdparty_libudev thirdparty_util-linux + thirdparty_libpcap ) endif() - + set(public_header_files pathset.h ) - generateIncludeNamespace(osquery_events "osquery/events" "FILE_ONLY" ${public_header_files}) if(DEFINED PLATFORM_LINUX) @@ -90,6 +98,7 @@ function(generateOsqueryEvents) linux/socket_events.h linux/syslog.h linux/udev.h + linux/http_event_publisher.h ) elseif(DEFINED PLATFORM_MACOS) diff --git a/osquery/events/linux/http_event_publisher.cpp b/osquery/events/linux/http_event_publisher.cpp new file mode 100644 index 00000000000..debc6fe2b0c --- /dev/null +++ b/osquery/events/linux/http_event_publisher.cpp @@ -0,0 +1,886 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the Apache 2.0 license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include "httpparser/httprequestparser.h" +#include "httpparser/httpresponseparser.h" +#include "httpparser/request.h" +#include "httpparser/response.h" +#include "osquery/remote/serializers/json.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "http_event_publisher.h" + +namespace osquery { +namespace { +const int IPV6_VERSION = 0x60; +const int IPV4 = IPVERSION; +const int IPV6 = (IPV6_VERSION >> 4); +const size_t kIPv6Length = sizeof(struct ip6_hdr); + +/// Maximum bytes per packet. +const int kSnapLength = 1518; + +/// Avoid running pcap in a busy loop. +const int kPacketBufferTimeoutMs = 1000; + +const int SSL_MIN_GOOD_VERSION = 0x002; +const int SSL_MAX_GOOD_VERSION = 0x304; + +const int TLS_HANDSHAKE = 22; +const int TLS_CLIENT_HELLO = 1; + +const int OFFSET_HELLO_VERSION = 9; +const int OFFSET_SESSION_LENGTH = 43; +const int OFFSET_CIPHER_LIST = 44; +using LocalRemoteAddrs = std::pair; + +inline bool readIPv4SourceDest(const unsigned char* packet, + const uint32_t caplen, + size_t* offset, + LocalRemoteAddrs& addrs) { + const size_t ipv4_len = (((struct ip*)packet)->ip_hl << 2); + if (caplen < (*offset + ipv4_len)) { + TLOG << "Invalid packet (IPv4 header). Packet length: " << caplen + << ". Offset: " << *offset; + return false; + } + + const struct ip* ip = reinterpret_cast(packet + *offset); + *offset += ipv4_len; + + char local[INET_ADDRSTRLEN], remote[INET_ADDRSTRLEN]; + inet_ntop(AF_INET, &ip->ip_dst, local, INET_ADDRSTRLEN); + inet_ntop(AF_INET, &ip->ip_src, remote, INET_ADDRSTRLEN); + addrs.first = std::string(local); + addrs.second = std::string(remote); + + return true; +} + +inline bool readIPv6SourceDest(const unsigned char* packet, + const uint32_t caplen, + size_t* offset, + LocalRemoteAddrs& addrs) { + if (caplen < (*offset + kIPv6Length)) { + TLOG << "Invalid packet (IPv6 header). Packet length: " << caplen + << ". Offset: " << *offset; + return false; + } + + const struct ip6_hdr* ip = + reinterpret_cast(packet + *offset); + *offset += kIPv6Length; + + char local[INET6_ADDRSTRLEN], remote[INET6_ADDRSTRLEN]; + inet_ntop(AF_INET6, &ip->ip6_dst, local, INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, &ip->ip6_src, remote, INET6_ADDRSTRLEN); + addrs.first = std::string(local); + addrs.second = std::string(remote); + + return true; +} +} // namespace + +/// Internal traffic filter +const std::string kInternalTrafficFilter = + "not (src net (10 or 172.16/12 or 192.168/16 or 100.64/10 " + "or 127.0/8 or 169.254/16) " + "and dst net (10 or 172.16/12 or 192.168/16 or 100.64/10 or " + "127.0/8 or 169.254/16))"; + +/// Filter get, post, put, delete, option +const std::string kHttpRequestFilter = + "tcp[((tcp[12:1] & 0xf0) >> 2):4]= 0x47455420 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504F5354 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x50555420 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x44454c45 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x50415443 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x48454144 or\ + tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x4f505449 or "; +// PCAP has no payload[offset] field, so we need to get the payload offset +// from the TCP header (offset 12, upper 4 bits, number of 4-byte words): +// TLS Handshake starts with a '22' byte, version, length, +// and then '01'/'02' for client/server hello +// TLS Handshake starts with a '22' byte, version, length, +// and then '01'/'02' for client/server hello +const std::string kTLSTrafficFilter = + "(tcp[tcp[12]/16*4]=22 and (tcp[tcp[12]/16*4+5]=1 or " + "tcp[tcp[12]/16*4+5]=2))"; + +#pragma pack(push, 1) +/* Ethernet header */ +struct sniff_ethernet { + u_char ether_dhost[ETHER_ADDR_LEN]; /* destination host address */ + u_char ether_shost[ETHER_ADDR_LEN]; /* source host address */ + u_short ether_type; /* IP? ARP? RARP? etc */ +}; + +/* IP header */ +struct sniff_ip { + u_char ip_vhl; /* version << 4 | header length >> 2 */ + u_char ip_tos; /* type of service */ + u_short ip_len; /* total length */ + u_short ip_id; /* identification */ + u_short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ + struct in_addr ip_src, ip_dst; /* source and dest address */ +}; +#pragma pack(pop) + +#define IP_HL(ip) (((ip)->ip_vhl) & 0x0f) +#define IP_V(ip) (((ip)->ip_vhl) >> 4) + +/* TCP header */ +typedef u_int tcp_seq; +#pragma pack(push, 1) +struct sniff_tcp { + u_short th_sport; /* source port */ + u_short th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ + u_char th_offx2; /* data offset, rsvd */ +#define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4) + u_char th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 +#define TH_ECE 0x40 +#define TH_CWR 0x80 +#define TH_FLAGS (TH_FIN | TH_SYN | TH_RST | TH_ACK | TH_URG | TH_ECE | TH_CWR) + u_short th_win; /* window */ + u_short th_sum; /* checksum */ + u_short th_urp; /* urgent pointer */ +}; +#pragma pack(pop) + +/* Grease bytes to ignore */ +const std::set greaseBytes = {"0A0A", + "1A1A", + "2A2A", + "3A3A", + "4A4A", + "5A5A", + "6A6A", + "7A7A", + "8A8A", + "9A9A", + "AAAA", + "BABA", + "CACA", + "DADA", + "EAEA", + "FAFA"}; +/* Implementation of whitelisting */ +/* + * @brief whitelisting of headers - to be included in other_headers column + * + * By default no headers are inlcuded in headers list. + * headers specify them via this flag as a comma separated list. + */ +FLAG(string, + include_http_headers, + "", + "Comma-separated list of headers to be included in http_events table"); + +/* fingerprint struct */ +struct fingerprint { + uint16_t extensions_length; + uint8_t* extensions; + uint16_t curves_length; + uint8_t* curves; + uint16_t sig_alg_length; + uint8_t* sig_alg; + uint16_t ec_point_fmt_length; + uint8_t* ec_point_fmt; +}; + +const char* ssl_version(u_short version) { + static char hex[7]; + switch (version) { + case 0x002: + return "SSLv2"; + case 0x300: + return "SSLv3"; + case 0x301: + return "TLSv1.0"; + case 0x302: + return "TLSv1.1"; + case 0x303: + return "TLSv1.2"; + case 0x304: + return "TLSv1.3"; + } + snprintf(hex, sizeof(hex), "0x%04hx", version); + return hex; +} + +REGISTER(HTTPLookupEventPublisher, "event_publisher", "http_lookups"); + +FLAG(bool, + enable_http_lookups, + false, + "Enable the HTTP capture event publisher"); + +Status HTTPLookupEventPublisher::setUp() { + if (!FLAGS_enable_http_lookups) { + return Status::failure( + "HTTP lookups publisher disabled via configuration."); + } + httpFilter_ = kHttpRequestFilter + kTLSTrafficFilter; + return Status::success(); +} + +Status HTTPLookupEventPublisher::run() { + TLOG << "Starting HTTP lookups publisher"; + + // Open "any" devices for capture. Do not use promisc mode + char err[PCAP_ERRBUF_SIZE]; + + handle_ = pcap_open_live(NULL, kSnapLength, 0, kPacketBufferTimeoutMs, err); + if (handle_ == nullptr) { + LOG(ERROR) << "Could not open pcap capture devices: " << err; + return Status::failure("Could not open pcap capture devices."); + } + + if (pcap_compile( + handle_, &fp_, httpFilter_.c_str(), 0, PCAP_NETMASK_UNKNOWN) == -1) { + LOG(ERROR) << "Could not compile filter expression"; + return Status::failure("Could not compile filter expression."); + } + + if (pcap_setfilter(handle_, &fp_) == -1) { + LOG(ERROR) << "Could not install filter"; + return Status::failure("Could not install filter."); + } + + int rc = pcap_loop(handle_, -1, processPacket, (unsigned char*)this); + if (rc == -1) { + LOG(ERROR) << "Error running pcap loop"; + return Status::failure("Error running pcap loop."); + } else { + LOG(INFO) << "Stopping pcap loop"; + return Status::failure(2, "Stopping pcap loop."); + } +} + +void HTTPLookupEventPublisher::stop() { + if (handle_ != nullptr) { + TLOG << "Stopping HTTP publisher"; + + pcap_breakloop(handle_); + pcap_freecode(&fp_); + pcap_close(handle_); + handle_ = nullptr; + } +} + +void HTTPLookupEventPublisher::processPacket(unsigned char* args, + const struct pcap_pkthdr* header, + const unsigned char* packet) { + uint16_t type; + /* declare pointers to packet headers */ + const struct sniff_ip* ip; /* The IP header */ + const struct sniff_tcp* tcp; /* The TCP header */ + const u_char* payload; /* Packet payload */ + + // HTTP headers + std::string method = ""; + std::string protocol = ""; + std::string host = ""; + std::uint64_t host_port = 0; + std::string uri = ""; + std::string user_agent = ""; + std::string content_type = ""; + std::string ja3 = ""; + std::string ja3_fingerprint = ""; + std::string other_headers = ""; + + char src_address_buffer[64] = ""; + char dst_address_buffer[64] = ""; + + long s_port = 0; + long d_port = 0; + + long size_ip; + long size_iptotal; + long size_tcp; + long size_payload; + + // Use privilege dropper + auto dropper = DropPrivileges::get(); + // set low privilege mode only if it is running in root context + if (getuid() == 0) { + // Attempt to drop to nobody. + auto nobody = getpwnam("nobody"); + if (nobody == nullptr) { + LOG(WARNING) << "Could not get 'nobody' uid and gid"; + } + if (!dropper->dropTo(nobody->pw_uid, nobody->pw_gid) && + (!(geteuid() == nobody->pw_uid))) { + LOG(WARNING) << "Failed to drop privilege to nobody"; + } + } else { + LOG(WARNING) << "Not root, skipping privilege drop"; + } + + /*Linux consists of 16 more bytes of Linux cooked capture header,Skipping.*/ + packet = packet + 16; + + uint8_t ip_version = *(uint8_t*)packet >> 4; + switch (ip_version) { + case IPV4: + type = ETHERTYPE_IP; + break; + case IPV6: + type = ETHERTYPE_IPV6; + break; + default: + TLOG << "Invalid packet. Unknown version: " << ip_version; + return; + } + + size_t offset = 0; + LocalRemoteAddrs addrs; + + switch (type) { + case ETHERTYPE_IP: + if (!readIPv4SourceDest(packet, header->caplen, &offset, addrs)) { + TLOG << "Could not retrieve IP address"; + return; + } + break; + case ETHERTYPE_IPV6: + if (!readIPv6SourceDest(packet, header->caplen, &offset, addrs)) { + return; + } + break; + } + + /* define/compute ip header offset */ + ip = (struct sniff_ip*)(packet); + size_ip = IP_HL(ip) * 4; + if (size_ip < 20) { + TLOG << "Invalid IP header length bytes :" << size_ip; + return; + } + + /* determine protocol */ + if (ip->ip_p != IPPROTO_TCP) { + return; + } + + /* + * OK, this packet is TCP. + */ + + /* define/compute tcp header offset */ + tcp = (struct sniff_tcp*)(packet + size_ip); + size_tcp = TH_OFF(tcp) * 4; + if (size_tcp < 20) { + TLOG << "Invalid TCP header length:" << size_tcp << " bytes"; + return; + } + + // Grab source and destination port + s_port = ntohs(tcp->th_sport); + d_port = ntohs(tcp->th_dport); + + /* compute tcp payload (segment) size */ + size_iptotal = ntohs(ip->ip_len); + if (size_iptotal == 0 || size_iptotal > header->caplen) { + /* if TSO is used, ip_len is 0x0000 */ + /* only process up to caplen bytes. */ + size_iptotal = header->caplen; + } + size_payload = size_iptotal - (size_ip + size_tcp); + + /* define/compute tcp payload (segment) offset */ + payload = (u_char*)(packet + size_ip + size_tcp); + + if (payload[0] == TLS_HANDSHAKE) { + if (size_payload < + OFFSET_CIPHER_LIST + 3) { // at least one cipher + compression + TLOG << "TLS handshake header too short:" << size_payload << " bytes"; + return; + } + + u_short proto_version = payload[1] * 256 + payload[2]; + u_short hello_version = + payload[OFFSET_HELLO_VERSION] * 256 + payload[OFFSET_HELLO_VERSION + 1]; + + if (proto_version < SSL_MIN_GOOD_VERSION || + proto_version >= SSL_MAX_GOOD_VERSION || + hello_version < SSL_MIN_GOOD_VERSION || + hello_version >= SSL_MAX_GOOD_VERSION) { + TLOG << "Bad tls version(s) :" << ssl_version(hello_version); + return; + } + + const u_char* packet_data = &payload[OFFSET_SESSION_LENGTH]; + if (size_payload < OFFSET_SESSION_LENGTH + packet_data[0] + 3) { + TLOG << "SessionID too long: " << packet_data[0] << " bytes"; + return; + } + + packet_data += 1 + packet_data[0]; + switch (payload[5]) { + case TLS_CLIENT_HELLO: { + static struct fingerprint* fp_packet = nullptr; + if (fp_packet == nullptr) { + fp_packet = + static_cast(malloc(sizeof(struct fingerprint))); + if (fp_packet == nullptr) { + TLOG << "Malloc Error (fp_packet)"; + return; + } + } + + auto json = JSONSerializer(); + JSON params; + char* server_name; + server_name = nullptr; + std::string cipherStr; + + u_short cs_len = packet_data[0] * 256 + packet_data[1]; + packet_data += 2; // skip cipher suites length + + // FIXME: check for buffer overruns + + for (int cs_id = 0; cs_id < cs_len / 2; cs_id++) { + char buff[1000], decStr[1000]; + buff[0] = '\0'; + decStr[0] = '\0'; + snprintf(buff, + sizeof(buff), + "%02hhX%02hhX", + packet_data[2 * cs_id], + packet_data[2 * cs_id + 1]); + if (greaseBytes.find(buff) != greaseBytes.end()) { + continue; + } + unsigned int x = std::stoul(buff, nullptr, 16); + snprintf(decStr, sizeof(decStr), "%u", x); + cipherStr += decStr; + cipherStr += "-"; + } + // Remove last "-" + cipherStr.pop_back(); + + // compression method + size_t compression_pos = cs_len + 1; + size_t compression_len = packet_data[compression_pos]; + compression_pos += 1 + compression_len; + + /* Extensions */ + size_t ext_len = ((size_t)packet_data[compression_pos] << 8) + + (size_t)packet_data[compression_pos + 1]; + size_t extensions_pos = compression_pos + 2; + + /* Length */ + packet_data += extensions_pos; + + /* + Set optional data to NULL in advance + */ + fp_packet->curves = nullptr; + fp_packet->sig_alg = nullptr; + fp_packet->ec_point_fmt = nullptr; + server_name = nullptr; + /* + So this works - so overall length seems ok + */ + uint8_t* extensions_tmp_ptr = (uint8_t*)packet_data; + + /* + If we are at the end of the packet we have no extensions, without this + we will just run off the end of the packet into unallocated space :/ + */ + if (packet_data - payload > size_payload) { + ext_len = 0; + } + /* Loop through the extensions */ + size_t ext_id = 0; + int show_drops = 0, ext_count = 0; + /* + So this works - so overall length seems ok + */ + fp_packet->extensions_length = 0; + for (ext_id = 0; ext_id < ext_len; ext_id++) { + int ext_type; + + /* Set the extension type */ + ext_type = (packet_data[ext_id] * 256) + packet_data[ext_id + 1]; + ext_count++; + + /* Handle some special cases */ + switch (ext_type) { + case 0x000a: + /* elliptic_curves */ + fp_packet->curves = (uint8_t*)&packet_data[ext_id + 2]; + /* 2 & 3, not 0 & 1 because of 2nd length field */ + fp_packet->curves_length = + fp_packet->curves[2] * 256 + fp_packet->curves[3]; + break; + case 0x000b: + /* ec_point formats */ + fp_packet->ec_point_fmt = (uint8_t*)&packet_data[ext_id + 2]; + fp_packet->ec_point_fmt_length = fp_packet->ec_point_fmt[2]; + // printf("ec point length: %i\n", fp_packet->ec_point_fmt_length); + break; + case 0x000d: + /* Signature algorithms */ + fp_packet->sig_alg = (uint8_t*)&packet_data[ext_id + 2]; + fp_packet->sig_alg_length = + fp_packet->sig_alg[2] * 256 + fp_packet->sig_alg[3]; + break; + case 0x0000: + /* Definitely *NOT* signature-worthy + * but worth noting for debugging source + * of packets during signature creation. + */ + /* Server Name */ + server_name = (char*)&packet_data[ext_id + 2]; + break; + } + + // Measure the lenght of the extention with the extention count + fp_packet->extensions_length = (ext_count * 2); + ext_id += (packet_data[ext_id + 2] * 256) + packet_data[ext_id + 3] + 3; + + if ((packet_data + ext_id) >= (payload + size_payload)) { + if (show_drops == 1) { + TLOG << "Extension offset beyond end of packet " + << src_address_buffer << "to" << ntohs(tcp->th_sport) + << "destination address buffer :" << dst_address_buffer << ":" + << ntohs(tcp->th_dport); + } + return; + } + } + + /* + Extensions use offsets, etc so we can alloc those now. Others however + will just have pointers and we can malloc if it becomes a signature. + */ + if (fp_packet->extensions_length) { + fp_packet->extensions = (uint8_t*)malloc(fp_packet->extensions_length); + if (fp_packet->extensions == nullptr) { + TLOG << "Malloc Error (extensions)"; + return; + } + } + // Load up the extensions + int unarse = 0; + size_t arse; + for (arse = 0; arse < ext_len;) { + fp_packet->extensions[unarse] = (uint8_t)extensions_tmp_ptr[arse]; + fp_packet->extensions[unarse + 1] = + (uint8_t)extensions_tmp_ptr[arse + 1]; + unarse += 2; + arse = arse + 4 + (((uint8_t)extensions_tmp_ptr[(arse + 2)]) * 256) + + (uint8_t)(extensions_tmp_ptr[arse + 3]); + } + + /*Construct the server name/ host */ + if (server_name != nullptr) { + for (arse = 7; + arse <= (size_t)(server_name[0] * 256 + server_name[1]) + 1; + arse++) { + if (server_name[arse] > 0x20 && server_name[arse] < 0x7b) { + if (server_name[arse] != '\0') { + host += server_name[arse]; + } + } + } + size_t found = host.find_last_of(":"); + if (found != std::string::npos) { + host = host.substr(0, found); + auto host_exp = + tryTo(host.substr(found + 1, host.length())); + if (host_exp) { + host_port = host_exp.get(); + } + } + } else { + TLOG << "Host name not present in the packet"; + } + + std::string extensionsStr; + if (fp_packet->extensions != nullptr) { + /* extension */ + for (arse = 0; arse < fp_packet->extensions_length;) { + char buff[1000], decStr[1000]; + buff[0] = '\0'; + decStr[0] = '\0'; + snprintf(buff, + sizeof(buff), + "%.02X%.02X", + fp_packet->extensions[arse], + fp_packet->extensions[arse + 1]); + if (greaseBytes.find(buff) != greaseBytes.end()) { + arse = arse + 2; + continue; + } + + unsigned int x = std::stoul(buff, nullptr, 16); + snprintf(decStr, sizeof(decStr), "%u", x); + arse = arse + 2; + extensionsStr += decStr; + extensionsStr += "-"; + } + extensionsStr.pop_back(); + } + + std::string curveStr; + if (fp_packet->curves != nullptr) { + for (arse = 4; arse < fp_packet->curves_length + 4 && + fp_packet->curves_length + 4 > 0; + arse = arse + 2) { + char buff[1000], decStr[1000]; + buff[0] = '\0'; + decStr[0] = '\0'; + + snprintf(buff, + sizeof(buff), + "%.02X%.02X", + fp_packet->curves[arse], + fp_packet->curves[arse + 1]); + if (greaseBytes.find(buff) != greaseBytes.end()) { + continue; + } + unsigned int x = std::stoul(buff, nullptr, 16); + snprintf(decStr, sizeof(decStr), "%u", x); + curveStr += decStr; + curveStr += "-"; + } + curveStr.pop_back(); + } + + // Grab ec point format + std::string ecPointStr; + if (fp_packet->ec_point_fmt != nullptr) { + // Jumping to "3" to get past the second length parameter... errrr... + // why? + for (arse = 4; arse < fp_packet->ec_point_fmt_length + 4; arse++) { + char buff[1000], decStr[1000]; + buff[0] = '\0'; + decStr[0] = '\0'; + + snprintf(buff, sizeof(buff), "%.2X", fp_packet->ec_point_fmt[arse]); + if (greaseBytes.find(buff) != greaseBytes.end()) { + continue; + } + + unsigned int x = std::stoul(buff, nullptr, 16); + snprintf(decStr, sizeof(decStr), "%u", x); + ecPointStr += decStr; + ecPointStr += "-"; + } + ecPointStr.pop_back(); + } + + // Update data + protocol = ssl_version(hello_version); + char hello_ver[1000]; + hello_ver[0] = '\0'; + snprintf(hello_ver, sizeof(hello_ver), "%d", hello_version); + + // Construct JA3 string + ja3 += hello_ver; + ja3 += "," + cipherStr + "," + extensionsStr + "," + curveStr + "," + + ecPointStr; + + // Calculate JA3 fingerprint + ja3_fingerprint = + hashFromBuffer(HASH_TYPE_MD5, (void*)ja3.c_str(), ja3.length()); + + HTTPLookupEventPublisher* ref = (HTTPLookupEventPublisher*)args; + auto ec = ref->createEventContextFrom(header->ts.tv_sec, + method, + protocol, + addrs.second, + addrs.first, + s_port, + d_port, + host, + host_port, + uri, + content_type, + user_agent, + ja3, + ja3_fingerprint, + other_headers); + ref->fire(ec); + + // Clean up memory + if (fp_packet->extensions != nullptr) { + free(fp_packet->extensions); + fp_packet->extensions = nullptr; + } + + if (fp_packet != nullptr) { + free(fp_packet); + fp_packet = nullptr; + } + + break; + } + } + return; + } else { + // Packet request header starts from here + offset = size_ip + size_tcp; + // Conditions are "POST", "GET", "PUT, "OPTION" and "DELETE". + httpparser::Request request; + httpparser::HttpRequestParser parser; + const char* actualHttpPacket = (const char*)(packet + offset); + parser.parse(request, + actualHttpPacket, + actualHttpPacket + std::strlen(actualHttpPacket)); + + HTTPLookupEventPublisher* ref = (HTTPLookupEventPublisher*)args; + method = request.method; + uri = request.uri; + + auto json = JSONSerializer(); + JSON params; + + std::vector::iterator iter; + iter = request.headers.begin(); + while (iter != request.headers.end()) { + std::transform( + iter->name.begin(), iter->name.end(), iter->name.begin(), ::tolower); + if (iter->name == "host") { + size_t found = iter->value.find_last_of(":"); + if (found != std::string::npos) { + host = iter->value.substr(0, found); + auto host_exp = tryTo( + iter->value.substr(found + 1, iter->value.length())); + if (host_exp) { + host_port = host_exp.get(); + } + } else { + host = iter->value; + } + } else if (iter->name == "user-agent") { + user_agent = iter->value; + } else if (iter->name == "content-type") { + content_type = iter->value; + } else { + // By default only add headers name, no value + params.add(iter->name, ""); + for (auto& includeHeader : + osquery::split(FLAGS_include_http_headers, ",")) { + // To enforce unification we lower case all headers for matching + std::transform(includeHeader.begin(), + includeHeader.end(), + includeHeader.begin(), + ::tolower); + if (includeHeader == iter->name) { + // Only add headers which are in include list + params.add(iter->name, iter->value); + } + } + } + ++iter; + } + + std::string serialized; + json.serialize(params, serialized); + other_headers = serialized; + + auto ec = ref->createEventContextFrom(header->ts.tv_sec, + method, + protocol, + addrs.second, + addrs.first, + s_port, + d_port, + host, + host_port, + uri, + content_type, + user_agent, + ja3, + ja3_fingerprint, + other_headers); + ref->fire(ec); + } + return; +} + +HTTPLookupEventContextRef HTTPLookupEventPublisher::createEventContextFrom( + const uint32_t time, + const std::string& method, + const std::string& protocol, + const std::string& local, + const std::string& remote, + long s_port, + long d_port, + const std::string& host, + const std::uint64_t& host_port, + const std::string& uri, + const std::string& content_type, + const std::string& user_agent, + const std::string& ja3, + const std::string& ja3_fingerprint, + const std::string& other_headers) { + auto ec = createEventContext(); + ec->time = time; + ec->method = method; + ec->protocol = protocol; + ec->local = local; + ec->remote = remote; + ec->s_port = s_port; + ec->d_port = d_port; + if (host.empty() && !remote.empty()) { + /* If host is empty, assign using available remote IP*/ + ec->host = remote; + } else { + ec->host = host; + } + ec->host_port = host_port; + ec->uri = uri; + ec->content_type = content_type; + ec->user_agent = user_agent; + ec->ja3 = ja3; + ec->ja3_fingerprint = ja3_fingerprint; + ec->other_headers = other_headers; + + return ec; +} +} // namespace osquery diff --git a/osquery/events/linux/http_event_publisher.h b/osquery/events/linux/http_event_publisher.h new file mode 100644 index 00000000000..d1e01ec04fc --- /dev/null +++ b/osquery/events/linux/http_event_publisher.h @@ -0,0 +1,129 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the Apache 2.0 license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#pragma once + +#include +#include + +namespace osquery { + +/** + * @brief Subscriptioning details for HTTPLookupEventPublisher events. + * + */ +struct HTTPLookupSubscriptionContext : public SubscriptionContext {}; + +struct HTTPLookupEventContext : public EventContext { + /// HTTP method used. + std::string method; + + /// SSL/TLS protocol. + std::string protocol; + + /// IP address of local interface. + std::string local; + + /// IP address of HTTP responder. + std::string remote; + + /// Source port. + long s_port; + + /// Destination port. + long d_port; + + /// HTTP request host. Ideally fully qualified host name. + std::string host; + + /// HTTP host url port + std::uint64_t host_port; + + /// HTTP uri comes along with host. + std::string uri; + + /// Content type of the HTTP packet. + std::string content_type; + + /// Http header user_agent. + std::string user_agent; + + /// ja3 string for ja3 fingerprint calculation + std::string ja3; + + /// ja3 fingerprint + std::string ja3_fingerprint; + + /// Other http headers not included in columns . + std::string other_headers; +}; + +using HTTPLookupEventContextRef = std::shared_ptr; +using HTTPLookupSubscriptionContextRef = + std::shared_ptr; + +/** + * @brief Event publisher for HTTP lookups intercepted via libpcap. + */ +class HTTPLookupEventPublisher + : public EventPublisher { + DECLARE_PUBLISHER("http_lookups"); + + public: + HTTPLookupEventPublisher() {} + virtual ~HTTPLookupEventPublisher() { + stop(); + } + + /// If DNS lookups are not enabled this returns non-zero status. + Status setUp() override; + + /// Blocking call over pcap loop waiting for callbacks. + Status run() override; + + /// Breaks pcap loop and free's resources. + void stop() override; + + private: + /// pcap handle. + pcap_t* handle_{nullptr}; + + /// BPF pseudo-assembly program structure. + struct bpf_program fp_; + + private: + /// Callback invoked by libpcap for matching packets. + static void processPacket(unsigned char* args, + const struct pcap_pkthdr* header, + const unsigned char* packet); + + /// Helper function to create an EventContext. + HTTPLookupEventContextRef createEventContextFrom( + const uint32_t epochSecs, + const std::string& method, + const std::string& protocol, + const std::string& local, + const std::string& remote, + long s_port, + long d_port, + const std::string& host, + const std::uint64_t& host_port, + const std::string& uri, + const std::string& content_type, + const std::string& user_agent, + const std::string& ja3, + const std::string& ja3_fingerprint, + const std::string& other_headers); + + private: + std::string httpFilter_; +}; +} // namespace osquery diff --git a/osquery/events/linux/httpparser/httprequestparser.h b/osquery/events/linux/httpparser/httprequestparser.h new file mode 100644 index 00000000000..0967659ca7c --- /dev/null +++ b/osquery/events/linux/httpparser/httprequestparser.h @@ -0,0 +1,480 @@ +/* + * Copyright (C) Alex Nekipelov (alex@nekipelov.net) + * License: MIT + */ + +#ifndef HTTPPARSER_REQUESTPARSER_H +#define HTTPPARSER_REQUESTPARSER_H + +#include + +#include +#include + +#include "request.h" + +namespace httpparser { + +class HttpRequestParser { + public: + HttpRequestParser() + : state(RequestMethodStart), + contentSize(0), + chunkSize(0), + chunked(false) + + {} + + enum ParseResult { ParsingCompleted, ParsingIncompleted, ParsingError }; + + ParseResult parse(Request& req, const char* begin, const char* end) { + return consume(req, begin, end); + } + + private: + static bool checkIfConnection(const Request::HeaderItem& item) { + return strcasecmp(item.name.c_str(), "Connection") == 0; + } + + ParseResult consume(Request& req, const char* begin, const char* end) { + while (begin != end) { + char input = *begin++; + + switch (state) { + case RequestMethodStart: + if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + state = RequestMethod; + req.method.push_back(input); + } + break; + case RequestMethod: + if (input == ' ') { + state = RequestUriStart; + } else if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + req.method.push_back(input); + } + break; + case RequestUriStart: + if (isControl(input)) { + return ParsingError; + } else { + state = RequestUri; + req.uri.push_back(input); + } + break; + case RequestUri: + if (input == ' ') { + state = RequestHttpVersion_h; + } else if (input == '\r') { + req.versionMajor = 0; + req.versionMinor = 9; + + return ParsingCompleted; + } else if (isControl(input)) { + return ParsingError; + } else { + req.uri.push_back(input); + } + break; + case RequestHttpVersion_h: + if (input == 'H') { + state = RequestHttpVersion_ht; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_ht: + if (input == 'T') { + state = RequestHttpVersion_htt; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_htt: + if (input == 'T') { + state = RequestHttpVersion_http; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_http: + if (input == 'P') { + state = RequestHttpVersion_slash; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_slash: + if (input == '/') { + req.versionMajor = 0; + req.versionMinor = 0; + state = RequestHttpVersion_majorStart; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_majorStart: + if (isDigit(input)) { + req.versionMajor = input - '0'; + state = RequestHttpVersion_major; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_major: + if (input == '.') { + state = RequestHttpVersion_minorStart; + } else if (isDigit(input)) { + req.versionMajor = req.versionMajor * 10 + input - '0'; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_minorStart: + if (isDigit(input)) { + req.versionMinor = input - '0'; + state = RequestHttpVersion_minor; + } else { + return ParsingError; + } + break; + case RequestHttpVersion_minor: + if (input == '\r') { + state = ResponseHttpVersion_newLine; + } else if (isDigit(input)) { + req.versionMinor = req.versionMinor * 10 + input - '0'; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_newLine: + if (input == '\n') { + state = HeaderLineStart; + } else { + return ParsingError; + } + break; + case HeaderLineStart: + if (input == '\r') { + state = ExpectingNewline_3; + } else if (!req.headers.empty() && (input == ' ' || input == '\t')) { + state = HeaderLws; + } else if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + req.headers.push_back(Request::HeaderItem()); + req.headers.back().name.reserve(16); + req.headers.back().value.reserve(16); + req.headers.back().name.push_back(input); + state = HeaderName; + } + break; + case HeaderLws: + if (input == '\r') { + state = ExpectingNewline_2; + } else if (input == ' ' || input == '\t') { + } else if (isControl(input)) { + return ParsingError; + } else { + state = HeaderValue; + req.headers.back().value.push_back(input); + } + break; + case HeaderName: + if (input == ':') { + state = SpaceBeforeHeaderValue; + } else if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + req.headers.back().name.push_back(input); + } + break; + case SpaceBeforeHeaderValue: + if (input == ' ') { + state = HeaderValue; + } else { + return ParsingError; + } + break; + case HeaderValue: + if (input == '\r') { + if (req.method == "POST" || req.method == "PUT") { + Request::HeaderItem& h = req.headers.back(); + + if (strcasecmp(h.name.c_str(), "Content-Length") == 0) { + contentSize = atoi(h.value.c_str()); + req.content.reserve(contentSize); + } else if (strcasecmp(h.name.c_str(), "Transfer-Encoding") == 0) { + if (strcasecmp(h.value.c_str(), "chunked") == 0) + chunked = true; + } + } + state = ExpectingNewline_2; + } else if (isControl(input)) { + return ParsingError; + } else { + req.headers.back().value.push_back(input); + } + break; + case ExpectingNewline_2: + if (input == '\n') { + state = HeaderLineStart; + } else { + return ParsingError; + } + break; + case ExpectingNewline_3: { + std::vector::iterator it = std::find_if( + req.headers.begin(), req.headers.end(), checkIfConnection); + + if (it != req.headers.end()) { + if (strcasecmp(it->value.c_str(), "Keep-Alive") == 0) { + req.keepAlive = true; + } else // == Close + { + req.keepAlive = false; + } + } else { + if (req.versionMajor > 1 || + (req.versionMajor == 1 && req.versionMinor == 1)) + req.keepAlive = true; + } + + if (chunked) { + state = ChunkSize; + } else if (contentSize == 0) { + if (input == '\n') + return ParsingCompleted; + else + return ParsingError; + } else { + state = Post; + } + break; + } + case Post: + --contentSize; + req.content.push_back(input); + + if (contentSize == 0) { + return ParsingCompleted; + } + break; + case ChunkSize: + if (isalnum(input)) { + chunkSizeStr.push_back(input); + } else if (input == ';') { + state = ChunkExtensionName; + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkExtensionName: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '=') { + state = ChunkExtensionValue; + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkExtensionValue: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine: + if (input == '\n') { + chunkSize = strtol(chunkSizeStr.c_str(), NULL, 16); + chunkSizeStr.clear(); + req.content.reserve(req.content.size() + chunkSize); + + if (chunkSize == 0) + state = ChunkSizeNewLine_2; + else + state = ChunkData; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine_2: + if (input == '\r') { + state = ChunkSizeNewLine_3; + } else if (isalpha(input)) { + state = ChunkTrailerName; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine_3: + if (input == '\n') { + return ParsingCompleted; + } else { + return ParsingError; + } + break; + case ChunkTrailerName: + if (isalnum(input)) { + // skip + } else if (input == ':') { + state = ChunkTrailerValue; + } else { + return ParsingError; + } + break; + case ChunkTrailerValue: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkData: + req.content.push_back(input); + + if (--chunkSize == 0) { + state = ChunkDataNewLine_1; + } + break; + case ChunkDataNewLine_1: + if (input == '\r') { + state = ChunkDataNewLine_2; + } else { + return ParsingError; + } + break; + case ChunkDataNewLine_2: + if (input == '\n') { + state = ChunkSize; + } else { + return ParsingError; + } + break; + default: + return ParsingError; + } + } + + return ParsingIncompleted; + } + + // Check if a byte is an HTTP character. + inline bool isChar(int c) { + return c >= 0 && c <= 127; + } + + // Check if a byte is an HTTP control character. + inline bool isControl(int c) { + return (c >= 0 && c <= 31) || (c == 127); + } + + // Check if a byte is defined as an HTTP special character. + inline bool isSpecial(int c) { + switch (c) { + case '(': + case ')': + case '<': + case '>': + case '@': + case ',': + case ';': + case ':': + case '\\': + case '"': + case '/': + case '[': + case ']': + case '?': + case '=': + case '{': + case '}': + case ' ': + case '\t': + return true; + default: + return false; + } + } + + // Check if a byte is a digit. + inline bool isDigit(int c) { + return c >= '0' && c <= '9'; + } + + // The current state of the parser. + enum State { + RequestMethodStart, + RequestMethod, + RequestUriStart, + RequestUri, + RequestHttpVersion_h, + RequestHttpVersion_ht, + RequestHttpVersion_htt, + RequestHttpVersion_http, + RequestHttpVersion_slash, + RequestHttpVersion_majorStart, + RequestHttpVersion_major, + RequestHttpVersion_minorStart, + RequestHttpVersion_minor, + + ResponseStatusStart, + ResponseHttpVersion_ht, + ResponseHttpVersion_htt, + ResponseHttpVersion_http, + ResponseHttpVersion_slash, + ResponseHttpVersion_majorStart, + ResponseHttpVersion_major, + ResponseHttpVersion_minorStart, + ResponseHttpVersion_minor, + ResponseHttpVersion_spaceAfterVersion, + ResponseHttpVersion_statusCodeStart, + ResponseHttpVersion_spaceAfterStatusCode, + ResponseHttpVersion_statusTextStart, + ResponseHttpVersion_newLine, + + HeaderLineStart, + HeaderLws, + HeaderName, + SpaceBeforeHeaderValue, + HeaderValue, + ExpectingNewline_2, + ExpectingNewline_3, + + Post, + ChunkSize, + ChunkExtensionName, + ChunkExtensionValue, + ChunkSizeNewLine, + ChunkSizeNewLine_2, + ChunkSizeNewLine_3, + ChunkTrailerName, + ChunkTrailerValue, + + ChunkDataNewLine_1, + ChunkDataNewLine_2, + ChunkData, + } state; + + size_t contentSize; + std::string chunkSizeStr; + size_t chunkSize; + bool chunked; +}; + +} // namespace httpparser + +#endif // LIBAHTTP_REQUESTPARSER_H diff --git a/osquery/events/linux/httpparser/httpresponseparser.h b/osquery/events/linux/httpparser/httpresponseparser.h new file mode 100644 index 00000000000..73e7eae014f --- /dev/null +++ b/osquery/events/linux/httpparser/httpresponseparser.h @@ -0,0 +1,462 @@ +/* + * Copyright (C) Alex Nekipelov (alex@nekipelov.net) + * License: MIT + */ + +#ifndef HTTPPARSER_RESPONSEPARSER_H +#define HTTPPARSER_RESPONSEPARSER_H + +#include + +#include +#include + +#include "response.h" + +namespace httpparser { + +class HttpResponseParser { + public: + HttpResponseParser() + : state(ResponseStatusStart), + contentSize(0), + chunkSize(0), + chunked(false) {} + + enum ParseResult { ParsingCompleted, ParsingIncompleted, ParsingError }; + + ParseResult parse(Response& resp, const char* begin, const char* end) { + return consume(resp, begin, end); + } + + private: + static bool checkIfConnection(const Response::HeaderItem& item) { + return strcasecmp(item.name.c_str(), "Connection") == 0; + } + + ParseResult consume(Response& resp, const char* begin, const char* end) { + while (begin != end) { + char input = *begin++; + + switch (state) { + case ResponseStatusStart: + if (input != 'H') { + return ParsingError; + } else { + state = ResponseHttpVersion_ht; + } + break; + case ResponseHttpVersion_ht: + if (input == 'T') { + state = ResponseHttpVersion_htt; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_htt: + if (input == 'T') { + state = ResponseHttpVersion_http; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_http: + if (input == 'P') { + state = ResponseHttpVersion_slash; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_slash: + if (input == '/') { + resp.versionMajor = 0; + resp.versionMinor = 0; + state = ResponseHttpVersion_majorStart; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_majorStart: + if (isDigit(input)) { + resp.versionMajor = input - '0'; + state = ResponseHttpVersion_major; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_major: + if (input == '.') { + state = ResponseHttpVersion_minorStart; + } else if (isDigit(input)) { + resp.versionMajor = resp.versionMajor * 10 + input - '0'; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_minorStart: + if (isDigit(input)) { + resp.versionMinor = input - '0'; + state = ResponseHttpVersion_minor; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_minor: + if (input == ' ') { + state = ResponseHttpVersion_statusCodeStart; + resp.statusCode = 0; + } else if (isDigit(input)) { + resp.versionMinor = resp.versionMinor * 10 + input - '0'; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_statusCodeStart: + if (isDigit(input)) { + resp.statusCode = input - '0'; + state = ResponseHttpVersion_statusCode; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_statusCode: + if (isDigit(input)) { + resp.statusCode = resp.statusCode * 10 + input - '0'; + } else { + if (resp.statusCode < 100 || resp.statusCode > 999) { + return ParsingError; + } else if (input == ' ') { + state = ResponseHttpVersion_statusTextStart; + } else { + return ParsingError; + } + } + break; + case ResponseHttpVersion_statusTextStart: + if (isChar(input)) { + resp.status += input; + state = ResponseHttpVersion_statusText; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_statusText: + if (input == '\r') { + state = ResponseHttpVersion_newLine; + } else if (isChar(input)) { + resp.status += input; + } else { + return ParsingError; + } + break; + case ResponseHttpVersion_newLine: + if (input == '\n') { + state = HeaderLineStart; + } else { + return ParsingError; + } + break; + case HeaderLineStart: + if (input == '\r') { + state = ExpectingNewline_3; + } else if (!resp.headers.empty() && (input == ' ' || input == '\t')) { + state = HeaderLws; + } else if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + resp.headers.push_back(Response::HeaderItem()); + resp.headers.back().name.reserve(16); + resp.headers.back().value.reserve(16); + resp.headers.back().name.push_back(input); + state = HeaderName; + } + break; + case HeaderLws: + if (input == '\r') { + state = ExpectingNewline_2; + } else if (input == ' ' || input == '\t') { + } else if (isControl(input)) { + return ParsingError; + } else { + state = HeaderValue; + resp.headers.back().value.push_back(input); + } + break; + case HeaderName: + if (input == ':') { + state = SpaceBeforeHeaderValue; + } else if (!isChar(input) || isControl(input) || isSpecial(input)) { + return ParsingError; + } else { + resp.headers.back().name.push_back(input); + } + break; + case SpaceBeforeHeaderValue: + if (input == ' ') { + state = HeaderValue; + } else { + return ParsingError; + } + break; + case HeaderValue: + if (input == '\r') { + Response::HeaderItem& h = resp.headers.back(); + + if (strcasecmp(h.name.c_str(), "Content-Length") == 0) { + contentSize = atoi(h.value.c_str()); + resp.content.reserve(contentSize); + } else if (strcasecmp(h.name.c_str(), "Transfer-Encoding") == 0) { + if (strcasecmp(h.value.c_str(), "chunked") == 0) + chunked = true; + } + state = ExpectingNewline_2; + } else if (isControl(input)) { + return ParsingError; + } else { + resp.headers.back().value.push_back(input); + } + break; + case ExpectingNewline_2: + if (input == '\n') { + state = HeaderLineStart; + } else { + return ParsingError; + } + break; + case ExpectingNewline_3: { + std::vector::iterator it = std::find_if( + resp.headers.begin(), resp.headers.end(), checkIfConnection); + + if (it != resp.headers.end()) { + if (strcasecmp(it->value.c_str(), "Keep-Alive") == 0) { + resp.keepAlive = true; + } else // == Close + { + resp.keepAlive = false; + } + } else { + if (resp.versionMajor > 1 || + (resp.versionMajor == 1 && resp.versionMinor == 1)) + resp.keepAlive = true; + } + + if (chunked) { + state = ChunkSize; + } else if (contentSize == 0) { + if (input == '\n') + return ParsingCompleted; + else + return ParsingError; + } + + else { + state = Post; + } + break; + } + case Post: + --contentSize; + resp.content.push_back(input); + + if (contentSize == 0) { + return ParsingCompleted; + } + break; + case ChunkSize: + if (isalnum(input)) { + chunkSizeStr.push_back(input); + } else if (input == ';') { + state = ChunkExtensionName; + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkExtensionName: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '=') { + state = ChunkExtensionValue; + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkExtensionValue: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine: + if (input == '\n') { + chunkSize = strtol(chunkSizeStr.c_str(), NULL, 16); + chunkSizeStr.clear(); + resp.content.reserve(resp.content.size() + chunkSize); + + if (chunkSize == 0) + state = ChunkSizeNewLine_2; + else + state = ChunkData; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine_2: + if (input == '\r') { + state = ChunkSizeNewLine_3; + } else if (isalpha(input)) { + state = ChunkTrailerName; + } else { + return ParsingError; + } + break; + case ChunkSizeNewLine_3: + if (input == '\n') { + return ParsingCompleted; + } else { + return ParsingError; + } + break; + case ChunkTrailerName: + if (isalnum(input)) { + // skip + } else if (input == ':') { + state = ChunkTrailerValue; + } else { + return ParsingError; + } + break; + case ChunkTrailerValue: + if (isalnum(input) || input == ' ') { + // skip + } else if (input == '\r') { + state = ChunkSizeNewLine; + } else { + return ParsingError; + } + break; + case ChunkData: + resp.content.push_back(input); + + if (--chunkSize == 0) { + state = ChunkDataNewLine_1; + } + break; + case ChunkDataNewLine_1: + if (input == '\r') { + state = ChunkDataNewLine_2; + } else { + return ParsingError; + } + break; + case ChunkDataNewLine_2: + if (input == '\n') { + state = ChunkSize; + } else { + return ParsingError; + } + break; + default: + return ParsingError; + } + } + + return ParsingIncompleted; + } + + // Check if a byte is an HTTP character. + inline bool isChar(int c) { + return c >= 0 && c <= 127; + } + + // Check if a byte is an HTTP control character. + inline bool isControl(int c) { + return (c >= 0 && c <= 31) || (c == 127); + } + + // Check if a byte is defined as an HTTP special character. + inline bool isSpecial(int c) { + switch (c) { + case '(': + case ')': + case '<': + case '>': + case '@': + case ',': + case ';': + case ':': + case '\\': + case '"': + case '/': + case '[': + case ']': + case '?': + case '=': + case '{': + case '}': + case ' ': + case '\t': + return true; + default: + return false; + } + } + + // Check if a byte is a digit. + inline bool isDigit(int c) { + return c >= '0' && c <= '9'; + } + + // The current state of the parser. + enum State { + ResponseStatusStart, + ResponseHttpVersion_ht, + ResponseHttpVersion_htt, + ResponseHttpVersion_http, + ResponseHttpVersion_slash, + ResponseHttpVersion_majorStart, + ResponseHttpVersion_major, + ResponseHttpVersion_minorStart, + ResponseHttpVersion_minor, + ResponseHttpVersion_statusCodeStart, + ResponseHttpVersion_statusCode, + ResponseHttpVersion_statusTextStart, + ResponseHttpVersion_statusText, + ResponseHttpVersion_newLine, + HeaderLineStart, + HeaderLws, + HeaderName, + SpaceBeforeHeaderValue, + HeaderValue, + ExpectingNewline_2, + ExpectingNewline_3, + Post, + ChunkSize, + ChunkExtensionName, + ChunkExtensionValue, + ChunkSizeNewLine, + ChunkSizeNewLine_2, + ChunkSizeNewLine_3, + ChunkTrailerName, + ChunkTrailerValue, + + ChunkDataNewLine_1, + ChunkDataNewLine_2, + ChunkData, + } state; + + size_t contentSize; + std::string chunkSizeStr; + size_t chunkSize; + bool chunked; +}; + +} // namespace httpparser + +#endif // HTTPPARSER_RESPONSEPARSER_H diff --git a/osquery/events/linux/httpparser/request.h b/osquery/events/linux/httpparser/request.h new file mode 100644 index 00000000000..351de8ef9dd --- /dev/null +++ b/osquery/events/linux/httpparser/request.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) Alex Nekipelov (alex@nekipelov.net) + * License: MIT + */ + +#ifndef HTTPPARSER_REQUEST_H +#define HTTPPARSER_REQUEST_H + +#include +#include +#include + +namespace httpparser { + +struct Request { + Request() : versionMajor(0), versionMinor(0), keepAlive(false) {} + + struct HeaderItem { + std::string name; + std::string value; + }; + + std::string method; + std::string uri; + int versionMajor; + int versionMinor; + std::vector headers; + std::vector content; + bool keepAlive; + + std::string inspect() const { + std::stringstream stream; + stream << method << " " << uri << " HTTP/" << versionMajor << "." + << versionMinor << "\n"; + + for (std::vector::const_iterator it = headers.begin(); + it != headers.end(); + ++it) { + stream << it->name << ": " << it->value << "\n"; + } + + std::string data(content.begin(), content.end()); + stream << data << "\n"; + stream << "+ keep-alive: " << keepAlive << "\n"; + ; + return stream.str(); + } +}; + +} // namespace httpparser + +#endif // HTTPPARSER_REQUEST_H diff --git a/osquery/events/linux/httpparser/response.h b/osquery/events/linux/httpparser/response.h new file mode 100644 index 00000000000..4ec52866541 --- /dev/null +++ b/osquery/events/linux/httpparser/response.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) Alex Nekipelov (alex@nekipelov.net) + * License: MIT + */ + +#ifndef HTTPPARSER_RESPONSE_H +#define HTTPPARSER_RESPONSE_H + +#include +#include +#include + +namespace httpparser { + +struct Response { + Response() + : versionMajor(0), versionMinor(0), keepAlive(false), statusCode(0) {} + + struct HeaderItem { + std::string name; + std::string value; + }; + + int versionMajor; + int versionMinor; + std::vector headers; + std::vector content; + bool keepAlive; + + unsigned int statusCode; + std::string status; + + std::string inspect() const { + std::stringstream stream; + stream << "HTTP/" << versionMajor << "." << versionMinor << " " + << statusCode << " " << status << "\n"; + + for (std::vector::const_iterator it = headers.begin(); + it != headers.end(); + ++it) { + stream << it->name << ": " << it->value << "\n"; + } + + std::string data(content.begin(), content.end()); + stream << data << "\n"; + return stream.str(); + } +}; + +} // namespace httpparser + +#endif // HTTPPARSER_RESPONSE_H diff --git a/osquery/events/linux/httpparser/urlparser.h b/osquery/events/linux/httpparser/urlparser.h new file mode 100644 index 00000000000..a74d6339f5e --- /dev/null +++ b/osquery/events/linux/httpparser/urlparser.h @@ -0,0 +1,284 @@ +/* + * Copyright (C) Alex Nekipelov (alex@nekipelov.net) + * License: MIT + */ + +#ifndef HTTPPARSER_URLPARSER_H +#define HTTPPARSER_URLPARSER_H + +#include +#include +#include +#include + +namespace httpparser { + +class UrlParser { + public: + UrlParser() : valid(false) {} + + explicit UrlParser(const std::string& url) : valid(true) { + parse(url); + } + + bool parse(const std::string& str) { + url = Url(); + parse_(str); + + return isValid(); + } + + bool isValid() const { + return valid; + } + + std::string scheme() const { + assert(isValid()); + return url.scheme; + } + + std::string username() const { + assert(isValid()); + return url.username; + } + + std::string password() const { + assert(isValid()); + return url.password; + } + + std::string hostname() const { + assert(isValid()); + return url.hostname; + } + + std::string port() const { + assert(isValid()); + return url.port; + } + + std::string path() const { + assert(isValid()); + return url.path; + } + + std::string query() const { + assert(isValid()); + return url.query; + } + + std::string fragment() const { + assert(isValid()); + return url.fragment; + } + + uint16_t httpPort() const { + const uint16_t defaultHttpPort = 80; + const uint16_t defaultHttpsPort = 443; + + assert(isValid()); + + if (url.port.empty()) { + if (scheme() == "https") + return defaultHttpsPort; + else + return defaultHttpPort; + } else { + return url.integerPort; + } + } + + private: + bool isUnreserved(char ch) const { + if (isalnum(ch)) + return true; + + switch (ch) { + case '-': + case '.': + case '_': + case '~': + return true; + } + + return false; + } + + void parse_(const std::string& str) { + enum { + Scheme, + SlashAfterScheme1, + SlashAfterScheme2, + UsernameOrHostname, + Password, + Hostname, + IPV6Hostname, + PortOrPassword, + Port, + Path, + Query, + Fragment + } state = Scheme; + + std::string usernameOrHostname; + std::string portOrPassword; + + valid = true; + url.path = "/"; + url.integerPort = 0; + + for (size_t i = 0; i < str.size() && valid; ++i) { + char ch = str[i]; + + switch (state) { + case Scheme: + if (isalnum(ch) || ch == '+' || ch == '-' || ch == '.') { + url.scheme += ch; + } else if (ch == ':') { + state = SlashAfterScheme1; + } else { + valid = false; + url = Url(); + } + break; + case SlashAfterScheme1: + if (ch == '/') { + state = SlashAfterScheme2; + } else if (isalnum(ch)) { + usernameOrHostname = ch; + state = UsernameOrHostname; + } else { + valid = false; + url = Url(); + } + break; + case SlashAfterScheme2: + if (ch == '/') { + state = UsernameOrHostname; + } else { + valid = false; + url = Url(); + } + break; + case UsernameOrHostname: + if (isUnreserved(ch) || ch == '%') { + usernameOrHostname += ch; + } else if (ch == ':') { + state = PortOrPassword; + } else if (ch == '@') { + state = Hostname; + std::swap(url.username, usernameOrHostname); + } else if (ch == '/') { + state = Path; + std::swap(url.hostname, usernameOrHostname); + } else { + valid = false; + url = Url(); + } + break; + case Password: + if (isalnum(ch) || ch == '%') { + url.password += ch; + } else if (ch == '@') { + state = Hostname; + } else { + valid = false; + url = Url(); + } + break; + case Hostname: + if (ch == '[' && url.hostname.empty()) { + state = IPV6Hostname; + } else if (isUnreserved(ch) || ch == '%') { + url.hostname += ch; + } else if (ch == ':') { + state = Port; + } else if (ch == '/') { + state = Path; + } else { + valid = false; + url = Url(); + } + break; + case IPV6Hostname: + abort(); // TODO + case PortOrPassword: + if (isdigit(ch)) { + portOrPassword += ch; + } else if (ch == '/') { + std::swap(url.hostname, usernameOrHostname); + std::swap(url.port, portOrPassword); + url.integerPort = atoi(url.port.c_str()); + state = Path; + } else if (isalnum(ch) || ch == '%') { + std::swap(url.username, usernameOrHostname); + std::swap(url.password, portOrPassword); + url.password += ch; + state = Password; + } else { + valid = false; + url = Url(); + } + break; + case Port: + if (isdigit(ch)) { + portOrPassword += ch; + } else if (ch == '/') { + std::swap(url.port, portOrPassword); + url.integerPort = atoi(url.port.c_str()); + state = Path; + } else { + valid = false; + url = Url(); + } + break; + case Path: + if (ch == '#') { + state = Fragment; + } else if (ch == '?') { + state = Query; + } else { + url.path += ch; + } + break; + case Query: + if (ch == '#') { + state = Fragment; + } else if (ch == '?') { + state = Query; + } else { + url.query += ch; + } + break; + case Fragment: + url.fragment += ch; + break; + } + } + + assert(portOrPassword.empty()); + + if (!usernameOrHostname.empty()) + url.hostname = usernameOrHostname; + } + + bool valid; + + struct Url { + Url() : integerPort(0) {} + + std::string scheme; + std::string username; + std::string password; + std::string hostname; + std::string port; + std::string path; + std::string query; + std::string fragment; + uint16_t integerPort; + } url; +}; + +} // namespace httpparser + +#endif // HTTPPARSER_URLPARSER_H diff --git a/osquery/tables/events/CMakeLists.txt b/osquery/tables/events/CMakeLists.txt index d023de9b7f4..7701972884e 100644 --- a/osquery/tables/events/CMakeLists.txt +++ b/osquery/tables/events/CMakeLists.txt @@ -24,6 +24,7 @@ function(generateOsqueryTablesEventsEventstable) linux/hardware_events.cpp linux/process_events.cpp linux/process_file_events.cpp + linux/http_events.cpp linux/selinux_events.cpp linux/socket_events.cpp linux/syslog_events.cpp diff --git a/osquery/tables/events/linux/http_events.cpp b/osquery/tables/events/linux/http_events.cpp new file mode 100644 index 00000000000..3b0d66eb8f1 --- /dev/null +++ b/osquery/tables/events/linux/http_events.cpp @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the Apache 2.0 license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include +#include + +#include "osquery/events/linux/http_event_publisher.h" + +namespace osquery { + +class HTTPLookupEventSubscriber + : public EventSubscriber { + public: + Status init() override { + HTTPLookupSubscriptionContextRef sc = createSubscriptionContext(); + subscribe(&HTTPLookupEventSubscriber::Callback, sc); + return Status(0, "OK"); + } + + Status Callback(const ECRef& ec, const SCRef& sc); +}; + +REGISTER(HTTPLookupEventSubscriber, "event_subscriber", "http_events"); + +Status HTTPLookupEventSubscriber::Callback(const ECRef& ec, const SCRef& sc) { + Row r; + r["time"] = BIGINT(ec->time); + r["method"] = ec->method; + r["protocol"] = ec->protocol; + r["local"] = ec->local; + r["remote"] = ec->remote; + r["s_port"] = BIGINT(ec->s_port); + r["d_port"] = BIGINT(ec->d_port); + r["host"] = ec->host; + r["port"] = INTEGER(ec->host_port); + r["uri"] = ec->uri; + r["content_type"] = ec->content_type; + r["user_agent"] = ec->user_agent; + r["ja3"] = ec->ja3; + r["ja3_fingerprint"] = ec->ja3_fingerprint; + r["other_headers"] = ec->other_headers; + + add(r); + return Status(0, "OK"); +} +} // namespace osquery diff --git a/specs/CMakeLists.txt b/specs/CMakeLists.txt index f40826dfedc..857f4cc6606 100644 --- a/specs/CMakeLists.txt +++ b/specs/CMakeLists.txt @@ -169,6 +169,7 @@ function(generateNativeTables) "linux/elf_sections.table:linux" "linux/selinux_settings.table:linux" "linux/apparmor_profiles.table:linux" + "linux/http_events.table:linux" "linwin/intel_me_info.table:linux,windows" "lldpd/lldp_neighbors.table:linux,macos,freebsd" "kernel_info.table:linux,macos,windows" diff --git a/specs/linux/http_events.table b/specs/linux/http_events.table new file mode 100644 index 00000000000..223b46ba952 --- /dev/null +++ b/specs/linux/http_events.table @@ -0,0 +1,21 @@ +table_name("http_events") +description("Tracks HTTP request header.") +schema([ + Column("time", BIGINT, "Time of HTTP event"), + Column("method", TEXT, "HTTP request method GET/POST/PUT/DELETE/OPTIONS/PATCH"), + Column("protocol", TEXT, "SSL protocol used in communication(only for HTTPS/TLS)"), + Column("local", TEXT, "IP address of the local interface"), + Column("remote", TEXT, "IP address of the HTTP responder"), + Column("s_port", BIGINT, "Source port"), + Column("d_port", BIGINT, "Destination port"), + Column("host", TEXT, "Host name available in HTTP header"), + Column("port", INTEGER, "Port number from HTTP URL"), + Column("uri", TEXT, "URI added to HTTP host name"), + Column("content_type", TEXT, "Content type of HTTP request"), + Column("user_agent", TEXT, "Client making HTTP request"), + Column("ja3", TEXT, "Parameters responsible for JA3 calculation(only for HTTPS/TLS)"), + Column("ja3_fingerprint", TEXT, "MD5 hash of ja3 string(only for HTTPS/TLS)"), + Column("other_headers", TEXT, "Others headers available in a HTTP packet(only for HTTP)") + ]) +attributes(event_subscriber=True) +implementation("http_events@http_events::genTable")